Bug 56266 - FILESAVE: "Track/record changes": interdependentant revision marks not correctly saved to ODT file
Summary: FILESAVE: "Track/record changes": interdependentant revision marks not correc...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
3.6.2.2 release
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:7.4.0
Keywords: preBibisect, regression
Depends on:
Blocks: Track-Changes
  Show dependency treegraph
 
Reported: 2012-10-21 22:19 UTC by stfhell
Modified: 2024-04-26 19:18 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
document with revision marks by user 1 (steps 1/2) (10.19 KB, application/vnd.oasis.opendocument.text)
2012-10-21 22:23 UTC, stfhell
Details

Note You need to log in before you can comment on or make changes to this bug.
Description stfhell 2012-10-21 22:19:12 UTC
When you use revision marks (track/record changes) in ODT, Writer does not always correctly save the revision history of the document and, consequently, some insertions made and tracked are accepted instead of rejected when you reject all changes.

This happens when 2 or more users edit a document under revision control in separate edit sessions, and one user deletes text inserted by another user.

Reproduce:
(1) Take an ODT document. Ensure that a valid user name is defined under Tools/Options/User Data. (User 1)
(2) Enable "Record changes". Insert 3 or more words of text. (Optionally save to file.)
(3) Let another user open the file. Or: change your user name under Tools/Options/User Data. (User 2)
(4) Delete the 2nd word inserted in step (2).
Open "Accept/reject all changes" dialogue: the edits are displayed in a tree structure reflecting their "nested" character. Close dialogue without doing anything.
(5) Save and close the file. Reload it.
Open "Accept/reject all changes" dialogue: the edits are displayed in a flat list - information about their "nestedness" is lost.
(6) Reject all changes made. The complete insertion in step (2) should be deleted. Instead, the part deleted by user 2 in step (4) is kept in the document plus the text inserted by User 1 following the word deleted by User 2.

Interdependentant edits (deletions inside insertions) are correctly kept in LO's internal data structures, but not properly saved to file and lost on reload of the document.

By the way: If you reject all changes after step 4, you cannot do it in 1 step as I would expect. You have to press the same button twice. But I'm not sure if there is some logic behind that.

Tested with LO 3.5.4.2 and 3.6.2.2 (Ubuntu 12.04).
Comment 1 stfhell 2012-10-21 22:23:05 UTC
Created attachment 68891 [details]
document with revision marks by user 1 (steps 1/2)

ODT with some text by User 1. Go on with step 3 and delete some of the inserted text.
Comment 2 bfoman (inactive) 2013-05-13 10:03:04 UTC
(In reply to comment #0)
> (6) Reject all changes made. The complete insertion in step (2) should be
> deleted. Instead, the part deleted by user 2 in step (4) is kept in the
> document plus the text inserted by User 1 following the word deleted by User
> 2.

Confirmed with:
LO 4.0.2.2
Build ID: own W7 debug build
Windows 7 Professional SP1 64 bit

> Interdependentant edits (deletions inside insertions) are correctly kept in
> LO's internal data structures, but not properly saved to file and lost on 
> reload of the document.

Could not reproduce. Added 1 2 3 as user 1, saved document, opened and deleted 2 as user 2, saved document, opened as user 1 and deletion by user 2 is visible.
Comment 3 stfhell 2013-06-05 13:18:20 UTC
Setting status to NEW after confirmation in comment 2.

(In reply to comment #2)
> > Interdependentant edits (deletions inside insertions) are correctly kept in
> > LO's internal data structures, but not properly saved to file and lost on 
> > reload of the document.
> 
> Could not reproduce. Added 1 2 3 as user 1, saved document, opened and
> deleted 2 as user 2, saved document, opened as user 1 and deletion by user 2
> is visible.

This is not a separate issue but rather the explanation why "reject all changes" does not work properly. Saving a file to ODT "flattens" the multi-level structure of tracked changes.

While LO has the doc still in memory, it records 2 levels of changes:

| change 1: inserted text (1 word)
| change 2: inserted text (user 1) + deleted text (user 2) (1 word)
| change 3: inserted text (1 word)

When LO saves the file to ODT, the 2 edits are flattened to 3 simple changes:

| change 1: inserted text (user 1)
| change 2: deleted text  (user 2)
| change 3: inserted text (user 3)

The 2nd word is treated as if it already had been in the document before track changes was enabled. It is correctly marked as deletion by user 2, but no longer as an insertion by user 1.

Note that exporting the file to DOC preserves the 2-level nature of the changes.
Comment 4 QA Administrators 2015-03-17 00:17:35 UTC Comment hidden (obsolete)
Comment 5 Buovjaga 2015-03-31 08:43:44 UTC
Reproduced using attachment 68891 [details].

Win 7 Pro 64-bit Version: 4.5.0.0.alpha0+
Build ID: 8c3cf9dd48e40604867d3a28bddaccd65142df17
TinderBox: Win-x86@62-TDF, Branch:MASTER, Time: 2015-03-27_15:15:18
Locale: fi_FI
Comment 6 tommy27 2016-04-16 07:23:18 UTC Comment hidden (obsolete)
Comment 7 QA Administrators 2019-05-14 02:57:19 UTC Comment hidden (obsolete)
Comment 8 QA Administrators 2021-05-14 04:11:15 UTC Comment hidden (obsolete)
Comment 9 NISZ LibreOffice Team 2021-05-19 10:33:51 UTC
Still happens in

Version: 7.2.0.0.alpha1+ (x64) / LibreOffice Community
Build ID: 91330c503b7eb91d777978018b66890af87cf8f5
CPU threads: 4; OS: Windows 10.0 Build 18363; UI render: default; VCL: win
Locale: hu-HU (hu_HU); UI: en-US
Calc: CL
Comment 10 Xisco Faulí 2021-05-27 14:18:18 UTC
Hi Timur,
why was it set to High/Highest ?
Comment 11 Timur 2022-01-06 14:53:21 UTC
Repro 7.4+. This is dataLoss or it's opposite in step (6).
Comment 12 László Németh 2022-05-24 17:56:49 UTC
It seems, this is a regression from commit a9019e76812a947eb54cfa8d728c19361c929458
"INTEGRATION: CWS oasis (1.3.276); FILE MERGED
2004/05/12 11:00:37 mib 1.3.276.1: - #i20153#: changed <office:annotation> and <office:change-info>"
Comment 13 László Németh 2022-05-25 07:57:17 UTC
Commit description:

tdf#56266 sw xmloff: fix tracked deletions in insertions

RedlineSuccessorData export, i.e. tracked deletions
within tracked insertions were loaded as plain
tracked deletions during an ODF roundtrip. After that,
e.g. rejecting all changes couldn't reject the lost
tracked insertion, keeping the text of the tracked
deletion as part of the original text by mistake.

Regression from commit a9019e76812a947eb54cfa8d728c19361c929458
"INTEGRATION: CWS oasis (1.3.276); FILE MERGED
2004/05/12 11:00:37 mib 1.3.276.1: - #i20153#: changed <office:annotation> and <office:change-info>"

Note: RedlineSuccessorData is still stored in an extra
text:insertion within text:changed-region, only the
not ODF-compatible office:chg-author and office:chg-date-time
attributes were changed to dc:creator and dc:date elements
in RedlineSuccessorData export:

<text:changed-region>
  <text:deletion/>
  <text:insertion/>
</text:changed-region>

Because this structure still causes a bootstrap ODF validation
error in the odfexport and layout tests, check the export with
uitest. See also SetChangeInfo()/RedlineAdd().
Comment 14 Commit Notification 2022-05-25 07:57:40 UTC
László Németh committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/2682828f73a6c759735613ec924357424baeae24

tdf#56266 sw xmloff: fix tracked deletions in insertions

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 15 NISZ LibreOffice Team 2022-05-31 09:47:06 UTC
The problem is fixed.
But the "Reject All" is not working the same in the bellow two option:
1. Edit -> Track Changes -> Reject All
2. Edit -> Track Changes -> Manage... -> Reject All

The first one is reject all the changes independently which user changed the document.
The second one deletes only the last changes so if one user create something (change the document) and other user changes that only the last change will be rejected.
Comment 16 NISZ LibreOffice Team 2022-05-31 09:47:24 UTC
Verified in:
Version: 7.4.0.0.alpha1+ (x64) / LibreOffice Community
Build ID: dfd5081ff3973d5d0f216b06dda6360fa490cc9c
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
Comment 17 Mike Kaganski 2024-04-26 19:18:47 UTC
(In reply to Commit Notification from comment #14)
> László Németh committed a patch related to this issue.
> It has been pushed to "master":
> 
> https://git.libreoffice.org/core/commit/
> 2682828f73a6c759735613ec924357424baeae24
> 
> tdf#56266 sw xmloff: fix tracked deletions in insertions

Any attempt to use this in a unit test in CppunitTest_sw_odfexport results in:

> Error: element "text:insertion" was found where no element may occur
> text:p></text:deletion><text:insertion><office:change-info><dc:creator>John Doe
>                                  ----^

So this obviously missed to add respective changes to (our extended) schema. ODF [1] tells clearly, that text:changed-region contains a *single* element. Currently we produce invalid ODF.


[1] https://docs.oasis-open.org/office/OpenDocument/v1.3/os/part3-schema/OpenDocument-v1.3-os-part3-schema.html#__RefHeading__1415172_253892949