Bug 148791 - Paste As Rows Above and table insertion mode insert less rows in Writer
Summary: Paste As Rows Above and table insertion mode insert less rows in Writer
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.4.0.0 alpha0+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:7.4.0 target:7.3.4
Keywords: filter:odt
Depends on:
Blocks: Paste
  Show dependency treegraph
 
Reported: 2022-04-26 07:40 UTC by NISZ LibreOffice Team
Modified: 2022-04-27 11:39 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Result of the incomplete Paste as Rows Above (with partial overwriting) (7.93 KB, image/png)
2022-04-26 07:54 UTC, László Németh
Details
Intial table - Screenshot 1 (32.78 KB, image/png)
2022-04-26 07:56 UTC, NISZ LibreOffice Team
Details
Requested - Screenshot 3 (42.59 KB, image/png)
2022-04-26 07:58 UTC, NISZ LibreOffice Team
Details

Note You need to log in before you can comment on or make changes to this bug.
Description NISZ LibreOffice Team 2022-04-26 07:40:20 UTC
Description:
Using Undo and Redo after deleting table row in Hide Changes mode with change tracking didn’t set the row to deleted, only its content.

Steps to Reproduce:
1. Open https://bugs.documentfoundation.org/attachment.cgi?id=170861 (test file of https://bugs.documentfoundation.org/show_bug.cgi?id=141391) (see screenshot 1).
2. Select last two rows.
3. Copy them to the clipboard.
4. In the first table row, choose Edit→Paste Special→Paste as Rows Above.

Actual Results:
Only a single row inserted above. Vontent of the original first row is overwritten by the second row of the clipboard content (see screenshot 2)

Expected Results:
Insert two rows above according to the 2-row clipboard content (see screenshot 3).


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 7.4.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: a98971ac975e19efa2336b608506eefa85ce2485
CPU threads: 8; OS: Windows 10.0 Build 19042; UI render: Skia/Vulkan; VCL: win
Locale: hu-HU (hu_HU); UI: en-US
Calc: CL
Comment 1 László Németh 2022-04-26 07:54:58 UTC
Created attachment 179777 [details]
Result of the incomplete Paste as Rows Above (with partial overwriting)
Comment 2 NISZ LibreOffice Team 2022-04-26 07:56:46 UTC
Created attachment 179778 [details]
Intial table - Screenshot 1
Comment 3 NISZ LibreOffice Team 2022-04-26 07:58:48 UTC
Created attachment 179779 [details]
Requested - Screenshot 3
Comment 4 Commit Notification 2022-04-26 15:43:25 UTC
László Németh committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/2fbf0f418ccb25010add33449d4e42b8b3f7fd0b

tdf#148791 tdf#64902 tdf#127759 sw: fix row insert/paste

It will be available in 7.4.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 5 László Németh 2022-04-26 15:43:58 UTC
Commit description:

tdf#148791 tdf#64902 tdf#127759 sw: fix row insert/paste

Table insertion mode and Paste as Rows Above inserted
only a single row above, and overwrite the next ones in
the following cases (instead of inserting/pasting rows
above according to the clipboard table content):

The table stored in the clipboard

– has centered, right or not paragraph starting alignment;

– or its resource table has a table header with 2 or more
  repeating rows, and the clipboard content contains the
  same amount or less rows (it doesn't matter, that
  the copied rows weren't header rows originally).

The reason was that parsing of the HTML clipboard content
which is used for counting the row count of the clipboard
content hadn't handle the following cases:

– different table aligment results <tr> elements with
  greater indentation level in the HTML extract, according
  to the new root element <center>, <div> or <dl>;

– copying rows from a table with row header always starts
  with <thead> in the HTML extract, i.e. detecting <tbody>
  can fail, because there could be only <thead> in the
  HTML extract (see Case 2 above).

Follow-up to commit 0c8b1efbad48fa9697c0b1afbe4753bbbc3c4c5c
"tdf#127759 Writer: add table row/column insert mode" and
commit 7efae60f3625a58f8a617c80f2a55a695fbaef36
"tdf#64902 Writer table: Paste Special->Rows Above".
Comment 6 Commit Notification 2022-04-27 08:50:37 UTC
László Németh committed a patch related to this issue.
It has been pushed to "libreoffice-7-3":

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

tdf#148791 tdf#64902 tdf#127759 sw: fix row insert/paste

It will be available in 7.3.4.

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 7 NISZ LibreOffice Team 2022-04-27 11:39:27 UTC
Verified in:
Version: 7.4.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 3a05acb8f0d94728ea6cbfd7a69dac6ffa7ffc68
CPU threads: 4; OS: Windows 10.0 Build 18363; UI render: Skia/Raster; VCL: win
Locale: hu-HU (hu_HU); UI: en-US
Calc: threaded