Bug 118969 - CLEAR ALL FORMATTING -- in addition to clear direct formatting
Summary: CLEAR ALL FORMATTING -- in addition to clear direct formatting
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
(earliest affected) release
Hardware: All Linux (All)
: medium enhancement
Assignee: Not Assigned
Keywords: needsUXEval
Depends on:
Blocks: Clear-Formatting Writer-Styles
  Show dependency treegraph
Reported: 2018-07-27 13:23 UTC by peter josvai
Modified: 2018-07-31 03:55 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:

a sample text.. one line in 1+2 versions and the HTML code (1.82 KB, text/plain)
2018-07-27 13:47 UTC, peter josvai

Note You need to log in before you can comment on or make changes to this bug.
Description peter josvai 2018-07-27 13:23:09 UTC

lately, I find that a lot of times clear formatting of selection by "clear direct formatting" won't work...

typically, it's when there is an "em" / "italic" involved...

I know this is not really a BUG ... this is logical result of using the "span" tag.. and editing word sequences, sometimes word by word... for decorative purposes :) 

BUT... this "HTML jamming"* would NO LONGER BE such a big deal if there was a function to clear ALL formatting for an entire paragraph... :) 
* (speaking of copy-pasting the text into an HTML5 editor like tinymce)

If there was such a function, things would become so smooth :) 
I mean, you wouldn't have to worry about the future HTML clarity of your text...
that is, what's beneath the surface...

once you notice that the CTRL+m does not work as expected, you could clear the paragraph right away... and go on afresh :) 

in the menu, it could right under "clear direct formatting", 
like "clear ALL formatting (for the paragraph)"... 

since UNDO is very popular, if someone doesn't like the result, can change it right back on... but it would be great help for all who know they need HTML clarity... :) 

- - - - - additional notes:

I just made a test with a text...
I copied the paragraph... pasted it into a text-editor.. (Geany)
and copy-pasted back...

and I copy-pasted it also to a brand new document...

the two would not be the same!!!! I mean, when copy-pasted into a WYSIWYG html editor... (Tinymce)....

the text now copy pasted FROM the long text... (5 pages, not so long) would have the following extra tags, both at the beginning and the end:

<p><em><span style="font-variant: normal;"> <span style="font-style: normal;"><span style="font-weight: normal;">

plus, the closing pairs of these at the end of the paragraph.. (of 190 words)

I hope this makes sense :) 

Steps to Reproduce:
1. edit a text extensively... apply italic to some words, one by one
2. and then try to remove italic by using CTRL+m

Actual Results:
sometimes it works, it always does with a new document... 
BUT sometimes (after complexity has grown, by course of time, by using copy pastes, especially copy-pastes of Italic formatted sequences from a Wikipedia text!)
the CRTL+m won't work... it would make the selection ITALIC... 

Expected Results:
it should clear formatting... all except for formatting by styles...

BUT... it would be great "enough", and strategically even more reliable, if a "clear all formatting" could be applied... for an entire paragraph... (how else?)

Reproducible: Sometimes

User Profile Reset: No

Additional Info:
[Information automatically included from LibreOffice]
Locale: en-US
Module: TextDocument
[Information guessed from browser]
OS: Linux (All)
OS is 64bit: yes
Comment 1 peter josvai 2018-07-27 13:47:52 UTC
Created attachment 143803 [details]
a sample text.. one line in 1+2  versions and the HTML code

this is a short cutout from a text...

line #1: sample from a text
line #2: the same copy+ paste special - unformatted
line #3: the same copy+ paste unformatted

as you can see, the HTML is xtrmely jammed up, and even in the "unformatted pasted" versions there is an EM tag..

BUT all this would not matter so much, if it could be cleaned up by "CLEAR ALL FORMATTING" :) 

unfortunately, an ODT file couldn't be uploaded :) 
but you can download it from here:

Comment 2 V Stuart Foote 2018-07-28 13:23:14 UTC
You _can_ do this simply now. Select the paragraph with the errant formatting (with mix of styles and direct formatting), first clear the Direct Formatting with Format -> Clear Direct Formattingn (<ctl>+M). Then with selection still in place, from the Sidebar's Style Deck (F11), pick the Character Styles (the A icon) and apply (double click) Default Style. Do the same from the Paragraph Styles (the Pilcrow) apply Default Style (double click).

All text in the selected paragraph will be formatted with only the attributes of the Default paragraph style.

An .uno command to do this exactly might be of use, but it is pretty simple to accomplish now without it.

Comment 3 V Stuart Foote 2018-07-28 13:40:21 UTC
Also, strongly suggest when needing to look at the formatting applied to ODF (our only "natively" supported file format) that you save to so called "flat ODF" as that will let you review both the document textual content and the styling/formatting being applied. Save-as a flat ODF generates a complete single XML structured document, much easier than jumping around inside the ODF zip archive for configuration and content.
Comment 4 Heiko Tietze 2018-07-29 10:36:46 UTC
Don't see much need for UX. Peter, do you accept Stuart's answer?
Comment 5 peter josvai 2018-07-29 22:34:41 UTC
(In reply to Heiko Tietze from comment #4)
> Don't see much need for UX. Peter, do you accept Stuart's answer?

Heiko, I do like Stuart's approach... and I sure "accept" his answer.. 
but I also need to elaborate what I actually think.. cause this is all new to me... which means that my practice is not relevant enough.. I'm still only trying out the styles formatting toolbar...

- - - - - - - -


let me stress that for most people the transition from the DF to the Styles method is a silent change...

and that in reality, someone only wants the italic to disappear or to reappear again... and at this point it can all get confused...

cause you clear all DF... but some... "DF" remains :) :)
I'm saying this cause "bold and italic" is "DF"... (as at least 15% of all users know it) but after clearing DF, some "bold" and "italic" stays (strong and emphasis).. and it is confusing.. and you won't trust the HTML clarity of your text anymore...

and when confusion appears, all you want is a clean text...
that could be copied to an html editor like this "<p>some text</p>...

okay, one argument: in Ardour, you have a panic button :) 
I think I was trying to outline something like that... about a mixed-ways formatted text.. :)

thanks to both of you !   Peter
Comment 6 Heiko Tietze 2018-07-30 10:31:38 UTC
Phrasing the use case differently might be helpful: "I'm looking for easy means to reset styles to default". Meaning the function reverts the paragraph style to Text Body, or Default today, and clears all character styles. Is that correct?
Comment 7 Heiko Tietze 2018-07-30 10:32:38 UTC
(In reply to Heiko Tietze from comment #6)
> ... means to reset styles to default...

Would be bug 118979
Comment 8 peter josvai 2018-07-31 03:55:32 UTC
(In reply to Heiko Tietze from comment #6)
> Phrasing the use case differently might be helpful: "I'm looking for easy
> means to reset styles to default". Meaning the function reverts the
> paragraph style to Text Body, or Default today, and clears all character
> styles. Is that correct?

YES, that's what  meant...

and after re-thinking it all, I would say that the functionality I was trying to outline and ask for is exactly: a one button or one click functionality that does "copy AND paste_back_as_unformatted".. as a new paragraph

- - -
and I meant it sort of like a "panic button"... or a fail-safe solution :)
like "resetting it to clean text"... 

but I also understand that such a functionality cannot just be dropped into an application that has decades of usage-culture behind and underlying it..

it would, in any case, take lots of user input and discussion..

// sorry for the length...