Bug 145718 - DOCX import: support MoveTo/MoveFrom completely
Summary: DOCX import: support MoveTo/MoveFrom completely
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.3.0.0 alpha0+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:7.3.0 inReleaseNotes
Keywords:
Depends on: 145233
Blocks: Track-Changes-TextFormatting 145720
  Show dependency treegraph
 
Reported: 2021-11-16 14:38 UTC by NISZ LibreOffice Team
Modified: 2022-01-22 02:32 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:
Regression By:


Attachments
Example file from Word with DOCX import: support MoveTo/MoveFrom completely (11.44 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2021-11-16 14:39 UTC, NISZ LibreOffice Team
Details
Screenshot of the original document side by side in Writer DOCX import: support MoveTo/MoveFrom completely (30.22 KB, image/png)
2021-11-16 14:39 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-11-16 14:38:25 UTC
Description:
Text moving is only recognized in simple cases, but not when the moved text was modified later.

Steps to Reproduce:
1.	Open the attached file.
2.	See that the string is displayed at both the original position, as well as the new position.


Actual Results:
The change is not visible.

Expected Results:
Should be the change visible with green after the move.


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 7.3.0.0.alpha1+ (x64) / LibreOffice Community
Build ID: a0a38b88dc3a61d212d784f41a27f97d9c2d7f32
CPU threads: 4; OS: Windows 10.0 Build 19042; UI render: default; VCL: win
Locale: hu-HU (hu_HU); UI: hu-HU
Calc: threaded
Comment 1 NISZ LibreOffice Team 2021-11-16 14:39:11 UTC
Created attachment 176286 [details]
Example file from Word with DOCX import: support MoveTo/MoveFrom completely
Comment 2 NISZ LibreOffice Team 2021-11-16 14:39:38 UTC
Created attachment 176287 [details]
Screenshot of the original document side by side in Writer DOCX import: support MoveTo/MoveFrom completely
Comment 3 László Németh 2021-11-16 14:54:11 UTC
Green color and double strikethrough or underline show already simple text moving, see tdf#145233.

Note: The attached test file is duplication of the second test document of tdf#104797.
Comment 4 Commit Notification 2021-11-17 19:06:54 UTC
László Németh committed a patch related to this issue.
It has been pushed to "master":

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

tdf#145718 sw, DOCX import: complete tracked text moving

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 5 László Németh 2021-11-17 19:07:33 UTC
tdf#145718 sw, DOCX import: complete tracked text moving

Add IsMoved bit to SwRangeRedline, and keep it in both
parts of a split Delete/Insert redline. Set this bit
during DOCX import, fixing incomplete import of
moveFrom/moveTo elements.

Details:

- Search text moving only at redline Insert() and AppendRedline()
  instead in the layout code (which was much slower, because
  triggered by also mouse hovering):

- detect text moving in Hide Changes mode, too;

- Insertion inside or directly after tracked text moving keeps
  "moved text" layout of the original moved text parts (before
  and after the insertion).

- at detection of text moving, invalidate (update) layout of the
  redline pair, too.

- fix DOCX import: extend makeRedline() with property RedlineMoved
  to keep all moveFrom/moveTo stored in DOCX instead of
  losing them (joining them with normal redlines) in the case
  of missing Delete/Insert pair (see unit test document);

Follow-up to commit ec577f566fa3e6d2666069180f8ec8474054aea9
"tdf#145233 sw track changes: show moved text in green color",
commit bcdebc832b272662d28035007a4796e42d1305ae
"tdf#104797 DOCX change tracking: handle moveFrom and moveTo"
and commit d32d9a2b3c5e3963f4a18f6c7bbf50fab2e9b2be
"tdf#123460 DOCX track changes: moveFrom completely".
Comment 6 NISZ LibreOffice Team 2021-12-08 08:46:51 UTC
Verified in:
Version: 7.4.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 3a61cce54277fd12570103a191c50d9b37ef3dd3
CPU threads: 8; OS: Windows 10.0 Build 18363; UI render: Skia/Raster; VCL: win
Locale: hu-HU (hu_HU); UI: hu-HU
Calc: CL
Comment 7 stragu 2021-12-29 22:44:13 UTC
Bug reproduced in:

Version: 7.0.6.2
Build ID: 00(Build:2)
CPU threads: 8; OS: Linux 5.4; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Ubuntu package version: 1:7.0.6-0ubuntu0.18.04.1_lo1
Calc: threaded

And verified as fixed (showing green highlight, cut and paste actions in Manage Changes) in:

Version: 7.3.0.1 / LibreOffice Community
Build ID: 840fe2f57ae5ad80d62bfa6e25550cb10ddabd1d
CPU threads: 8; OS: Linux 5.4; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded