Bug 143318 - FILEOPEN DOCX Drag and drop change tracked move of table in Word imported incorrectly
Summary: FILEOPEN DOCX Drag and drop change tracked move of table in Word imported inc...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:7.3.0 target:7.2.1
Keywords: filter:docx
Depends on:
Blocks: DOCX-Track-Changes DOCX-Floatingtable Track-Changes-Frame
  Show dependency treegraph
 
Reported: 2021-07-12 15:23 UTC by NISZ LibreOffice Team
Modified: 2021-09-02 12:30 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
The example file with the tables created in MS Word (13.27 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2021-07-12 15:23 UTC, NISZ LibreOffice Team
Details
Screenshot of the document with the tables side by side in Writer and Word (102.67 KB, image/png)
2021-07-12 15:24 UTC, NISZ LibreOffice Team
Details
Unit test document with tracked insertion of plain (not floating) table (12.67 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2021-07-23 08:31 UTC, László Németh
Details
Minimal reproducer containing only a table wrap change (13.01 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2021-07-23 09:59 UTC, NISZ LibreOffice Team
Details
The floating table in Word (79.60 KB, image/png)
2021-07-23 10:04 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 2021-07-12 15:23:55 UTC
Created attachment 173511 [details]
The example file with the tables created in MS Word

In the attached .docx file, a table was moved a little with the mouse with change tracking enabled, so there are 2 drag and drop changes in Words Reviewing pane. Accepting the changes will delete the first table, rejecting them will delete the second one.
In Writers Manage Changes panel, accepting the changes will delete the content from the first table, rejecting the changes will do nothing with the tables.

Steps to reproduce:
1.	Open attached .docx file in Word.
2.	In the Reviewing pane, we can see the changes (2 drag and drop moves).
3.	Open attached .docx file in LO Writer.
4.	Under the Manage Changes panel, reject/accept the changes.

Actual results:
After opening the file and accepting the changes Writer will delete only the content from the first table. Rejecting the changes will do nothing with the tables.

Expected results:
Accepting/rejecting the changes should work like in Word.

LibreOffice details:
Version: 7.3.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: bd2f2273d83dcca43eb6b465308707efd45e7adf
CPU threads: 8; OS: Windows 10.0 Build 18363; UI render: Skia/Raster; VCL: win
Locale: hu-HU (hu_HU); UI: hu-HU
Calc: threaded

Also happens in 7.0, 6.1.
In 6.0 and older no tracked change was imported at all.
Comment 1 NISZ LibreOffice Team 2021-07-12 15:24:19 UTC
Created attachment 173512 [details]
Screenshot of the document with the tables side by side in Writer and Word
Comment 2 László Németh 2021-07-23 08:31:25 UTC
Created attachment 173794 [details]
Unit test document with tracked insertion of plain (not floating) table

The previous test document contains two problems: not only lost tracked table (row) deletions and insertions, but conversion to floating table (with missing redline). That would be fine to file in a new bug.
Comment 3 NISZ LibreOffice Team 2021-07-23 09:59:07 UTC
Created attachment 173795 [details]
Minimal reproducer containing only a table wrap change

This is an example file for the wrap change, making the table "floating" in Word.
Comment 4 NISZ LibreOffice Team 2021-07-23 10:04:06 UTC
Created attachment 173797 [details]
The floating table in Word

Word can change track making a table floating. 
Writer cannot handle this at all, that would be another half of this bug.
Comment 5 Commit Notification 2021-08-12 09:55:19 UTC
László Németh committed a patch related to this issue.
It has been pushed to "master":

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

tdf#143318 DOCX import: fix missing redlines in flying tables

It will be available in 7.3.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 6 László Németh 2021-08-12 09:56:44 UTC
tdf#143318 DOCX import: fix missing redlines in flying tables

makeRedline() exceptions (in the case of already existing
redlines) skip the creation of the next (not existing yet)
redlines in tables inside fly frames. Here: a tracked table
moving revealed the problem, with the missing rejection of the
new position, i.e. the "new" (second) table of the document.

Note: fix also collecting redlines within tables: IsInTable()
isn't true in the first cell of the table, losing the
redline here, so it's replaced with m_nTableDepth > 0.

Follow-up to commit 7f3c0bbc174b9b0316991c174ca3b407c0e3d141
"tdf#143510 DOCX import: fix tracked table drag & drop".
Comment 7 Commit Notification 2021-08-12 13:39:54 UTC
László Németh committed a patch related to this issue.
It has been pushed to "libreoffice-7-2":

https://git.libreoffice.org/core/commit/5af699be26fc959aa7d807e59d3873cc5b2fb230

tdf#143318 DOCX import: fix missing redlines in flying tables

It will be available in 7.2.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 8 NISZ LibreOffice Team 2021-09-02 12:30:19 UTC
Verified in:

Version: 7.3.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: d5ade739771ddf06cc7ee6d4af15672bfcf09ed6
CPU threads: 4; OS: Windows 10.0 Build 17134; UI render: default; VCL: win
Locale: hu-HU (hu_HU); UI: hu-HU
Calc: threaded