Bug 162209 - Duplicate a style
Summary: Duplicate a style
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Sidebar-Styles
  Show dependency treegraph
 
Reported: 2024-07-26 14:09 UTC by peter josvai
Modified: 2024-08-09 07:05 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description peter josvai 2024-07-26 14:09:44 UTC
hi, 


PRE:
this has been brought up some time ago, once by me, too, see:
Bug 152189 - styles list "new", plus "DUPLICATE"

wontfix (the enhancement suggestion)


Still, I'll give it  ago...
Why? Because the reasons given by two developers were based on a "false fact"
(They assumed that changing the "Inherit from" reference won't change the styles attributes accordingly, which is not how it works in reality -- the attributes will change according to the new "Inherit from" reference)
- - - - - - - - - - - - - - - - - - - 


So, you are in the styles pane...
you have  "my_paragraph" in the list..  (underscores are not necessary, I know)

This style has several attributes, including some affecting: alignment, textflow, font and font-effects and border... for example.
These are "the usual suspects" when you need to check whether 2 styles are next to identical....

Imagine that you want to have a variant of this style...
a variant that's only different in one attribute... say, border color

In this case I'd go: "duplicate this style"...

which would make my list look like this:

Body Text
    |
    |
    my_paragraph
    my_paragraph(copy)

Then I could rename them to fit the style concept of the document, 
like:

Body Text
    |
    |
    my_paragraph orange border
    my_paragraph azure border


:: BUT THIS ↑↑ IS NOT POSSIBLE YET
- - - - - - - - - - - - - - - - - - - 


What you can do: 
create a new style based on my paragraph...
the result will be like this:

Body Text
    |
    |
    my_paragraph
        |
        |
        my_paragraph_B


The problem will be that you have two variants but one is one level UP...
ALSO...
being "one level up" has a meaning, too...
If you change anthing in "my_paragraph", "my_pragraph_B" will be changed too...
THIS IS not how variants are supposed to work :) 
THis is how derivatives work. Two toally different things.

But back to our case:
Wouldn't it look better like this?

Body Text
    |
    |
    my_paragraph
    my_paragraph_B
    
And we could change either without getting the other modified too.

- - - - - - - - - - - - - - - - - - -     
NOTE:    
the point wuld be to work with your styles in a smooth, intuitive way, 
if you want a variant, just create one, "copy & paste" (duplicate)...

PS:
We should bear in mind that changing the "inherit from" reference will change the style.
Comment 1 Roman Kuznetsov 2024-07-29 12:20:13 UTC
I'm not sure why to ask the same again, but I added UX team
Comment 2 Eyal Rozenberg 2024-07-30 21:26:30 UTC
> Imagine that you want to have a variant of this style...
> a variant that's only different in one attribute... say, border color
> 
> In this case I'd go: "duplicate this style"...

If I understand correctly, and reading your other bug (bug 152189), you want to have a style which:

1. is a direct child of the same style as my_paragraph (call it parent_style)
2. has very similar modifications relative to parent_style

I... have to admit that this is a legitimate desire, certainly with the way styles are right now; and you're denied this ability. Even if you start from a child of my_paragraph and move it up (e.g. by drag-and-drop) - you'll get: 

  parent_style + (my_paragraph_copy - my_paragraph)

instead of:

  parent_style + ((my_paragraph - parent_style) + (my_paragraph_copy - my_paragraph))

which is what you wanted.

I will, however, ask you this: In your example, you listed:

* my_paragraph orange border
* my_paragraph azure border

this is _not_ the right feature to give you that. Instead, you should use style composition: bug 149271. LO doesn't have it yet, but it could, and should. In your example, your will have three styles:

1. my_paragraph
2. orange_border
3. azure_border

which are all defined as "deltas"

and you will be able to apply (1.) and (2.), or (1.) and (3.), to the same paragraph at once. Would that be satisfactory, in your opinion, without the ability to duplicate styles?
Comment 3 Heiko Tietze 2024-08-09 07:05:49 UTC
We discussed the topic in the design meeting. The request was rejected in bug 152189  because Duplicate was assumed to be the same as New+Move, and the little benefit does not justify the effort to implement and the detriment for usability of an unclear function.

However, duplicating a style would be different from New+Move as modifications are not hierarchically taken into the children but defined as attribute. For example, if the style Default PS > "Red" has a red font color and "Red+bold" is created as children, moving it one level above drops the color. The requested "Duplicate" feature creates a copy of the style under the same hierarchy level and makes a different workflow possible.

It's relevant for PS but could also be handy for CS. And actually there is no good reason to block other style families.

Since we do not want to force users into a certain workflow the feature needs to be available as ordinary command too. In this case it might work similar to "New Style from Selection" with just an option to enter the name. When started from the Stylist it should work like "New..." and show the PS properties dialog.