Bug 107292 - uninterrupted deletion tracked changes inserted in wrong order during ODF import
Summary: uninterrupted deletion tracked changes inserted in wrong order during ODF import
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium critical
Assignee: Not Assigned
URL:
Whiteboard: odf target:7.4.0 target:7.3.0.0.beta2
Keywords: dataLoss
: 136179 (view as bug list)
Depends on:
Blocks: Track-Changes ODF-import
  Show dependency treegraph
 
Reported: 2017-04-20 13:02 UTC by Timur
Modified: 2022-02-03 10:24 UTC (History)
9 users (show)

See Also:
Crash report or crash signature:


Attachments
ODT file with tracked changes created with LO 5.1.6 (114.27 KB, application/vnd.oasis.opendocument.text)
2017-04-20 13:02 UTC, Timur
Details
Simple reproducer document (24.57 KB, application/vnd.oasis.opendocument.text)
2021-10-13 06:20 UTC, Gabor Kelemen (allotropia)
Details
The example file before saving (245.87 KB, image/png)
2021-10-13 06:20 UTC, Gabor Kelemen (allotropia)
Details
The example file after saving (220.73 KB, image/png)
2021-10-13 06:21 UTC, Gabor Kelemen (allotropia)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Timur 2017-04-20 13:02:53 UTC
Created attachment 132713 [details]
ODT file with tracked changes created with LO 5.1.6

1. open attached ODT with tracked changes (that was created with LO 5.1.6)
2. observe deleted text from Heading 2 "XXXIII Glava..." on page 82 with articles "Član 399" up to page 86 with article "Član 418" 
3. save as ODT again
4.  observe deleted text starting on page 82 with articles "Član 410" up to page 84 with article "Član 418" and then articles "Član 399" up to "Član 409". 

Tested from OO to LO 5.4+. Marked as Critical. Not found to be reported. Please test.
Comment 1 Buovjaga 2017-04-27 18:04:00 UTC
Reproduced.

Arch Linux 64-bit, KDE Plasma 5
Version: 5.4.0.0.alpha0+
Build ID: f69424ff90f83136027df3063d4c8ddafdf79faa
CPU threads: 8; OS: Linux 4.10; UI render: default; VCL: kde4; 
Locale: fi-FI (fi_FI.UTF-8); Calc: group
Built on April 25th 2016
Comment 2 Timur 2017-07-06 16:50:11 UTC Comment hidden (obsolete)
Comment 3 Timur 2017-08-02 10:45:15 UTC
Caolan, I add you to CC to see this, if you can. Only similar I found is Bug 37584 where you were and I don't see Cédric around.
Comment 4 Caolán McNamara 2017-08-09 07:52:01 UTC
mstahl might be a better choice here
Comment 5 Michael Stahl (allotropia) 2017-08-23 20:26:51 UTC
ouch - there are 5 delete tracked changes immediately following each other, and the ODF import reverts their sequence.

that is, in the attachmed document, they are in the "wrong" order, but after import into LO they are displayed in the "right" order, then stored in the "right" order, then open that again with LO the order is switched again and they are displayed in the "wrong" order.

ridiculous workaround: save the wrongly displayed document again, then open it

looks like it's always been broken, can repro in OOo 2.2
Comment 6 QA Administrators 2018-08-24 02:43:48 UTC Comment hidden (obsolete)
Comment 7 Timur 2018-08-24 09:24:48 UTC Comment hidden (obsolete)
Comment 8 Timur 2019-02-11 12:19:16 UTC Comment hidden (obsolete)
Comment 9 Timur 2020-10-06 07:27:23 UTC
Repro 7.1+.
Comment 10 Gabor Kelemen (allotropia) 2021-10-13 06:20:08 UTC
Created attachment 175706 [details]
Simple reproducer document

Seems like it's bad when the deletions are inside a paragraph, but not when whole paragraphs are deleted.
Comment 11 Gabor Kelemen (allotropia) 2021-10-13 06:20:42 UTC
Created attachment 175707 [details]
The example file before saving
Comment 12 Gabor Kelemen (allotropia) 2021-10-13 06:21:03 UTC
Created attachment 175708 [details]
The example file after saving
Comment 13 Commit Notification 2021-12-08 11:41:46 UTC
László Németh committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/76784f2dbf6d8641cfb6bf5d24e37521d6c806df

tdf#107292: ODT import: fix order of deletions at same position

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 14 Commit Notification 2021-12-08 13:11:59 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/19d3ecf9334f9750c06feb7207ecc3c6b98ba086

tdf#107292: ODT import: fix order of deletions at same position

It will be available in 7.3.0.0.beta2.

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 15 NISZ LibreOffice Team 2022-01-04 13:02:56 UTC
Verified in:
Version: 7.4.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 8f0ce842dffe229d31bd9841ac6e999da1ae976d
CPU threads: 8; OS: Windows 10.0 Build 18363; UI render: Skia/Vulkan; VCL: win
Locale: hu-HU (hu_HU); UI: hu-HU
Calc: CL
Comment 16 Timur 2022-01-06 14:02:16 UTC
Thanks László for dealing with this, not simple at all. 
But please explain, I don't see it fixed. 
With 7.4 it already opens wrong (..Član 398, Član 410-418, Član 399..), although it saves the same.
Comment 17 Buovjaga 2022-01-06 14:05:31 UTC
(In reply to Timur from comment #16)
> Thanks László for dealing with this, not simple at all. 
> But please explain, I don't see it fixed. 
> With 7.4 it already opens wrong (..Član 398, Član 410-418, Član 399..),
> although it saves the same.

He was not in Cc
Comment 18 László Németh 2022-01-06 16:35:45 UTC
@Timur: it seems, the original bug document is corrupted (re-saved after the bad import):

The following IDs sign the deleted text parts:

<text:changed-region xml:id="ct342249440" text:id="ct342249440"><text:deletion> ... Član 410.

<text:changed-region xml:id="ct342248960" text:id="ct342248960"><text:deletion> ... Član 399


And in the body text, ct342249440 (i.e. Chapter 410) is before ct342248960 (Chapter 399), which means corrupted document:

<text:change text:change-id="ct342249440"/><text:change text:change-id="ct342249320"/><text:change text:change-id="ct342249200"/><text:change text:change-id="ct342249080"/><text:change text:change-id="ct342248960"/></text:p>


A workaround for testing: re-save the document with a non-fixed version of LibreOffice, and check that with the fixed version.

@Timur, Buovjava: thanks for the feedback.
Comment 19 Timur 2022-01-07 12:34:34 UTC
(In reply to László Németh from comment #18)
> A workaround for testing: re-save the document with a non-fixed version of
> LibreOffice, and check that with the fixed version.
Looking good and saving properly. Thanks!

Not needed as it works with ODT, but now there's also another way to repair a document: save as DOCX in non-fixed 7.1 (where it opens properly), open DOCX in 7.4+ (where it looks good on open) and save as ODT, which looks good on reopen.
Comment 20 Gabor Kelemen (allotropia) 2022-02-03 10:24:17 UTC
*** Bug 136179 has been marked as a duplicate of this bug. ***