Bug 166889 - Provide ability to clear all formatting including Paragraph Style back to template default PS
Summary: Provide ability to clear all formatting including Paragraph Style back to tem...
Status: UNCONFIRMED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
25.8.0.0 alpha0+
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: needsUXEval
Depends on:
Blocks: Templates Writer-Styles-Paragraph
  Show dependency treegraph
 
Reported: 2025-06-07 08:13 UTC by peter josvai
Modified: 2025-06-08 17:55 UTC (History)
3 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 2025-06-07 08:13:30 UTC
hi,

We can clear direct formatting. Cool!
We can "reset" character styles by assigning "no character style". Very cool!

But there could be a "third level" of clearing text:
"Clear ALL Formatting." Styles included!

HOW:


    imagine text in a paragraph

    imagine that 
        
        you select it all
        
        copy it

        then paste it "back", overwriting the selected paragraph.


imagine that this "pasting back" happens NOT by "CRTL+V" 
but by "CRT+SHIFT+ALT+V" ... which means: 

paste as non-formatted plain text.

Only paragraphs exist, 
and they would have the document's default paragraph style, body text.


::::::

Why would this be useful?

Because documents get messed up by course of time if you're editing it.
Messed up: I only mean the source code, the "content.xml" in the zip file.
Thank God, Libreoffice keeps the document clean and healthy, whatever happens down beneath the surface.

But the cleanness of the "source text" is very important, 
cause, for example, using Scribus, when you import a Writer document, 
it will be messed up: missing spaces between words, which makes it all non-usable.

I mean, the cleanness of the source text is, I'm sure, a priority.
Giving a tool to Writer users by which they can get a totally clean 
document, without any inherited glitch, would be a great achievement.



* * * * thank you for developing Libreoffice and Writer !! * * * * * *
Comment 1 Mike Kaganski 2025-06-07 08:52:13 UTC
The problem is completely unclear. The description talks about some hypothetical "messing up", without providing steps to reproduce the issue. It could be "from scratch", like "create a new document; do this and that; see the XML, check X and Y; the expectation is Z"; or the steps could start from an existing provided sample.

Either way: this is definitely not a feature that we need. If there is an actual problem, that some actions result in something undesirable, then that problem should be fixed. If there is a need to clear everything, then paragraph styles can be reset exactly the same way as character styles (selecting all, and applying the default style). This is definitely not an operation that we expect users to need often; this is definitely not an intended workflow.

And no, "cleanness of the source text" is not a priority by itself, only after tons of other things. LibreOffice is not a source code editor, it's a WYSIWYG suite, and it is free to create its XMLs using any algorithm it needs, the only strong goal is correctness.

Also: what people often perceive as "uncleanness", could be in fact things actually needed - like inclusion of Asian / complex font info, which is often unexpected to users who don't realize, that their UI simply hides some properties (because that is defined in options), but these properties exist nevertheless.
Comment 2 V Stuart Foote 2025-06-07 11:31:33 UTC
Clear with no PS assigned would be template's 'Default Paragraph Style', not 'Body Text' 

In line with creating a new paragraph and getting the 'Default' standard PS from template, and not 'Body Text' PS [1].

While overwriting/pasting as unformatted text takes the PS assigned at the insertion edit cursor. It does not/should not receive an arbitrary PS from current document.

In other words, assigning an existing PS does not "clear" the PS (i.e. reset back to template defaults) and it still requires a two-step process of pasting unformatted--which picks up previous PS assignment--and then adjusting the PS selection--including back to template default PS.

In that context a single 'Clear Paragraph Style' *to reset PS of selection back to template default PS* might be useful.  The selection would have to apply to full paragraph--not word or sentence bounds--expand from cursor as needed.

=-ref-=
[1] remains an open request of bug 47295
Comment 3 Mike Kaganski 2025-06-07 15:28:17 UTC
(In reply to V Stuart Foote from comment #2)

What does that all mean? Specifically how can I see the problem, *with exact steps* and *with expectations*?
Comment 4 Laurent Balland 2025-06-08 13:07:16 UTC
I do not understand the request, as it works as described in comment 0
1. Ctrl+A to select all your text
2. Ctrl+X to cut
3. Ctrl+M to delete formatting
4. Apply the paragraph style you expect
5. Ctrl+Shift+Alt+V

All the text is pasted with the same paragraph style.

What else is expected?
Comment 5 Mike Kaganski 2025-06-08 13:17:39 UTC
I'm afraid, that comment 2 suddenly introduced a notion of "template" here, which (1) was absent from start; and (2) has absolutely unclear meaning here (what could "template's 'Default Paragraph Style'" mean here; what is "standard PS from template"; same for "template defaults"?). And if my vague guess is correct, than the idea that a document has some kind of meaningful lint to its "template" (OTT?), other than the convenience function that we provide to ease copying styles between different documents - is wrong.
Comment 6 V Stuart Foote 2025-06-08 17:42:34 UTC
And actually already have the making of this.

On the [Formatting | Formatting (Styles)] toolbars the 'Set Paragraph Style' list box includes the 'Clear Formatting' control. For a selection--that will reset Paragraph style to template default AND will clear any Direct Formatting. But it won't clear assigned Character styles.

While on the SB Character styles deck, we now have the 'No Character Style' control that can be applied to CS of a selection (Word, Sentence, Paragrah, multi-paragraph).

So a combination, i.e. ability to remove DF, PS, and CS of a selection (to paragraph bounds I'd imagine) all *with one action* is the functional request.

Provide ability to clear all formatting and styling in a document, clearing any residual format or styling--to a state where user can reliably assign DF or PS and CS.
Comment 7 Mike Kaganski 2025-06-08 17:55:26 UTC
No.

There is a reason to clear direct formatting; to have a dedicated tool for it. A text with direct formatting is problematic from maintenance point of view; it needs "normalization". And the direct formatting comes from all the directions, like external file formats and clipboard.

But styles - *all* styles - are different. Their use does not happen "accidentally". We do *not* see it a recurring workflow, when a user *has to* clear styles, just to make data "clean". It may happen *sometimes* - but it is not a norm to the extent, that we need to even consider making a dedicated function like "combined clear manual formatting + remove character styles".

I completely fail to see a real need to introduce a function, that (1) is needed by two persons in the universe; (2) is readily available by two easy-to-find tools; and (3) goes so much against the philosophy of the style usage.