Bug 89960 - Clear direct formatting with ctrl+doubleclick at the Stylist
Summary: Clear direct formatting with ctrl+doubleclick at the Stylist
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
: 102230 (view as bug list)
Depends on:
Blocks: Sidebar-Styles
  Show dependency treegraph
 
Reported: 2015-03-11 20:17 UTC by Joel Madero
Modified: 2022-03-31 10:24 UTC (History)
13 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 Joel Madero 2015-03-11 20:17:14 UTC
There are essentially two ways that a user might apply a style:
1. Select the style in advance, then start typing;
2. Have text already written and then select it, and apply a style.

Suggestion to change behavior of the interaction between styles and direct formatting to address these two different use cases.

For #1 (selecting style in advance and then typing);
*This should overwrite any direct formatting that has been previously applied in the document.
**For a demonstration of why this should be the case, please take a look at bug 83726
***Note that this would be equivalent of doing ctrl + m and then applying the style

For #2 (have text already, then apply style)
*Suggest that a dialog appears if there is any direct formatting applied in the selected text (i.e. if a word is italicized, bolded, etc…) that says something like “do you want the style to overwrite any direct formatting in the selected text”
**This can be similar to the dialog that appears in Calc if you copy/paste into a cell that already has a value
**This should have an option to say “do this every time.”

This should avoid breaking the workflow of people used to the current behavior, and add the ability to make it more intuitive for those who find the current process counter-intuitive (those who want a style to be applied uniformly every time). Talking on QA channel and on user mailing list makes me think that the current situation is counter-intuitive to a fair number of people. Also I know at least a couple bugs have been closed because people were unaware of the direct formatting always taking precedent over styles. At least some users – myself included – think that if I have taken the time to define a style, I want that style to apply the same way, every single time.
Comment 1 Octavio Alvarez 2015-03-12 00:28:28 UTC
The case exposed in bug #83726 is invalid because the user did not properly use the tool. *However*, a change could be done to prevent users from falling into the 'hidden DF trap' and making the program behavior more consistent.

I recommend discussing --in a separate bug-- the issue of what should happen if the user uses DF to the visual equivalent of removing DF.

Suppose:

1. A paragraph has a style that uses Bold.

2. The user selects part of the paragraph (selection "A") and hits Bold.

3. Then, the user selects a subsection of selection "A" (selection "B") and hits bold again.

Currently, the selection "B" will have 'DF:bold'. The alternative is to have 'DF:regular' removed.

[*] DF = Direct Formatting
Comment 2 Joel Madero 2015-03-12 00:34:45 UTC
I really think that you all should talk to users about their experience with the tool (ping the user mailing list for instance). The way I use it is how *many* people use it - so to say we are using it wrong, means that the tool is designed in a way that makes it intuitive to use it wrong which is a problem in and of itself.

This notion that because it was designed this way it should never change is just silly - join QA channel and ask for input there (I've spoken with 5+ in that room, and we are all contributors) who agree that the current behavior is counter-intuitive. I also pinged the user mailing list and had multiple users agree that it's not intuitive. Lastly, there have been a couple other bugs that described the same problem.

So - while you may say I'm wrong for using the tool this way, I'd respond with "then make the tool more intuitive."

If the goal is to get users to use styles more - I'm afraid the job is not going well. I would never recommend users to use styles with how they currently function - I use LibreOffice daily for legal work, I contribute both in QA and other places, etc.. etc... and I'm thinking about not using styles any more because I'm *constantly* having to interrupt my workflow and do ctrl+m.

Anyways - I think my proposed solution could work for everyone.
Comment 3 Cor Nouws 2015-03-12 08:40:47 UTC
(In reply to Octavio Alvarez from comment #1)

> I recommend discussing --in a separate bug-- the issue of what should happen
> if the user uses DF to the visual equivalent of removing DF.
> [...]
> Currently, the selection "B" will have 'DF:bold'. The alternative is to have
> 'DF:regular' removed.
> [...]

I see no objection in that change. But do not have an overview of all details involved.
Thanks for explaining Octavio.
Cor
Comment 4 Cor Nouws 2015-03-12 08:44:38 UTC
Hi Joel,

I like your proposal:
with a selection containing direct formatting, when a style is applied, the users is promted for removing all that direct formatting or not.

(In reply to Joel Madero from comment #0)
> For #1 (selecting style in advance and then typing);
> *This should overwrite any direct formatting that has been previously
> applied in the document.

I think I do not understand how, when I open an existing document, put the cursor somewhere, select a style.. that all direct formatting should be removed.
But IMO that is not influencing my opinion on the large proposal.

Thanks,
Cor
Comment 5 Octavio Alvarez 2015-03-12 17:12:17 UTC
Joel, can you provide references to the discussion of the (In reply to Joel Madero from comment #0)
> There are essentially two ways that a user might apply a style:
> 1. Select the style in advance, then start typing;

By 'in advance', are you talking about the application of a style in an empty paragraph?

> For #2 (have text already, then apply style)
> *Suggest that a dialog appears if there is any direct formatting applied in
> the selected text (i.e. if a word is italicized, bolded, etc…) that says
> something like “do you want the style to overwrite any direct formatting in
> the selected text”
> **This can be similar to the dialog that appears in Calc if you copy/paste
> into a cell that already has a value
> **This should have an option to say “do this every time.”

This forces the user to choose one or the other. If the user is unsure and does not click 'do this every time', the user will be interrupted on each style application until he makes up his mind.

If the devs opt for going with this option, I suggest to use the word 'remove' instead of 'overwrite'.

> This should avoid breaking the workflow of people used to the current
> behavior, and add the ability to make it more intuitive for those who find
> the current process counter-intuitive (those who want a style to be applied
> uniformly every time).

> Talking on QA channel and on user mailing list makes
> me think that the current situation is counter-intuitive to a fair number of
> people.

Can you provide a URL to the discussion?
Comment 6 Joel Madero 2015-03-12 20:38:30 UTC
(In reply to Octavio Alvarez from comment #5)
> Joel, can you provide references to the discussion of the (In reply to Joel
> Madero from comment #0)
> > There are essentially two ways that a user might apply a style:
> > 1. Select the style in advance, then start typing;
> 
> By 'in advance', are you talking about the application of a style in an
> empty paragraph?

Yes - exactly how the bug that you closed demonstrated and as I explained last night to you in IRC.

> 
> > For #2 (have text already, then apply style)
> > *Suggest that a dialog appears if there is any direct formatting applied in
> > the selected text (i.e. if a word is italicized, bolded, etc…) that says
> > something like “do you want the style to overwrite any direct formatting in
> > the selected text”
> > **This can be similar to the dialog that appears in Calc if you copy/paste
> > into a cell that already has a value
> > **This should have an option to say “do this every time.”
> 
> This forces the user to choose one or the other. If the user is unsure and
> does not click 'do this every time', the user will be interrupted on each
> style application until he makes up his mind.
> 
> If the devs opt for going with this option, I suggest to use the word
> 'remove' instead of 'overwrite'.

Sure - it's UX though that decides not developers :)

> 
> > This should avoid breaking the workflow of people used to the current
> > behavior, and add the ability to make it more intuitive for those who find
> > the current process counter-intuitive (those who want a style to be applied
> > uniformly every time).
> 
> > Talking on QA channel and on user mailing list makes
> > me think that the current situation is counter-intuitive to a fair number of
> > people.
> 
> Can you provide a URL to the discussion?

Obviously IRC chats are not logged and therefore there is no URL. But, last night you heard from one of our most experienced developers (shm_get) who agreed 100% with me. You can also talk to any of this list of people in IRC for confirmation (beluga, colonolqubit, jphillipz, mjayfrancis, wantstohelp and Sophie). Those are all experienced contributors)

As for the user thread - here is a link: https://www.mail-archive.com/users@global.libreoffice.org/msg41274.html



@Cor - all I mean is that if you start a new paragraph, and no text at all has been written, and then select a style, that style should remove any direct formatting that has carried over from the previous paragraph and the style should be applied *as defined.*
Comment 7 Cor Nouws 2015-03-12 21:55:16 UTC
(In reply to Joel Madero from comment #6)

> Obviously IRC chats are not logged and therefore there is no URL. But, last
> night you heard from one of our most experienced developers (shm_get) who
> agreed 100% with me. You can also talk to any of this list of people in IRC
> for confirmation (beluga, colonolqubit, jphillipz, mjayfrancis, wantstohelp
> and Sophie). Those are all experienced contributors)

While really appreciating all peoples contributions, that does not mean that they are per see experts in all area's ;)

But still, I already gave my + 2 for the proposed idea :)


> @Cor - all I mean is that if you start a new paragraph, and no text at all
> has been written, and then select a style, that style should remove any
> direct formatting that has carried over from the previous paragraph and the
> style should be applied *as defined.*

Ah, that helps. Thanks. (There is an issue to solve the problem that direct formatting at the end of a line is taken to the next)
Comment 8 Owen Genat (retired) 2015-03-12 23:38:07 UTC
My comments in related bug 83726 need clarification. I am not trying to be argumentative but rather just provide contextual information. On re-reading my comments (in that bug) I realise it may sound as though I am suggesting this is a limitation of ODF/OOXML, however it is probably an implementation issue. I do however feel this is a difficult enhancement as there are  conformance, legacy, and likely numerous technical considerations. A basic example can be created from the text "a b c" using a simplified variant of the example in comment three of bug 83726:

<p style="P1">a
   <span style="C1">b </span>c
</p>

This could be a paragraph style P1 (e.g., italic) with directly applied character formatting C1 (e.g., Roman/non-bold) to "b". Currently, applying a different paragraph style (e.g., P2 defined as bold) results in:

<p style="P2">a
   <span style="C1">b </span>c
</p>

... thus it does not override the Roman/non-bold styling on "b". It seems like this enhancement is suggesting the result should be:

<p style="P2">a b c</p>

... which does remove the Roman/non-bold on "b" and bolds the entire paragraph. Bear in mind that this is a simple example. Actual examples can be significantly more complex but the overall proposed result would be similar. Many tests would need to be run on an enhancement of this nature to ensure it has no adverse effects.
Comment 9 Joel Madero 2015-03-13 00:39:25 UTC
I agree that case #2 (which seems to be the one you're referring to) is much more complex - although I think the dialog option would allow the same functionality that currently exists but increase functionality for people like me who expect styles to be consistently applied.


But there seems to be general agreement as to case #1 (the case where nothing is written, you choose a style, and then start typing). 

@Owen - thanks for your thoughtful feedback.
Comment 10 Octavio Alvarez 2015-03-13 01:53:33 UTC
Yes, I would like to agree on case #1 too.
Comment 11 John Russell 2016-04-06 06:21:11 UTC
I agree with both Joel's cases, although personally I think that the user's last election should overwrite all previous ones. 

For example often you are working with documents created elsewhere. Power users need to be able to apply styles over existing direct formatting. 

Naive users will continue with direct formatting. 

My experience is that I will apply styles first, then overwrite specific parts with direct formatting where I need an uncommon local style. To do it the other way round makes a difficult workflow where you can't see the look and feel of the document until you've finished. 

LibreOffice Writer is the only package I've seen which does not overwrite previous selections with more recent ones.
Comment 12 Yousuf Philips (jay) (retired) 2016-04-25 22:07:47 UTC
This is definitely a complex decision to make when deciding what the default behaviour should be, as some users would want it one way and others would like it another way, and even worse is that some users would want it one way one time and another way another time. :D

As a basic style user, meaning i only use the styles that come preconfigured, for me, i would expect that LO wouldnt overwrite/remove things that i have specifically set. Like if i have set text using direct formatting, i would dislike that applying a paragraph style would overwrite that direct formatting.

(In reply to Joel Madero from comment #9)
> I agree that case #2 (which seems to be the one you're referring to) is much
> more complex - although I think the dialog option would allow the same
> functionality that currently exists but increase functionality for people
> like me who expect styles to be consistently applied.

Not sure if showing a dialog would be the way to go, and instead a checkbox or drop down menu in the options dialog would be the better option for power/style users to set.

(In reply to John Russell from comment #11)
> For example often you are working with documents created elsewhere. Power
> users need to be able to apply styles over existing direct formatting. 

Yes we need better tools for power/style users to use to make it easy for them to not only create styled documents but also convert direct formatting documents into styled document.

This discussion make me think about Wordperfect's reveal codes feature (bug 34002) as well as the improved styles and formatting tab in the sidebar (bug 90646), as both would be beneficial to power/style users.
Comment 13 V Stuart Foote 2016-09-17 11:55:07 UTC
*** Bug 102230 has been marked as a duplicate of this bug. ***
Comment 14 marshals 2016-09-19 09:48:16 UTC
my bug 102230 just got closed as a duplicate of this, and since this thread has gone quiet i thought i'd add my 2c.

if i put the cursor in a text heading, right-click and chose "Edit Style...", then add underlining, see the example text gain underlining, then chose OK and not see my change take effect in the text, i'm going to assume there's a bug.

i appreciate the underlying issues are complex, but i definitely did not intend for nothing to happen when i performed my actions.

if there is no agreement as to what should be applied[*], could Writer provide a popup warning with enough info for the user to determine what their choices are and how to achieve them?  (ie, how to get the formatting they're trying to apply to be applied in whatever way they really want.)

[*] eg, the "Edit Style..." dialog could have a checkbox to indicate whether to "merge or replace formatting" or somesuch.
Comment 15 Cor Nouws 2016-09-19 18:29:56 UTC
still a good proposal. Bump it up a bit :)
Comment 16 LibreTraining 2017-04-21 18:58:36 UTC
In Adobe InDesign you select insert the cursor in the paragraph:

- Click the style name, applies the paragraph style, and leaves any direct formatting

OR

- Control+Click the style name, applies the paragraph style, and removes all direct formatting

Very simple to learn and to use.
Comment 17 Thomas Lendo 2017-06-10 10:07:46 UTC
(In reply to Yousuf Philips (jay) from comment #12)
> (In reply to Joel Madero from comment #9)
> > I agree that case #2 (which seems to be the one you're referring to) is much
> > more complex - although I think the dialog option would allow the same
> > functionality that currently exists but increase functionality for people
> > like me who expect styles to be consistently applied.
> Not sure if showing a dialog would be the way to go, and instead a checkbox
> or drop down menu in the options dialog would be the better option for
> power/style users to set.
I second the idea of an option where users can decide to have styles overriding every existing formatting like Ctrl+m plus applying style.

Additionally I like the idea of LibreTraining in comment 16. It's simple and wouldn't interrupt today's behavior.
Comment 18 Xisco Faulí 2019-11-29 13:28:31 UTC
Changing priority back to 'medium' since the number of duplicates is lower than 5
Comment 19 Heiko Tietze 2021-06-21 07:05:54 UTC
Don't think ctrl+click (apply style and clear formatting) is easy to understand. But surely it doesn't break existing workflows. I also wonder what formatting should be cleared:

in case of PS: DPS (acceptable) and CS and DF (-1)?
in case of CS: DF (acceptable)

IMHO we have enough means to clean formatting. We should implement better feedback with the styles highlighter (bug 38194, bug 106556, bug 34002) and keep the interaction simple.

What do you think, Mike?

PS: paragraph style
DPS: direct formatted paragraph style
CS: character style
DF: direct formatting
Comment 20 Mike Kaganski 2021-06-21 21:26:00 UTC
(In reply to Heiko Tietze from comment #19)
> Don't think ctrl+click (apply style and clear formatting) is easy to
> understand. But surely it doesn't break existing workflows. I also wonder
> what formatting should be cleared:
> 
> in case of PS: DPS (acceptable) and CS and DF (-1)?
> in case of CS: DF (acceptable)

I agree that this is not a bad feature, seemingly not harming any workflow. I second the suggestion to only clear paragraph direct formatting when special-applying paragraph style, and clear character direct formatting when special-applying character style. By the way, there are more styles ;-) - so what to do with lists - do you want to clear that direct formatting when special-applying paragraph style, or keep it, and only clear when special-applying list style? Or clear it when special-applied paragraph style contains associated list style?

> DPS: direct formatted paragraph style

Please, there's no such thing. There is paragraph direct formatting, and character direct formatting. Or if you prefer, direct paragraph formatting, and direct character formatting ;-) This depends on the level at which some properties are defined. Direct formatting applied on paragraph level does *not* create a "style".
Comment 21 Heiko Tietze 2021-06-22 06:53:45 UTC
Let's do it.

Ctrl+doubleclick a style on the Stylist should
* in case of PS: 
  + clear DFP and LS (not CS, DF, PgS, TS, FS)
* in case of CS
  + DF

It should be a double click since ctrl+click usually toggles a selection and while multiselection is not relevant here the goal is to have a modifier for the default command, which is double click (single click selects for modification).

As a bonus we could add "Apply (double click)" and "Clear and Apply (ctrl+doubleclick)" (or the like) on the context menu to provide a clue about the functionality.

Interesting easy hack?



PS: paragraph style
CS: character style
LS: list style
PgS: page style
TS: table style
FS: frame style
DF: direct formatting (of character attributes)
DFP: direct formatting of paragraph (attributes)