Bug 90507 - Tools - AutoCorrect - Apply converts non-empty "Default Paragraph Style" paragraphs to "Text Body" PS --even when no [M] options are selected
Summary: Tools - AutoCorrect - Apply converts non-empty "Default Paragraph Style" para...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: Other All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: needsDevAdvice, needsUXEval
Depends on:
Blocks: AutoCorrect-Complete
  Show dependency treegraph
 
Reported: 2015-04-07 22:19 UTC by jlbraga
Modified: 2021-01-30 15:33 UTC (History)
5 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 jlbraga 2015-04-07 22:19:37 UTC
Hi. When I apply the the autocorrect to a text in order to correct it all at once, it happens that all the text/paragraph/linespace formatting is lost, getting back to default.
As an example, I have a text that is in Calibri Light size 10, with space between lines and paragraphs as normal and equal for both, and when I apply autocorrect to the text, it sets the text to Times New Roman size 12, with extra space between paragraphs.
The autocorrect shouldn't affect the formatting options...
Comment 1 A (Andy) 2015-04-08 19:35:50 UTC
Can you reproduce it repeatable with a new WRITER document?  If yes, can you please give more information about the different single steps to reproduce it.  I couldn't reproduce it with LO 4.4.1.2, Win 8.1.
Comment 2 jlbraga 2015-04-08 19:56:20 UTC
I have LO 4.4.1.2 Portuguese Version, and Windows 7 Home Edition. This happens in all new "writer" documents I open.

First write a lot of text in Calibri Light size 10, then select it all, right-click it and select paragraph. Set all the space between the paragraphs and lines to the minimum possible (0, simple, etc.). Then select Format in the upper bar, Autocorrection, then Apply. The formatting is then lost.

Even worse: I discovered that if a paragraph starts with a speech dash (alt+0151), the autocorrection transforms it into a bullet black circle and the paragraph becomes as it was on a list.

Also, I noticed that if you change the text formatting in the list on the left of the font list, the formatting also changes. The font, for instance, becomes Liberation Serif...


(In reply to A (Andy) from comment #1)
> Can you reproduce it repeatable with a new WRITER document?  If yes, can you
> please give more information about the different single steps to reproduce
> it.  I couldn't reproduce it with LO 4.4.1.2, Win 8.1.
Comment 3 A (Andy) 2015-04-08 20:16:51 UTC
Ah, now I understand what you mean, thank you very much.

Reproducible with LO 4.4.1.2, Win 8.1.  
If you select FORMAT -> AUTOCORRECT -> APPLY the font is automatically changed to the Text Body specs (go to the Sidebar -> STYLES AND FORMATTING -> PARAGRAPH STYLES -> Text Body).  
I agree there should be an option that the font is not changed, but I could not find it.  In this case it could be from my point of view some kind of an enhancement request?
Comment 4 Matthew Francis 2015-04-09 12:28:53 UTC
So let's make this into an enhancement request

-> Adjusted Summary
-> Severity: enhancement
Comment 5 V Stuart Foote 2018-03-31 08:27:30 UTC
Probably need to figure out why the [M] modify AutoCorrect options only apply the Default style, bug 59034, as that would need to be fixed before this can be sorted.
Comment 6 sdc.blanco 2021-01-25 12:55:48 UTC
(In reply to V Stuart Foote from comment #5)
> Probably need to figure out why the [M] modify AutoCorrect options only
> apply the Default style, bug 59034, as that would need to be fixed before
> this can be sorted.
This hypothesis does not seem correct.

In 7.2.0.0.alpha0+, unselect all [M] options in Tools - AutoCorrect - AutoCorrect Options, then use Tools - AutoCorrect - Apply in a document with some non-empty paragraphs with "Default Paragraph Style".

All non-empty "Default PS" are converted to "Text Body" PS with this comment (even though no [M] fields are checked). 

This explains the observation in comment 0.  

Have changed bug summary accordingly, but not sure why this bug is classified as an enhancement.  Seems like a bug (imho).
Comment 7 V Stuart Foote 2021-01-25 15:46:48 UTC
(In reply to sdc.blanco from comment #6)
> (In reply to V Stuart Foote from comment #5)
> > Probably need to figure out why the [M] modify AutoCorrect options only
> > apply the Default style, bug 59034, as that would need to be fixed before
> > this can be sorted.
> This hypothesis does not seem correct.
> 
> In 7.2.0.0.alpha0+, unselect all [M] options in Tools - AutoCorrect -
> AutoCorrect Options, then use Tools - AutoCorrect - Apply in a document with
> some non-empty paragraphs with "Default Paragraph Style".
> 
> All non-empty "Default PS" are converted to "Text Body" PS with this comment
> (even though no [M] fields are checked). 
> 
> This explains the observation in comment 0.  
> 
> Have changed bug summary accordingly, but not sure why this bug is
> classified as an enhancement.  Seems like a bug (imho).

Right and the issue of  Tools --> Autocorrect --> Apply only applying to "Default" paragraph style is still involved. Issue of OP would not occur if their PS is something other than Default.  It effectively clears the DF applied to default paragraphs, and casts them to Text Body--to me that is happening within the edit shell.  

Also, either the 'Default' or the 'Text Body' PS may be modified (i.e. not by DF) from template defaults to suite authoring needs--so this is a styles based editing feature--poorly documented and in need of rework.  But it is consistently implemented.

The Autocorrect 'M' modify applicable to 'Default' PS is involved. For example use the markdown we support: bold, italic, strikeout and underline.  Set up a FODT with dummy text in a paragraph of Default, vs dummy text in a paragraph of Quotation. Edit the FODT externally (notepad++, or vi) to bracket a few text spans with the flags.  Then open in Writer and Tools -> Autocorrect -> Apply.  Only the Default PS will be affected.
Comment 8 sdc.blanco 2021-01-25 16:53:25 UTC
(In reply to V Stuart Foote from comment #7)
> so this is a styles based editing feature--poorly documented and in need of
> rework.  But it is consistently implemented.
iiuc, there is no bug here?  

in which case, would a relevant "enhancement" request --  formulated explicitly in positive terms -- be something like? 

"Do not convert non-empty 'Default Paragraph Style' to 'Text Body' when using Tools - AutoCorrect - Apply."

or

"Add a [M] option to control whether "Default PS" are converted to 'Text Body'" 
  (for example, under "Replace Custom Styles"
   it might be        "Convert "Default Paragraph Style" to "Text Body"
Comment 9 V Stuart Foote 2021-01-25 20:50:05 UTC
The FN_AUTOFORMAT_APPLY is ancient StarOffice handling by SvxAutoCorrCfg, not surprised that its linkage in AutoCorrect GUI for existing (the Modify 'M' checkbox) only applies between 'Default' and 'Text Body' PS.

So, it requires user to assign selection to 'Default' PS for the AutoCorrection to apply to existing text--and that the resulting paragraph receives the 'Text Body' PS.  Enhancement would be to provide user choice of target PS conversion, or perhaps to not force the conversion at all--an option on the AutoCorrect dialog.

It is actually pretty handy "feature", but it needs documentation of its current state, and absent refactoring probably adjustments in the UI (e.g. some of the 'M' checkboxes should be listed as applicable only to 'Default' paragraph style ).
Comment 10 sdc.blanco 2021-01-25 23:18:10 UTC
(In reply to V Stuart Foote from comment #9)
> It is actually pretty handy "feature", but it needs documentation of its
> current state
Thanks for interesting archeology.  Have been trying to improve the documentation, but will appreciate any help I can get.

From one PoV, whether intended or not, it could look like AutoCorrect was designed to make it easier (or to encourage) shifting over to Styles-based document production.

This bug 90507 notes that Tools - AutoCorrect - Apply automatically changes all Default PS to Text Body (requested or not).
 
[This has been documented since at least 2015, but now I have tried to clarify the "note" about this].  

(Bug or not, this current behavior is consistent with promoting a styles-based approach, and makes it "easy" to get rid of unstyled (default) paragraphs from a document.)

Bug 95433 notes (and objects to) that using choosing "Apply Styles" in [T] also changes Default PS to Text Body after Enter is used.  (but is that a bug?, especially when user has chosen "Apply Styles"?)

In both cases, these "bugs" could be seen as features to help insure the avoidance of unstyled paragraphs appearing in a document.

But this potentially helpful behavior "collides" with the issue in bug 59034, namely that (many) [M] options only work with Default PS.

In short, at present, this (speculative) "helpful" behavior described in bug 90507 and bug 95433 undercuts the possibility to make post-facto auto-correcting clean-up in a document (unless one is willing to remove all non-default PS).
Comment 11 V Stuart Foote 2021-01-25 23:51:19 UTC
(In reply to sdc.blanco from comment #10)
> ...
> But this potentially helpful behavior "collides" with the issue in bug
> 59034, namely that (many) [M] options only work with Default PS.
> ...

Yes I would agree, and would also note the 'Replace Custom Styles' has some interesting behavior as well. 

Not clear if those are relative to the Standard Template, or to the Template used to create the document--but its action when applied is to remove other PS and revert to something present in the template.

So, makes me wonder exactly what is considered a "custom" style as related to the AutoFormat in (editeng/acorrcfg.hxx & acorrcfg.cxx)?  

I've gotten lost several times now trying to trace it out in Opengrok.
Comment 12 sdc.blanco 2021-01-26 14:13:33 UTC
(In reply to V Stuart Foote from comment #11)
> 'Replace Custom Styles' has some  interesting behavior
According to help, https://help.libreoffice.org/7.2/en-US/text/shared/01/06040100.html:

     Replaces the custom paragraph styles in the current document with the
     "Default", the "Text Body", or the "Text Body Indent" paragraph style. 

From experimenting:

1.  Have not been able to get "Default" only "Text Body" and "Text Body Indent"
    (wondering if I should "remove" "Default" from "help")
2.  Have also gotten "First Line Indent"  (for a custom style that inherits 
    from Quotations)
3.  Adding a manual Tab at beginning of Custom Style gives "Text Body Indent" 
    (or "First Line Indent") instead of "Text Body"
4.  Custom Styles with Borders are NOT modified (which I assume should be
    considered a bug)

Perhaps I need to start a new ticket for that option?
Comment 13 Heiko Tietze 2021-01-26 14:18:21 UTC Comment hidden (obsolete)
Comment 14 V Stuart Foote 2021-01-26 14:49:23 UTC Comment hidden (obsolete)
Comment 15 V Stuart Foote 2021-01-26 14:55:36 UTC Comment hidden (obsolete)
Comment 16 Heiko Tietze 2021-01-27 11:13:41 UTC
Tools > AutoCorrect > Apply does in fact change the PS. My "Test" formatted text becomes Text Body and the previously auto formatted text 'while typing' (SHe -> She and *nervously*) are now direct formatted (bold was DF before). With 7.2 I don't this conversion into DF anymore and "She" is black.

What input is needed from UX?
Comment 17 V Stuart Foote 2021-01-27 15:04:45 UTC
(In reply to Heiko Tietze from comment #16)
> 
> What input is needed from UX?

Well we should improve the documentation, obviously. 

But AC controls modifying existing text--styled or DF--are very powerful and in a sense quite dangerous as applied to 'M' modify existing content.  

Need to verify the handling of 'custom' styles, what constitutes them and how are they made non-custom so can be protected from the 'Replace Custom Styles' action.

Also, given the evolution of styles in the LibreOffice UI, how could the AC handling in editshell be applied to a broader mix of styles.  Currently it only converts a limited set of PS. Any consistent usage now requires user select and apply a 'Default' PS first, and only results in a 'Text Body' PS.  While results of the 'Replace Custom Styles' action seems error prone to document layout at best.
Comment 18 sdc.blanco 2021-01-27 17:54:04 UTC
(In reply to Heiko Tietze from comment #16)
> What input is needed from UX?
In this concrete instance, AutoCorrect is categorically modifying Default PS to Text Body, with no way to ‟disable” this action  (see comment 8)

I understand the motivation for Stuart’s query to be:

- AC was designed a long time ago.  
- Most of actions in [M] only work with Default PS, limiting its utility.
- And this current bug 90507 makes it even worse, because one Tools > AutoCorrect > Apply removes all Default PS.
- But AC may have interesting potential if its capability was expanded beyond Default PS.
- Plus its current operation with "Replace Custom Styles" should be reviewed in light of LO orientation to styles.

But maybe that discussion should be a new ticket, so that the bug report here does not get lost -- which should be addressed no matter what else is decided for AC.
Comment 19 Heiko Tietze 2021-01-28 14:02:05 UTC
My question is rather why AC changes the style at all (except for the markup formatting things). My take: No [M] at all.
Comment 20 sdc.blanco 2021-01-30 15:23:29 UTC
(In reply to V Stuart Foote from comment #17)
> While results of the 'Replace Custom Styles' action seems error prone to
> document layout at best.
Opened Bug 140024 in relation to "Replace Custom Styles"
Comment 21 sdc.blanco 2021-01-30 15:33:36 UTC
(In reply to Heiko Tietze from comment #19)
> My question is rather why AC changes the style at all
Because you (probably) had "Replace Custom Styles" activated in your AutoCorrect options.  If the checkbox was unchecked then your Test PS (probably) would not have changed.
 
> My take: No [M] at all.
Sounds a little drastic. There are many useful [M] options (e.g., combine single line paragraphs), which can be applied selectively.