Bug 119019 - EDITING DOCX Track changes deletion and addition in paragraphs with tracked paragraph formatting change not displayed instantly
Summary: EDITING DOCX Track changes deletion and addition in paragraphs with tracked p...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.4 all versions
Hardware: All All
: medium normal
Assignee: László Németh
URL:
Whiteboard: target:6.2.0
Keywords: bibisected, bisected, regression
Depends on:
Blocks: DOCX-Track-Changes
  Show dependency treegraph
 
Reported: 2018-07-31 16:16 UTC by Gabor Kelemen (allotropia)
Modified: 2018-09-12 15:46 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Example file from Word (13.34 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2018-07-31 16:16 UTC, Gabor Kelemen (allotropia)
Details
The example document when first opened (78.54 KB, image/png)
2018-07-31 16:16 UTC, Gabor Kelemen (allotropia)
Details
Deleting the last sentences from the numbered paragraphs is recorded (83.60 KB, image/png)
2018-07-31 16:17 UTC, Gabor Kelemen (allotropia)
Details
Addition to the middle of the second paragraph is recorded (83.90 KB, image/png)
2018-07-31 16:19 UTC, Gabor Kelemen (allotropia)
Details
Saving and reopening makes the changes displayed as well (87.94 KB, image/png)
2018-07-31 16:20 UTC, Gabor Kelemen (allotropia)
Details
The modified file from LO 6.2 (10.49 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2018-07-31 16:21 UTC, Gabor Kelemen (allotropia)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gabor Kelemen (allotropia) 2018-07-31 16:16:15 UTC
Created attachment 143846 [details]
Example file from Word

Attached docx document has some tracked changes and numbered paragraphs.
When adding to or deleting from the numbered paragraph texts the changes are not reflected in the editor. 
User sees as if nothing would have happened, yet the changes are tracked, saved, and correctly displayed after a reload.

This does not seem to happen with a new document or an ODF one.

To reproduce:
1, Create a docx with numbered paragraphs in Word and do some tracked changes to the numbered paragraphs.
2, Open the document in Writer
3, Try to delete some text from the numbered paragraph. The change is recorded in the Manage Changes window. 
4, Try to add some text to the numbered paragraph. The change is recorded in the Manage Changes window. 
5, Save and reload the document. Now the changes appear in the numbered paragraph.

Actual result:
The deleted text is not formatted as deleted, the inserted is not formatted as inserted. 

Expected result:
The texts are instantly formatted as deleted or inserted.

Tested with bibisect-win32-6.2 version:

Version: 6.2.0.0.alpha0+
Build ID: 921f285c7ff713ad219d3e3385d7e7d12d33581e
CPU threads: 4; OS: Windows 6.3; UI render: default; 
Locale: hu-HU (hu_HU); Calc: CL

User who originally reported this to us has 5.4.5, so probably not a recent regression.
Comment 1 Gabor Kelemen (allotropia) 2018-07-31 16:16:55 UTC
Created attachment 143847 [details]
The example document when first opened
Comment 2 Gabor Kelemen (allotropia) 2018-07-31 16:17:39 UTC
Created attachment 143848 [details]
Deleting the last sentences from the numbered paragraphs is recorded
Comment 3 Gabor Kelemen (allotropia) 2018-07-31 16:19:27 UTC
Created attachment 143850 [details]
Addition to the middle of the second paragraph is recorded
Comment 4 Gabor Kelemen (allotropia) 2018-07-31 16:20:05 UTC
Created attachment 143851 [details]
Saving and reopening makes the changes displayed as well
Comment 5 Gabor Kelemen (allotropia) 2018-07-31 16:21:28 UTC
Created attachment 143853 [details]
The modified file from LO 6.2
Comment 6 László Németh 2018-08-21 15:11:45 UTC
It works in LibreOffice 3.3.2 and LibreOffice 4.2.6.3, but not in LibreOffice 5.1/5.3/master.
Comment 7 László Németh 2018-09-04 07:03:47 UTC
Losing of the visible deletion of the last numbered paragraph (bug of the first one is older):
 a5ce578dbf06c2b0abbf287c8fd6cdddc475fed0 is the first bad commit
commit a5ce578dbf06c2b0abbf287c8fd6cdddc475fed0
Author: Matthew Francis <mjay.francis@gmail.com>
Date:   Sun Mar 15 03:28:56 2015 +0800

    source-hash-9dbf817fe5c5253fba0831aefa17575ae0ba3af1
    
    commit 9dbf817fe5c5253fba0831aefa17575ae0ba3af1
    Author:     Luboš Luňák <l.lunak@collabora.com>
    AuthorDate: Wed Oct 1 19:12:47 2014 +0200
    Commit:     Luboš Luňák <l.lunak@collabora.com>
    CommitDate: Fri Oct 3 13:27:12 2014 +0200
    
        handle scope of w:pPrChange and w:rPrChange properly (bnc#821804)
    
        Redlines changing formatting of runs and paragraphs are valid for the entire
        run/paragraph, not just their existence in the XML. So store them
        in the matching contexts, which will care of it, instead of the endtrackchange
        stuff.
    
        Change-Id: Ie583e4be14e8df95829852bfbbbe25aa0684f02e

:040000 040000 8923e370a6aa04de316f97ab3ceee991ddf98d3e 3ffe1459e3e79ed8f216bd624368db994c2d904e M	opt
Comment 8 Xisco Faulí 2018-09-05 10:35:07 UTC
Hi László Németh,
so it crashes for you if you undo step 3 ?
I can't reproduce it in

Version: 6.2.0.0.alpha0+
Build ID: bf8fbbaa683ef7eef5f9587b60486f622b50cb80
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; 
Locale: ca-ES (ca_ES.UTF-8); Calc: threaded
Comment 9 Xisco Faulí 2018-09-05 10:49:45 UTC
I found another problem also introduced by 9dbf817fe5c5253fba0831aefa17575ae0ba3af1 which might be related as well:

To reproduce:
1, Create a docx with numbered paragraphs in Word and do some tracked changes to the numbered paragraphs.
2, Open the document in Writer
3, Try to delete some text from the numbered paragraph. The change is recorded in the Manage Changes window.
4. Accept or Reject all changes
5. Undo step 4

-> Step 3 is not recorded in the Manage Changes window
Comment 10 László Németh 2018-09-06 06:14:08 UTC
(In reply to Xisco Faulí from comment #8)
> Hi László Németh,
> so it crashes for you if you undo step 3 ?
> I can't reproduce it in
> 
> Version: 6.2.0.0.alpha0+
> Build ID: bf8fbbaa683ef7eef5f9587b60486f622b50cb80
> CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; 
> Locale: ca-ES (ca_ES.UTF-8); Calc: threaded

sorry, it was only an assert of the debug build:

soffice.bin: /home/laci/libreoffice/sw/source/core/undo/undobj.cxx:1451: static void SwUndo::SetSaveData(SwDoc&, SwRedlineSaveDatas&): Assertion `rSData.empty() || (rSData[0].nRedlineCount == rDoc.getIDocumentRedlineAccess().GetRedlineTable().size())' failed.
Comment 11 László Németh 2018-09-06 16:16:06 UTC
Proposed fix: https://gerrit.libreoffice.org/#/c/60101/
Comment 12 Commit Notification 2018-09-07 18:56:04 UTC
László Németh committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=694a6389e84d5b416cde6dde2d5eaa589a0a6493

tdf#119019 DOCX track changes: fix invisible delete and insert

It will be available in 6.2.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 13 Xisco Faulí 2018-09-10 08:07:10 UTC
Verfied in

Version: 6.2.0.0.alpha0+
Build ID: 433fce6571d4b9121374047324a7d2d2722ac3e4
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; 
Locale: ca-ES (ca_ES.UTF-8); Calc: threaded

Same as for the problem described in comment 9.

@László Németh, Thanks for fixing this!

OTOH, I've found some problems undoing/redoing the tracking changes. I'll create a new report for this!
Comment 14 Xisco Faulí 2018-09-12 15:46:24 UTC
> OTOH, I've found some problems undoing/redoing the tracking changes. I'll
> create a new report for this!

Reported in bug 119824