Bug 135907 - Undo of applying character style not working properly
Summary: Undo of applying character style not working properly
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Undo-Redo Writer-Styles-Character
  Show dependency treegraph
 
Reported: 2020-08-19 08:36 UTC by Telesto
Modified: 2024-06-21 19:09 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Example file (8.61 KB, application/vnd.oasis.opendocument.text)
2020-08-19 08:37 UTC, Telesto
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Telesto 2020-08-19 08:36:54 UTC
Description:
Undo of applying character style not working properly

Steps to Reproduce:
1. Open the attached file
2. CTRL+A
3. Styles -> Emphasis 
4. Select last word ('alley.')
5. Styles -> Default character
6. CTRL+Z
7. CTRL+Z


Actual Results:
Emphasis

Expected Results:
Default character style


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 7.1.0.0.alpha0+ (x64)
Build ID: <buildversion>
CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: Skia/Raster; VCL: win
Locale: nl-NL (nl_NL); UI: en-US
Calc: CL
Comment 1 Telesto 2020-08-19 08:37:09 UTC
Created attachment 164446 [details]
Example file
Comment 2 Telesto 2020-08-19 08:41:00 UTC
Also in
LibreOffice 3.3.0 
OOO330m19 (Build:6)
tag libreoffice-3.3.0.4
Comment 3 Telesto 2020-08-19 08:42:11 UTC
@Heiko
This kind of bugs ruins the use of styles, if it's up to me
Comment 4 Heiko Tietze 2020-09-22 09:32:28 UTC Comment hidden (obsolete)
Comment 5 Buovjaga 2020-09-26 06:29:04 UTC
(In reply to Heiko Tietze from comment #4)
> Applying the Default CS is not undoing the operation. Undo is a special
> function. And you step through all modifications, meaning the first brings
> you back to Emphasis and the second to Default again. Don't see a bug.

I'm not sure I understand - we seem to get different results.

First undo brings me back to Emphasis.
Second undo keeps me in Emphasis, but restores the Strong Emphasis of "around".

Seems illogical to me.

Arch Linux 64-bit
Version: 7.1.0.0.alpha0+
Build ID: d98ac4d2c584313c1e51630c6fbab8f8a092012c
CPU threads: 8; OS: Linux 5.8; UI render: default; VCL: kf5
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Calc: threaded
Built on 24 September 2020
Comment 6 Heiko Tietze 2020-09-28 08:52:07 UTC
(In reply to Buovjaga from comment #5)
> (In reply to Heiko Tietze from comment #4)
> I'm not sure I understand - we seem to get different results.

Me neither ;-). So again:

1. Open the attached file
all text has CS Emphasis (italic), around has CS Strong Emphasis (bold), alley is normal
2. CTRL+A
3. Styles -> Emphasis 
makes all italic (overrides all CS)
4. Select last word ('alley.')
5. Styles -> Default character
last word is normal now
6. CTRL+Z
last word is italic
7. CTRL+Z
all text is selected and italic, around is bold, alley is normal

Where is the bug?
Comment 7 Telesto 2020-09-28 09:13:21 UTC
(In reply to Heiko Tietze from comment #6)
> (In reply to Buovjaga from comment #5)
> > (In reply to Heiko Tietze from comment #4)
> > I'm not sure I understand - we seem to get different results.
> 
> Me neither ;-). So again:
> 
> 1. Open the attached file
> all text has CS Emphasis (italic), around has CS Strong Emphasis (bold),
> alley is normal

-> Around has 'strong' Emphasis. There rest is default PS without CS (look at the style inspector).. And maybe re-download the example file

> 2. CTRL+A
> 3. Styles -> Emphasis 
> makes all italic (overrides all CS)
> 4. Select last word ('alley.')
> 5. Styles -> Default character
> last word is normal now
> 6. CTRL+Z
> last word is italic
> 7. CTRL+Z
> all text is selected and italic, around is bold, alley is normal

True -> That's the bug :-)

@Offtopic
BTW -> Me still confused.. CS Strong Emphasis is 'thrown away' by CS Emphasis? Yes, I'm still having trouble getting the concept. If it would happen with DF bold I can understand.. but also for CS?
Comment 8 Buovjaga 2020-09-28 09:29:47 UTC
(In reply to Telesto from comment #7)
> (In reply to Heiko Tietze from comment #6)
> > 7. CTRL+Z
> > all text is selected and italic, around is bold, alley is normal
> 
> True -> That's the bug :-)

Indeed. Heiko: why do you think, if we start from non-italic and then undo back to the starting stage, it would be normal to remain in italic?
Comment 9 Telesto 2020-09-28 09:39:33 UTC
(In reply to Buovjaga from comment #8)
> (In reply to Telesto from comment #7)
> > (In reply to Heiko Tietze from comment #6)
> > > 7. CTRL+Z
> > > all text is selected and italic, around is bold, alley is normal
> > 
> > True -> That's the bug :-)
> 
> Indeed. Heiko: why do you think, if we start from non-italic and then undo
> back to the starting stage, it would be normal to remain in italic?

Heiko has sometimes some specific approach; comes with creativity and design. This is a feature we simply we don't get, yet.

We are simply to 'conformant'; boring as hell :P. Let undo surprise you.
Comment 10 Heiko Tietze 2020-09-28 13:52:02 UTC
Indeed, strange bug. Any insights, Mike?
Comment 11 QA Administrators 2022-10-06 04:09:49 UTC Comment hidden (obsolete)
Comment 12 aharnack 2024-06-21 19:09:05 UTC
The problem still persists in the described way. 
It can also be re-produced the following way:

1. open a new writer document and enter some text: "Lorem ipsum dolor sit amet"
2. save, close and re-open it (not strictly necessary but it makes the effect clearer)
4. select a word by double-clicking on it: "ipsum"
5. assign a character style clearly distinguishable from normal text like "Strong Emphasize"
6 collapse the selection by pressing ESC
7 select character style "Standard" (so that the next typed character would appear in default text style)
8 undo twice (by toolbar icon, menu entry or ctrl-Z)

Changing the character style of the previously selected word to "Strong Emphasize"should have been undone now and the word should appear in normal text again, but it is still shown in "Strong Emphasize". 

However, the document is now marked as unchanged, as can be seen on the "Save" icon in the toolbar. Closing the document would not ask to save it. Saving the document with "Save As" under a different name, on the other hand, will contain the change.

Interesting also the following effect, continuing immediately after point 8. above:

9. re-do once and undo once, now the selection is undone properly
10. re-do twice and undo twice, the problem is back again

The issue has been re-produced on the following OO and LO versions:

LibreOffice 7.4.7.2 on Debian 12.5
OpenOffice 4.1.15 on Debian 12.5
OpenOffice 4.1.15 on Windows 11
LibreOffice 7.0.7.2 on Debian 11.9
OpenOffice 4.1.15 on Debian 10.13
OpenOffice 4.1.6 on Windows 10