Bug 70759 - Apply Style toolbar "Clear formatting" action sets "Text Body" instead of "Default Style" from LO 4.1+
Summary: Apply Style toolbar "Clear formatting" action sets "Text Body" instead of "De...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.1.0.4 release
Hardware: All All
: medium minor
Assignee: Not Assigned
URL:
Whiteboard: BSA target:6.2.0
Keywords: bibisected, bisected
Depends on:
Blocks: Clear-Formatting Writer-Styles-Paragraph-Combobox
  Show dependency treegraph
 
Reported: 2013-10-22 12:05 UTC by dehcjam
Modified: 2020-12-30 20:58 UTC (History)
17 users (show)

See Also:
Crash report or crash signature:


Attachments
Change style example (10.13 KB, text/odt)
2016-02-10 20:17 UTC, Timur
Details

Note You need to log in before you can comment on or make changes to this bug.
Description dehcjam 2013-10-22 12:05:17 UTC
Problem description: 

Steps to reproduce:
1. Select portion of formatted text
2. Choose "Clear formatting" from the Apply style drop-down menu
3. 

Current behavior: Text is formatted to "Text Body"

Expected behavior: Text is formatted to "Default Style"

In LibreOffice 3.6 in Windows the result used to be "Default Style" (LibreOffice 3.6 still does that faithfully in openSUSE 12.3).
This is not critical as one can choose "Default Style" and end up there.

              
Operating System: Windows 7
Version: 4.1.2.3 release
Last worked in: 3.6.5.2 release
Comment 1 Cor Nouws 2013-10-22 13:24:19 UTC
Hi dehcjam,

thanks for the issue. IMHO the Clear formatting is the same as menu "Format > Remove direct formatting"
Choose Standard in that box to set the style to standard.

Regards,
Cor
Comment 2 V Stuart Foote 2014-06-07 15:29:52 UTC
Cor, *,

Looking at remaining issue of bug 71233 and in reviewing that, picked up this issue.  Reopening, setting minor and pointing to UX-advise for discussion. 

I would suggest that there is a difference between the Format -> Clear Direct Formatting (Ctl+M) menu and the Styles and Formatting menu bar - Apply Style drop down action "Clear Formatting"

And the OP does raise a valid issue, that clearing style results in assignment of "Text Body" style rather than "Default Style"

I believe the Format menu action now correctly only applies changes to elements that diverge from a defined style. 

On Windows 7 sp1, 64-bit with
Version: 4.3.0.0.beta2
Build ID: a06aa316117a6ff0f05c697c82831c227812d810

To demonstrate:

1. Create, or open, a Writer document and use paragraph styles other than default.

2. Select some block of text within a paragraph and make some formatting change against the style.

3. Select half of that block, and select the Format -> Clear Direct Formatting. That half of the selected text reverts to the assigned style for the paragraph. The unselected remains as changed against the style.

4. Now select the remainder of the paragraph. And use the Apply Style drop down to "Clear formatting" from the selection.  The result is that the selection loses both its direct formatting -- as well as its assigned style. Becoming "Text Body"

This distinction between styles vs. direct formatting is subtle, but is being handled correctly, especially as we try to encourage folks to more completely adopt use of styles for document formatting.

But, IMHO the available Apply Style tool bar action to remove a style from a paragraph should not then assign a specific style to the paragraph ("Text Body" as here), but rather should honor the generic "Default Style" that a new paragraph would be created with.

OP issue is valid. But also, regards the <F11> dialog window, and its implementation in the SideBar (bug 71233), there should be an Apply Style -> Clear formatting action.
Comment 3 Jon Grossart 2014-10-11 06:02:02 UTC
Not sure when the change went in. Both options used to reset the selected text to "Default Format". It was like that in many releases on Windows.

I just noticed the change now on 4.3.2.2.

I can see the case for "Clear direct formating" to just match it to the rest of the paragraph, but that's not really a clear description for it.

And I would think "Clear formatting" would put it back to the Default Style. If they are supposed to be the same, then the verbage in the pull down selection should be made to match.
Comment 4 V Stuart Foote 2014-11-05 04:21:46 UTC
QA house keeping setting as NEW. UX and design issue remains as described.
Comment 5 Octavio Alvarez 2014-12-12 22:14:43 UTC
The "Clear formatting" in the dropdown should be either:

a. removed, or,

b. kept but match the context menu "Clear Direct Formatting" and renamed accordingly.


In any other case it duplicates other options and just causes confusion:

1. If "Clear formatting" resets paragraph to "Default Style" it is a duplicate of choosing "Default Style" from the dropdown menu.

2. If "Clear formatting" resets paragraph to "Text body" it is a duplicate of choosing "Text body" from the dropdown menu.


In conclusion, neither the Current behavior nor the Expected behavior from the OP are a good idea. That's what choosing 'Default Style' is for in the dropdown menu.
Comment 6 Octavio Alvarez 2014-12-12 22:23:53 UTC
I would like to amend my last comment.

The third option for the dropdown is to be renamed to 'Clear ALL formatting', thus removing both, styles and direct formatting.

Thanks.
Comment 7 Cor Nouws 2014-12-13 09:42:16 UTC
(In reply to Octavio Alvarez from comment #5)

> b. kept but match the context menu "Clear Direct Formatting" and renamed
> accordingly.

I agree with this.
Also change the summary a bit.

[ On a side note: "Clear direct formatting" does currently not remove character styles. It did in the past. But has been changed here
  http://cgit.freedesktop.org/libreoffice/core/commit/?id=6e690e0909459d46c53d17e7939891abea11e566
Also read this
  https://issues.apache.org/ooo/show_bug.cgi?id=47893

That is correct.
Now from what I remember, Ctrl+Shft+M was thought to remove _also_ applied character styles. However it does not. Now I do see in Tools> Customise that Ctrl+Shft+X should "remove direct character formatting". It does nothing however. And of course also is not the same as removing applied character styles..)
Comment 8 Patrik 2015-04-14 07:37:54 UTC
I am very glad, that this feature got re-implemented. Removing formatting got really annoying since someone decided that it should mean "remove paragraph formatting". 

Keep it as it is now, by all means. Because:

1) The feature as it is now does what the equivalent in Word "Remove Formatting" achieves.
2) Pasting text and then removing foreign formatting is a very common use-case. Especially as the "Paste Special > Unformatted Text" feature in LO is not always presented (even though text in clipboard has formatting).

Keep it. And if I may suggest: allow users to have a keyboard short-cut. Now it seems only accessible from the menu.

The workaround that I use now is to have keyboard shortcuts for:
- "clear direct formatting"
- "remove direct character formats"
- "apply default character style"
- "apply default paragraph style"

Which does remove *all* formatting. However I have to press 4 buttons (or write a Macro, which crashes LO at the moment).
Comment 9 Cor Nouws 2015-04-14 10:54:05 UTC
(In reply to Octavio Alvarez from comment #6)
> I would like to amend my last comment.
> 
> The third option for the dropdown is to be renamed to 'Clear ALL
> formatting', thus removing both, styles and direct formatting.

This is what the OP and Stuart (comment#2) argues for.
Rethinking I tend to give this my preference now..
Comment 10 Cor Nouws 2015-04-14 10:56:45 UTC
Hi Patrik,

(In reply to Patrik from comment #8)
> I am very glad, that this feature got re-implemented. Removing formatting
> got really annoying since someone decided that it should mean "remove
> paragraph formatting". 
> 
> Keep it as it is now, by all means. Because:
> 
> 1) The feature as it is now does what the equivalent in Word "Remove
> Formatting" achieves.

This is indeed what 'Format > Clear direct formatting' is

> 2) Pasting text and then removing foreign formatting is a very common
> use-case. Especially as the "Paste Special > Unformatted Text" feature in LO
> is not always presented (even though text in clipboard has formatting).
> 
> Keep it. And if I may suggest: allow users to have a keyboard short-cut. Now
> it seems only accessible from the menu.

And the context menu and Ctrl+M

> The workaround that I use now is to have keyboard shortcuts for:
> - "clear direct formatting"
> - "remove direct character formats"

In my experience "clear direct formatting" also does "remove direct character formats". Not character styles. (See my comment #7)

> - "apply default character style"
> - "apply default paragraph style"
> 
> Which does remove *all* formatting. However I have to press 4 buttons (or
> write a Macro, which crashes LO at the moment).

..
Comment 11 Robinson Tryon (qubit) 2015-12-09 18:28:52 UTC Comment hidden (no-value, obsolete)
Comment 12 Timur 2016-02-10 20:17:05 UTC Comment hidden (obsolete)
Comment 13 Cor Nouws 2016-02-10 20:58:11 UTC Comment hidden (obsolete)
Comment 14 QA Administrators 2017-03-06 15:54:50 UTC Comment hidden (obsolete)
Comment 15 Timur 2017-03-06 20:15:57 UTC Comment hidden (obsolete)
Comment 16 Octavio Alvarez 2017-03-07 04:41:26 UTC Comment hidden (obsolete)
Comment 17 Timur 2017-03-07 08:06:21 UTC Comment hidden (obsolete)
Comment 18 V Stuart Foote 2017-03-07 16:43:02 UTC
@Samuel, Kendy, *

A golden oldie here...

Was poking around at this, the difference between Default (ex "Standard") and our "Text Body" paragraph format is a little disconcerting. That is to say if creating a new paragraph it will receive "Default" but applying the "Clear formatting" action picks up the first on the revised list of "Text Body".

Seems like it should have consistent action.

=-ref-=

http://nabble.documentfoundation.org/Libreoffice-ux-advise-Default-Styles-in-Writer-td4020441.html

https://gerrit.libreoffice.org/#/c/1248/

https://cgit.freedesktop.org/libreoffice/core/commit/?id=b22881c8166708d6fd42fbadad47ff880ba19ed4
Comment 19 Thomas Lendo 2017-06-05 18:42:48 UTC
Should this command respect template presets? If the change to Text Body is done by Bug 47295 - Default paragraph style should be "Text body" and not "Default", then this bug shouldn't be fixed or shouldn't be static and respect the template.
Comment 20 Thomas Lendo 2017-06-05 18:49:50 UTC
Also I agree with Octavio's comment 5 but I don't like the idea of comment 6. Another clear function would confuse users. Clear direct formatting, clear all formatting ... Why should styles also be cleared? Does it also clear list settings? Where's the limit?
Comment 21 Yousuf Philips (jay) (retired) 2017-06-05 21:45:31 UTC
@raal, @xisco, @aron: Can either of you track down the commit this was made in so we can see the reasoning behind it?
Comment 22 Aron Budea 2017-06-05 23:25:29 UTC
Bibisected down to this range:
https://cgit.freedesktop.org/libreoffice/core/log/?qt=range&q=1ec666e2c2570e246d2603e6bf5754aaa08f4b92..ec530530b7c4afbc7b521aaf05ac4e3d527fdf7e

From the range, only the following is a candidate:
https://cgit.freedesktop.org/libreoffice/core/commit/?id=b22881c8166708d6fd42fbadad47ff880ba19ed4
author		Samuel Mehrbrodt <s.mehrbrodt@gmail.com>	2012-12-05 19:48:43 (GMT)
committer	Bosdonnat Cedric <cedric.bosdonnat@free.fr>	2012-12-06 09:36:21 (GMT)

Modify the default Style list in Writer, give them a custom order.
Asking on UX-Advise, there were no negative voices for this change:
http://nabble.documentfoundation.org/Libreoffice-ux-advise-Default-Styles-in-Writer-td4020441.html
Comment 23 Yousuf Philips (jay) (retired) 2017-06-06 13:56:49 UTC
(In reply to Aron Budea from comment #22)
> From the range, only the following is a candidate:
> https://cgit.freedesktop.org/libreoffice/core/commit/
> ?id=b22881c8166708d6fd42fbadad47ff880ba19ed4

Thanks. Guess the removal of "Standard" from the top of the aWriterStyles[] has caused this behaviour and that can easily be fixed, especially as "Standard" (aka Default Style) still remains at the top of the list.
Comment 24 V Stuart Foote 2017-06-06 14:50:06 UTC
(In reply to Yousuf Philips (jay) from comment #23)
> Thanks. Guess the removal of "Standard" from the top of the aWriterStyles[]
> has caused this behaviour and that can easily be fixed, especially as
> "Standard" (aka Default Style) still remains at the top of the list.

Yes discussions were as I'd linked in comment 18, but still need to finalize bug 47295, do we default style to "Default" aka "Standard" or to "Text Body" as caused by the changed list?

Better question might be why, when creating a new paragraph, do we pick up "Default" (ex. Standard) rather than "Text Body"?  And accept that when clearing formatting "Text Body" is the correct format (though it needs adjustment as in bug 94464).
Comment 25 Jon Grossart 2017-06-06 18:25:43 UTC
This also matches one of my suggestions in 46550.

In doing reading of how to format "properly", it seems like "Default" should only be used to set font family/size, and not really used at in the document.

It would seem like the default format in a new document should be "Text Body" rather than "Default".
Comment 26 Yousuf Philips (jay) (retired) 2017-06-07 04:03:52 UTC
(In reply to V Stuart Foote from comment #24)
> Yes discussions were as I'd linked in comment 18, but still need to finalize
> bug 47295, do we default style to "Default" aka "Standard" or to "Text Body"
> as caused by the changed list?

Oh okay. I didnt think samuel's change there caused the change regression.

> Better question might be why, when creating a new paragraph, do we pick up
> "Default" (ex. Standard) rather than "Text Body"?  And accept that when
> clearing formatting "Text Body" is the correct format (though it needs
> adjustment as in bug 94464).

Well the default template starts off with "Default" for paragraphs, so that is automatically used unless you create a new paragraph by pressing enter from a heading style, wherein which the newly paragraph takes on "Text Body". So if we dont use "Text Body" by default, we should change heading styles' next style to "Default".

(In reply to Jon Grossart from comment #25)
> In doing reading of how to format "properly", it seems like "Default" should
> only be used to set font family/size, and not really used at in the document.
> 
> It would seem like the default format in a new document should be "Text
> Body" rather than "Default".

With all previously created documents using "Default" and MS Word using "Normal" which maps to LO's "Default", i would keep "Default" as the default.
Comment 27 QA Administrators 2018-06-08 02:47:53 UTC Comment hidden (obsolete)
Comment 28 V Stuart Foote 2018-07-28 14:20:35 UTC
This issue remains. We apply a Text Body paragraph style when using the "Clear formatting" action from the Apply Styles droplist of the Formatting toolbar.

Correct action should be to apply Default Style to restore paragraph to match default format when creating paragraphs as from standard template. 

Hey @Samuel, in hindsight, your thought on now restoring a Default (Standard template) derived style result? Removing Style and ending with non-defaults as a style is not logical. If it is a simple as restoring the "Standard" to the top of the list in tbcontrl.cxx seems like we should. And if we ever move to a Text Body style by default (needing template changes) can realign then.

=-ref-=
https://cgit.freedesktop.org/libreoffice/core/commit/?id=b22881c8166708d6fd42fbadad47ff880ba19ed4
Comment 29 Heiko Tietze 2018-07-28 14:44:12 UTC
Better we have Text Body as the default style according bug 47295. (If I had the chance to prioritize tickets/topics I'd make this one of the key topics for 6.2).
Comment 30 V Stuart Foote 2018-07-28 16:03:09 UTC
(In reply to Heiko Tietze from comment #29)
> Better we have Text Body as the default style according bug 47295. (If I had
> the chance to prioritize tickets/topics I'd make this one of the key topics
> for 6.2).

That is fine, but it requires we rework the templates. Issue here is a simple fix to restore consistency until the templates could be scrubbed.

There are advantages to not tweaking the Default style (e.g. bug 113517) and moving instead to template controlling the Text Body metrics (bug 94464), but until we can restructure the standard template(s) to use values of Text Body--the behavior as here of using Text Body style on clearing styles, rather than Default style is wrong.
Comment 31 Commit Notification 2018-09-12 13:11:53 UTC
Samuel Mehrbrodt committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=1334ee97787aa7cea399fa7f1633aea84ff8047d

tdf#70759 Clear formatting should set "Standard" text style

It will be available in 6.2.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 32 Samuel Mehrbrodt (allotropia) 2018-09-12 13:26:08 UTC
Implemented the change suggested by Stuart (adding "Standard" to the top of the list).