Bug 129498 - EDITING: Last row of table in Impress slide is not drawn correctly after multiple-undo and multiple-redo
Summary: EDITING: Last row of table in Impress slide is not drawn correctly after mult...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Impress (show other bugs)
(earliest affected) release
Hardware: x86-64 (AMD64) All
: medium minor
Assignee: Not Assigned
Keywords: implementationError
Depends on:
Blocks: ImpressDraw-Tables Undo-Redo
  Show dependency treegraph
Reported: 2019-12-19 15:00 UTC by Stepas Toliautas
Modified: 2019-12-21 13:45 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:

Bug reproduction in pictures (500.68 KB, application/zip)
2019-12-19 15:08 UTC, Stepas Toliautas

Note You need to log in before you can comment on or make changes to this bug.
Description Stepas Toliautas 2019-12-19 15:00:57 UTC
Undoing and redoing input of the last _two or more_ rows in a table in Impress slide results in last row drawn as single-line height, with additional lines hanging outside the table frame, IF AND ONLY IF the text in next-to-last row consists of single line, text in the last row is multi-line, and Undo is done after putting cursor to another row OR unselecting table and then entering any row (including the last one) again.
Moreover, this is only the first of more shenanigans that can be done to the table in this state (see below).

Steps to Reproduce:
1. Create or open new Impress presentation. [I use soffice.exe --impress]
2. Create a new slide.
3. Create a table using center-area menu, select 1 column and 2 or more rows.
4. Enter text row by row. Text in rows excluding the last two can be in single line or multiple lines.
5. Enter single line of text in next-to-last row.
6. Enter multiple lines in the last row.
7a. Put cursor to any other row OR
7b. deselect table, then select it again and enter any row.
[This step is required because otherwise Undo deletes text of the last row word-by-word and the bug conditions are not met.]
8. Perform Undo at least twice. [I use Ctrl-Z]
Note: after the first Undo, the last row will shrink to a single line. If you perform Redo right now, text and correct height of the last row is restored.
9. Perform Redo same numer of times as previous Undo.

Actual Results:
Last row remains drawn as single line. Other lines of text appear below the table frame. It's not just cell-shading issue, because the frame itself is drawn after the first line and can be interacted with.
Additionally, if in this state you enter any row/ cell and move the cursor in it, height of the last row is restored instantly. However, steps 8 and 9 remain repeatable (see attachment).

Expected Results:
Height of the last row is restored to a correct number of text lines.

Reproducible: Always

User Profile Reset: No

Additional Info:
After clicking-down on the hanging text and dragging the table a bit (it is allowed to do so), more fun can be had with Undo/ Redo. At this state, results become a little unpredictable, but so far I managed:
a) make Undo skip undoing the text insertion of the last row (the text in the previous rows get deleted and restored, while the last one remains) and
b) make Impress _jump to the first slide_ each time Undo or Redo is performed, even if the second slide (the one with the table) is repeatedly selected in-between.
Based on this experience, I think this bug is distantly related to Bug 89323 (see Comment 3 in that report). I can't reproduce the failure to delete table using Undo, but I strongly suspect Undo stack garbling happening here.

Tables in Impress are evil.
Version: (x64)
Build ID: a70c83f5881ec11def660a6158e04d9ec47207ef
CPU threads: 8; OS: Windows 10.0 Build 18362; UI render: GL; VCL: win; 
Locale: en-US (en_US); UI-Language: en-US
Calc: CL
Comment 1 Stepas Toliautas 2019-12-19 15:08:47 UTC
Created attachment 156674 [details]
Bug reproduction in pictures
Comment 2 Buovjaga 2019-12-21 13:45:47 UTC
It seems this started happening before the release of 4.2. Previously, undo had no effect at all! So I guess we are on the sunny side of history.

I tested both on Win and Linux. Testers should keep in mind the step "7a. Put cursor to any other row".