Bug 91811 - Editing char attributes in text boxes should handle Undo better
Summary: Editing char attributes in text boxes should handle Undo better
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Draw (show other bugs)
Version:
(earliest affected)
5.0.0.0.alpha0+ Master
Hardware: Other All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Undo-Draw
  Show dependency treegraph
 
Reported: 2015-06-02 13:31 UTC by Philippe Jung
Modified: 2020-08-22 20:12 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 Philippe Jung 2015-06-02 13:31:54 UTC
In fix implemented for bug 88276, if you create a text box with "A"
Then you edit it, type "B C"
Select B, make background light purple
Select C, make background dark watermelon (the colors have no importance)
Click outside the text box
Type Ctrl-Z

I would expect a step by step Undo

Currently, text box becomes "A" with no bg color.
Comment 1 Katarina Behrens (Inactive) 2015-06-04 08:56:58 UTC
It's not limited to text background colour (thus, adjusting the summary). 

Repeat the experiment from initial comment with font colour, click outside the box, Ctrl-Z for undo and ta-da - the whole content of text box disappears.

Interestingly enough, undo more-less works when undoing while the cursor is still inside the text box.

Anyway, confirming
Comment 2 mwtjunkmail 2020-08-22 20:12:50 UTC
Behavior has changed slightly since origination of this bug.

Using:

Version: 7.1.0.0.alpha0+ (x64)
Build ID: 8700bace8c0714d853f5df6918ab9c8bb3d81f77
CPU threads: 8; OS: Windows 10.0 Build 20197; UI render: Skia/Vulkan; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: CL

If you follow the original steps:

=====================
If you create a text box with "A"
Then you edit it, type "B C"
Select B, make background light purple
Select C, make background dark watermelon (the colors have no importance)
Click outside the text box
Type Ctrl-Z

I would expect a step by step Undo

Currently, text box becomes "A" with no bg color.
=====================

Undo does track the change to each character within the text box during any single session of editing the text box's contents before clicking outside of it.

However, if the user completes all the above edits and THEN clicks outside of the text box and hits Control-Z (or Edit, Undo), the text box disappears entirely (because Undo: Insert was the last edit tracked) or reverts to whatever was last typed in the text box prior to the last set of edits.

Therefore, there IS a step-by-step undo, but it's at the current object's level. While within the text box object, edits track changes within the object as one would expect (reversing the colorization one Undo at a time of A, B, and C).

Clicking outside of the text box tracks changes at the level above that, meaning the entire container (Insert: Text Box) versus its contents.

So this works for me, based on my understanding of how Undo works.




Step-by-step undo DOES WORK if you click outside of the text box per editing instance (change "A", click outside, change "B", click outside, etc).