Bug 156165 - Writer resets previous paragraph's style to body text if AutoCorrect is on
Summary: Writer resets previous paragraph's style to body text if AutoCorrect is on
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.6.0.0 alpha1+
Hardware: All All
: high normal
Assignee: Baole Fang
URL:
Whiteboard: target:24.2.0 target:7.6.0.3
Keywords: bisected, regression
: 156221 156275 156309 156558 156597 (view as bug list)
Depends on:
Blocks: AutoCorrect-Complete Writer-Styles-Paragraph
  Show dependency treegraph
 
Reported: 2023-07-05 07:34 UTC by Elmar
Modified: 2023-08-20 02:03 UTC (History)
11 users (show)

See Also:
Crash report or crash signature:


Attachments
example of style unexpected auto change (28.52 KB, application/vnd.oasis.opendocument.text)
2023-07-05 07:40 UTC, Elmar
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Elmar 2023-07-05 07:34:32 UTC
Description:
I have a document which has styles called selah and endnote xtra. If i use these a second time, the paragraph reverts to (i think) parent style, yet the new paragraph is the correct style

Steps to Reproduce:
1.type text
2.change style to selah
3.selah selected, type text 
4.enter for new paragraph

Actual Results:
the paragraph just typed reverts to parent text(in example this is Body Text).
the new par however, is correctly Selah, until enter, then same happens
The same occurs for endnote style which has a continuation style called endnote xtra

Expected Results:
styles should not automatically change to parent style

(can someone explain why LO version number has leapt to 24.2? from 7.6)


Reproducible: Always


User Profile Reset: No

Additional Info:
[Information automatically included from LibreOffice]
Locale: en-GB
Module: TextDocument
[Information guessed from browser]
OS: Linux (All)
OS is 64bit: yes

Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: e4e5fb4b2935e395c7e4b3a794d544a6f44709ce
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-GB (en_GB.UTF-8); UI: en-GB
Calc: threaded
Comment 1 Elmar 2023-07-05 07:40:51 UTC
Created attachment 188214 [details]
example of style unexpected auto change
Comment 2 Mike Kaganski 2023-07-05 09:30:39 UTC
(In reply to Elmar from comment #0)
> (can someone explain why LO version number has leapt to 24.2? from 7.6)

https://lists.freedesktop.org/archives/libreoffice/2023-May/090403.html
https://lists.freedesktop.org/archives/libreoffice/2023-June/090430.html
Comment 3 Mike Kaganski 2023-07-05 09:33:16 UTC
Repro.
Needs bisection.
Comment 4 Mike Kaganski 2023-07-05 10:12:25 UTC
Regression after commit 083975f9666e3dc6fd665dc0418e6c3130628359.
Comment 5 Baole Fang 2023-07-05 23:52:32 UTC
(In reply to Mike Kaganski from comment #4)
> Regression after commit 083975f9666e3dc6fd665dc0418e6c3130628359.

I don't think the bug is caused by this patch. The bug also occurs in

Version: 7.5.4.2 (X86_64) / LibreOffice Community
Build ID: 50(Build:2)
CPU threads: 12; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Ubuntu package version: 4:7.5.4~rc2-0ubuntu0.22.04.1~lo1
Calc: threaded

It should be related to Replace Custom Styles in AutoCorrect.
Comment 6 Mike Kaganski 2023-07-06 04:21:39 UTC
(In reply to Baole Fang from comment #5)
> I don't think the bug is caused by this patch. The bug also occurs in
> 
> Version: 7.5.4.2 (X86_64) / LibreOffice Community
> Build ID: 50(Build:2)
> CPU threads: 12; OS: Linux 5.15; UI render: default; VCL: gtk3
> Locale: en-US (en_US.UTF-8); UI: en-US
> Ubuntu package version: 4:7.5.4~rc2-0ubuntu0.22.04.1~lo1
> Calc: threaded

No repro in Version: 7.5.5.1 (X86_64) / LibreOffice Community
Build ID: 2c5e46c1980ec5241359fd65d751dc518205e7af
CPU threads: 12; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: ru-RU (ru_RU); UI: en-US
Calc: CL threaded

What specifically did you check? For me, the style reset happens in 7.6 and master, when you put cursor to the end of the blue-colored paragraph - the one with text "par3 third selah"; and press Enter.
Comment 7 Elmar 2023-07-06 04:49:06 UTC
Autocorrect:
disabled "replace custom styles": still happens
disabled autocorrect while typing: does not reset style

re-enabled autocorrect while typing: resets style
Comment 8 Mike Kaganski 2023-07-06 04:53:58 UTC
(In reply to Baole Fang from comment #5)
> I don't think the bug is caused by this patch. The bug also occurs in

By the way: did you see that I added "bisected" flag? I wrote "Regression after commit ...", after *bibisection*, so - unless you can prove it's a false positive, I don't think it's doubtable ;)
Comment 9 Baole Fang 2023-07-06 16:03:03 UTC
Indeed, it is caused by 083975f9666e3dc6fd665dc0418e6c3130628359.
Comment 10 Stéphane Guillou (stragu) 2023-07-11 09:18:12 UTC
*** Bug 156221 has been marked as a duplicate of this bug. ***
Comment 11 Elmar 2023-07-12 05:32:12 UTC
Not sure if this helps:
I notice if one hits enter on an empty endnote continuation paragraph, it does not revert the style.
Comment 12 Stéphane Guillou (stragu) 2023-07-13 20:23:20 UTC
*** Bug 156275 has been marked as a duplicate of this bug. ***
Comment 13 Paul 2023-07-15 22:48:53 UTC
(In reply to Elmar from comment #7)

> disabled autocorrect while typing: does not reset style
> 
> re-enabled autocorrect while typing: resets style

Same here.

LO 7.6.0.1, Linux
Comment 14 Paul 2023-07-17 16:59:30 UTC
I'm not a regular here, but IMO the Importance of this bug needs to be elevated to at least Major, and preferably Critical. 7.6.0.1 Writer is unusable, I am going to revert.
Comment 15 Stéphane Guillou (stragu) 2023-07-17 21:23:43 UTC
*** Bug 156309 has been marked as a duplicate of this bug. ***
Comment 16 Baole Fang 2023-07-19 15:11:48 UTC
(In reply to Paul from comment #14)
> I'm not a regular here, but IMO the Importance of this bug needs to be
> elevated to at least Major, and preferably Critical. 7.6.0.1 Writer is
> unusable, I am going to revert.

The fix is already there last week, but still under review due to lack of unit test. I was trapped at the airport, so I won't be able to develop its unit tests until later this week.

https://gerrit.libreoffice.org/c/core/+/154144
Comment 17 Mike Kaganski 2023-07-19 15:59:28 UTC
(In reply to Baole Fang from comment #16)

It's great that you are dedicated to fixing it. It's important, but please don't get stressed because of unreasonable expectations of users, who use a pre-release versions, and push you that way. It is expected that bugs will be found.
Comment 18 Paul 2023-07-19 17:36:28 UTC
Thanks, Baole. I appreciate the update and the work.
Comment 19 Commit Notification 2023-07-29 01:54:28 UTC
Baole Fang committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/e26aeb882dd236adf19679d5df9b7ba5da1ed226

tdf#156165: Fix replace custom styles while typing

It will be available in 24.2.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 20 Commit Notification 2023-08-01 22:37:49 UTC
Baole Fang committed a patch related to this issue.
It has been pushed to "libreoffice-7-6":

https://git.libreoffice.org/core/commit/e50ec4d8ddca5dfe6a4f329298c0bae4edc5e41c

tdf#156165: Fix replace custom styles while typing

It will be available in 7.6.1.

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

Affected users are encouraged to test the fix and report feedback.
Comment 21 Elmar 2023-08-02 03:14:03 UTC
confirmed fixed
Comment 22 BogdanB 2023-08-02 08:05:51 UTC
Can this fix be backported to 7.6.0? It is very annoing.
Comment 23 Stéphane Guillou (stragu) 2023-08-02 08:15:04 UTC
Repro in:

Version: 7.6.0.1 (X86_64) / LibreOffice Community
Build ID: 776eaf34564cbf3f034a0ba1fd1d5c32ff9ccf1c
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

Fix verified in:

Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: d16d86685afdf3d321cc282a39a65f38381b6eaa
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: fr-FR
Calc: threaded

Will see if a cherrypick to 7.6.0 is possible.
Comment 24 Commit Notification 2023-08-03 11:40:17 UTC
Baole Fang committed a patch related to this issue.
It has been pushed to "libreoffice-7-6-0":

https://git.libreoffice.org/core/commit/4ea3099dba3d0f7d1f09b31f204223449bfbbc51

tdf#156165: Fix replace custom styles while typing

It will be available in 7.6.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 25 Stéphane Guillou (stragu) 2023-08-03 14:08:10 UTC
*** Bug 156597 has been marked as a duplicate of this bug. ***
Comment 26 BogdanB 2023-08-03 20:37:23 UTC
*** Bug 156558 has been marked as a duplicate of this bug. ***