Bug 140024 - "Replace custom styles" option in AutoCorrect should be off by default
Summary: "Replace custom styles" option in AutoCorrect should be off by default
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.2.0.0.alpha0+
Hardware: All All
: medium normal
Assignee: Baole Fang
URL:
Whiteboard:
Keywords: difficultyBeginner, easyHack, skillDesign, topicDesign
Depends on:
Blocks: AutoCorrect-Complete
  Show dependency treegraph
 
Reported: 2021-01-30 15:21 UTC by sdc.blanco
Modified: 2023-07-30 11:59 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 sdc.blanco 2021-01-30 15:21:26 UTC
1. Apply some Custom paragraph styles to text in a document.
2. Select "Replace Custom Styles" in Tools > AutoCorrect > AutoCorrect Options - Options tab.
3. Run "Tools > AutoCorrect > Apply

In general, Custom Styles are replaced by this command with "Text Body" PS

Exceptions: 

1. Have been able to get custom styles converted to:
 - Text Body Indent  (when "Before text indent" attribute is used)
 - Hanging Indent    (when "First line indent" and "Before text indent" used)
 - First Line Indent (when "First line indent" is used)
     
2.  Paragraph Style with four-sided border was NOT converted.

Copied from bug 90507, comment 11

> '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)?  
Copied from bug 90507 comment 17
 
> 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.
> 
> Results of the 'Replace Custom Styles' action seems error prone to
> document layout at best.

> Well we should improve the documentation, obviously. 
Have made some modifications in relation to observed behavior. Can documentation be improved further? 

Does command work as intended?
Comment 1 V Stuart Foote 2021-01-30 15:36:24 UTC
+1
Comment 2 QA Administrators 2023-01-31 03:22:36 UTC Comment hidden (obsolete)
Comment 3 sdc.blanco 2023-02-06 22:44:26 UTC
(In reply to V Stuart Foote from comment #1)
> +1
bug 90507 comment 22 acknowledges the issues here, but does not provide any additional information or clarification about expected behavior, in light of the points copied into OP.

Meanwhile, from some (limited) experiments with 7.6.0.0.alpha0+,  it seems that "empty" paragraphs with Custom Styles are not converted.  Now filed as bug 153424.

It is not clear whether documentation can/should be improved further or whether UXEval is needed to decide on "expected behavior".
Comment 4 Dieter 2023-02-22 07:14:02 UTC
(In reply to sdc.blanco from comment #0)
> 2.  Paragraph Style with four-sided border was NOT converted.

Can't confirm with
Version: 7.5.0.3 (X86_64) / LibreOffice Community
Build ID: c21113d003cd3efa8c53188764377a8272d9d6de
CPU threads: 4; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: de-DE
Calc: CL threaded

I've created a new PS, based on Numbering5 and only added four-sided border.
Comment 5 sdc.blanco 2023-05-05 10:56:52 UTC
I think the "Replace Custom Styles" option should be removed from AutoCorrect.

1. The Find and Replace dialog gives a flexible, extensive, transparent way to change PS.
2. There are already many options in AutoCorrect, and the current behavior of Replace Custom Styles is limited (and of questionable value), so it would be good to reduce the number of options.
3. AutoCorrect should not be used to change PS.  The "correct" in AutoCorrect should be limited to "replacements" (e.g., spelling, spaces, dashes, formatting).
Comment 6 sdc.blanco 2023-06-25 22:36:39 UTC
Now that bug 90507 is fixed and Tools - AutoCorrect - Apply no longer converts "Default Paragraph Style" to "Body Text", it seems time to also remove "Replace Custom Styles" from the [M] options.  Will ask UXEval -- also because maybe it is an EasyHack.
Comment 7 Eyal Rozenberg 2023-06-27 18:35:40 UTC
Looking at that checkbox, I really don't see how a user is supposed to understand what it does. "Custom Styles" - is that Direct Formatting, or styles the users has defined and named? If it's the latter - I don't see why these should be replaced; if it's the former - why call them this?

Also - what kinds of DF would be replaced? And DF of what - characters? paragraphs? lists? And what will the target of replacement be?

I even went and read the help, where it says:

> Replaces custom paragraph styles applied in the current 
> document to "Text Body", "Text Body Indent", 
> "First Line Indent" or "Hanging Indent" paragraph style. 

I don't understand why these styles, whether they would be modified by the autocorrect process, and how it would choose among these.

Can someone explain what is the original rationale for this, so that we can form an opinion of whether to keep or remove?
Comment 8 Baole Fang 2023-07-06 00:33:13 UTC
Have we decided to keep or remove it?
Comment 9 Heiko Tietze 2023-07-06 12:57:44 UTC
We discussed the topic in the design meeting.

The label "Replace Custom Styles" is somewhat unclear, the removal wouldn't be realized by many users anyway and the recently introduced Spotlight feature shows styles clearly allowing to spot custom styles and to convert it manually.

However, if one receives a document from someone else eg. created with some other application, s/he might want to replace  all "alien" styles with something reasonable. So having the option is beneficial.

We also discussed the label, and it's actually clear. Any style listed under Custom Styles will be replaced by Body Text and co (unclear when the latter are used). Renaming is not necessary, perhaps some improvements at the help makes sense.

But since the feature is confusing many we suggest to switch it off by default. Code pointer: https://opengrok.libreoffice.org/xref/core/officecfg/registry/schema/org/openoffice/Office/Writer.xcs?r=13393246#4233 (ReplaceUserStyle => value = false)
Comment 10 Eyal Rozenberg 2023-07-07 10:42:45 UTC
(In reply to Heiko Tietze from comment #9)
> However, if one receives a document from someone else eg. created with some
> other application, s/he might want to replace  all "alien" styles with
> something reasonable. So having the option is beneficial.

I think that particular use case needs its own attention. If I wanted replacements of styles in an imported document, I would want to:

1. Do that explicitly, either during import or with a command for just this replacement.
2. Be told clearly what the replacement logic is going to be.
3. Be able to control what gets replaced, and perhaps aspects of how the replacement happens.

... and without these, I would probably not want LO to do such replacements for me. I certainly would not want them to happen as part of AutoCorrect.

> The label "Replace Custom Styles" is somewhat unclear ... We also discussed the label, and it's actually clear.

So, it's somewhat unclear, but actually clear? 

> Any style listed under Custom Styles will be replaced...

The user will not be able to guess what "Custom Styles" are. Yes, if you look at the style sidebar and the filtering drop-down box at the bottom, one of the items is "Custom Styles", but that's one out of 12 or 13 items; and those items also include "Special Styles" for example. Does the user know when a style is "custom"? Or when it is "special" as opposed to "custom"? Without taking time to leave the AutoCorrect dialog and play with the styles bar - which they may not even be aware they need to?

No, this is not clear.

> ... replaced by Body Text and co(unclear when the latter are used).

So, unclear again what kind of replacement is going to be made.

> Renaming is not necessary,

It most certainly is.

> perhaps some improvements at the help makes sense.

First one should make the UI clear, then (re-)document it.


> But since the feature is confusing many we suggest to switch it off by
> default.

Sounds like the reasonable choice.
Comment 11 Baole Fang 2023-07-07 19:15:12 UTC
start working on this
Comment 12 Baole Fang 2023-07-29 01:55:49 UTC
the option is off by default after this fix for tdf#156165:

https://gerrit.libreoffice.org/c/core/+/154144