Bug 104797 - FILEOPEN [DOCX filter]: track changes move of string not parsed
Summary: FILEOPEN [DOCX filter]: track changes move of string not parsed
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: filters and storage (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: László Németh
URL:
Whiteboard: target:6.2.0 target:6.1.1 target:6.1.0
Keywords:
: 101580 114305 (view as bug list)
Depends on:
Blocks: Track-Changes DOCX-Paragraph
  Show dependency treegraph
 
Reported: 2016-12-19 20:42 UTC by Ruben
Modified: 2018-08-02 21:56 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Example docx from MSO 2013 with a move change (15.71 KB, application/vnd.ms-word.document.12)
2016-12-20 10:16 UTC, Buovjaga
Details
Clarification of the bug. (52.42 KB, image/png)
2016-12-22 10:12 UTC, Ruben
Details
DOCX with a moved sentence and added stuff (11.44 KB, application/msword)
2017-01-05 10:34 UTC, Buovjaga
Details
Screenshot of 6.1.1.0.0+ 2466ea26c4bef1e002a24f6845084633e5a058c4 (88.91 KB, image/png)
2018-07-23 13:45 UTC, opensuse.lietuviu.kalba
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ruben 2016-12-19 20:42:42 UTC
Description:
The track changes feature seems not to pick up on the moveFrom and moveTo change in a docx document. More problamatically: it shows the text at both the original position, as well as the new position. Without marking either as a change.

This is apparently a feature introduced in Word 2007: "In Word 2007 there are almost no changes to the "track changes" feature with the exception of move tracking: Word displays moved sentences/paragraphs differently from deleted/pasted ones." - https://wiki.documentfoundation.org/Track_changes

Unfortunately I don't have Word to reproduce it, so I'd suggest it can be two things:
- This is not implemented in the filter
- In my case it was not picked up, because the moveTo position contains other tracked changes (please see the additional information)

Steps to Reproduce:
1. Open a docx document that has tracked changes of a _movement_ of a text string
2. See that the string is displayed at both the original position, as well as the new position.

Actual Results:  
Moved sentence. Text after first sentence. Moved sentence.

Expected Results:
Text after first sentence. Moved sentence.


Reproducible: Always

User Profile Reset: No

Additional Info:
In the docx file I found (document.xml):
(seemingly) relevant bits in the docx file (document.xml):
 
<w:moveFromRangeStart w:id="408" w:author="xxx" w:date="2016-12-08T15:50:00Z" w:name="move342831535"/><w:moveFrom w:id="409" w:author="xxx" w:date="2016-12-08T15:50:00Z"><w:r w:rsidRPr="009D78DE" w:rsidDel="00347853"><w:rPr><w:sz w:val="26"/><w:lang w:val="en-US"/></w:rPr><w:t xml:space="preserve">It is unclear what is being measured. </w:t></w:r></w:moveFrom><w:moveFromRangeEnd w:id="408"/>

and later

<w:moveToRangeStart w:id="413" w:author="xxx" w:date="2016-12-08T15:50:00Z" w:name="move342831535"/><w:moveTo w:id="414" w:author="xxx" w:date="2016-12-08T15:50:00Z"><w:del w:id="415" w:author="xxx" w:date="2016-12-08T15:50:00Z"><w:r w:rsidR="00347853" w:rsidRPr="009D78DE" w:rsidDel="00347853"><w:rPr><w:sz w:val="26"/><w:lang w:val="en-US"/></w:rPr><w:delText>It is unclear w</w:delText></w:r></w:del></w:moveTo><w:ins w:id="416" w:author="xxx" w:date="2016-12-08T15:50:00Z"><w:r w:rsidR="00347853"><w:rPr><w:sz w:val="26"/><w:lang w:val="en-US"/></w:rPr><w:t>W</w:t></w:r></w:ins><w:moveTo w:id="417" w:author="xxx" w:date="2016-12-08T15:50:00Z"><w:r w:rsidR="00347853" w:rsidRPr="009D78DE"><w:rPr><w:sz w:val="26"/><w:lang w:val="en-US"/></w:rPr><w:t>hat is being measured</w:t></w:r></w:moveTo><w:ins w:id="418" w:author="xxx" w:date="2016-12-08T15:50:00Z"><w:r w:rsidR="00347853"><w:rPr><w:sz w:val="26"/><w:lang w:val="en-US"/></w:rPr><w:t xml:space="preserve"> thus remains unclear</w:t></w:r></w:ins><w:moveTo w:id="419" w:author="xxx" w:date="2016-12-08T15:50:00Z"><w:r w:rsidR="00347853" w:rsidRPr="009D78DE"><w:rPr><w:sz w:val="26"/><w:lang w:val="en-US"/></w:rPr><w:t>.</w:t></w:r><w:del w:id="420" w:author="xxx" w:date="2016-12-08T15:50:00Z"><w:r w:rsidR="00347853" w:rsidRPr="009D78DE" w:rsidDel="00347853"><w:rPr><w:sz w:val="26"/><w:lang w:val="en-US"/></w:rPr><w:delText xml:space="preserve"> </w:delText></w:r></w:del></w:moveTo><w:moveToRangeEnd w:id="413"/>


User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0
Comment 1 Buovjaga 2016-12-20 10:16:57 UTC
Created attachment 129803 [details]
Example docx from MSO 2013 with a move change

Not reproduced, LibreOffice shows the change.

Win 8.1 32-bit
MSO 2013
LibO Version: 5.4.0.0.alpha0+
Build ID: 52853b53494e1e51d71ccdb54afd7a4f16fba93c
CPU Threads: 4; OS Version: Windows 6.29; UI Render: default; 
TinderBox: Win-x86@42, Branch:master, Time: 2016-12-19_23:19:20
Locale: fi-FI (fi_FI); Calc: group
Comment 2 Ruben 2016-12-22 10:12:01 UTC
Thanks for the attachment: that move also works for me.

Could it then have to do with an edit of the moved text? I'll attach a screenshot to clarify the case.
Comment 3 Ruben 2016-12-22 10:12:54 UTC
Created attachment 129861 [details]
Clarification of the bug.
Comment 4 Buovjaga 2016-12-29 15:20:50 UTC
(In reply to Ruben from comment #3)
> Created attachment 129861 [details]
> Clarification of the bug.

It says "this sentence was moved and then edited further" - but edited in what? Word or Writer? I know you don't have Word, but I want to make it absolutely clear what you are referring to as this is somewhat confusing to reproduce.
Comment 5 Ruben 2017-01-04 16:20:29 UTC
Ok, I'll try to clarify it a bit more:

I wrote a document in LibreOffice, converted to docx and received a corrected/commented version again in docx format. It was worked on in Word (don't know which version). I imported this file in LO.

At a certain point I noticed a duplicate sentence, the first occurrence of which was _not_ shown in a preview on my phone (Google Documents).
Previewing it in Google Docs (online) showed the same sentence was moved, and then edited.
LO showed two times the same sentence, with only displaying the _edits_ on its second occurrence (not the move).

So the commenter moved a sentence, _and_ then edited the moved sentence herself -> of course, I don't know in which order she did the changes, although I'd expect that she first moved and then edited the string.

Please also see the excerpt from the extracted document.xml from the docx-file. I posted with the bug (I anonymised the author in there). Unfortunately I cannot share the full document here.

Does that allow for an easier/clearer reproducible scenario?
Comment 6 Ruben 2017-01-04 16:32:45 UTC
To clarify further: the image I attached ("Clarification of the bug") shows a screenshot in Writer, of the file as I received it from the commenter. On top of showing the inline changed, it should have tracked the first sentence as a move.


Also, for whatever it is worth, I have prettified the xml from the docx file:

<!-- The first occurrence of the sentence, which is indeed marked as a move. -->

<w:moveFromRangeStart w:id="408" w:author="xxx" w:date="2016-12-08T15:50:00Z" w:name="move342831535" />
<w:moveFrom w:id="409" w:author="xxx" w:date="2016-12-08T15:50:00Z">
    <w:r w:rsidRPr="009D78DE" w:rsidDel="00347853">
        <w:rPr>
            <w:sz w:val="26" />
            <w:lang w:val="en-US" /></w:rPr>
        <w:t xml:space="preserve">It is unclear what is being measured. </w:t>
    </w:r>
</w:moveFrom>
<w:moveFromRangeEnd w:id="408" />

<!-- And somewhat later in the file... the second occurence, marked as a moveTo -->

<w:moveToRangeStart w:id="413" w:author="xxx" w:date="2016-12-08T15:50:00Z" w:name="move342831535" />
<w:moveTo w:id="414" w:author="xxx" w:date="2016-12-08T15:50:00Z">
    <w:del w:id="415" w:author="xxx" w:date="2016-12-08T15:50:00Z">
        <w:r w:rsidR="00347853" w:rsidRPr="009D78DE" w:rsidDel="00347853">
            <w:rPr>
                <w:sz w:val="26" />
                <w:lang w:val="en-US" /></w:rPr>
            <w:delText>It is unclear w</w:delText>
        </w:r>
    </w:del>
</w:moveTo>
<w:ins w:id="416" w:author="xxx" w:date="2016-12-08T15:50:00Z">
    <w:r w:rsidR="00347853">
        <w:rPr>
            <w:sz w:val="26" />
            <w:lang w:val="en-US" /></w:rPr>
        <w:t>W</w:t>
    </w:r>
</w:ins>
<w:moveTo w:id="417" w:author="xxx" w:date="2016-12-08T15:50:00Z">
    <w:r w:rsidR="00347853" w:rsidRPr="009D78DE">
        <w:rPr>
            <w:sz w:val="26" />
            <w:lang w:val="en-US" /></w:rPr>
        <w:t>hat is being measured</w:t>
    </w:r>
</w:moveTo>
<w:ins w:id="418" w:author="xxx" w:date="2016-12-08T15:50:00Z">
    <w:r w:rsidR="00347853">
        <w:rPr>
            <w:sz w:val="26" />
            <w:lang w:val="en-US" /></w:rPr>
        <w:t xml:space="preserve"> thus remains unclear</w:t>
    </w:r>
</w:ins>
<w:moveTo w:id="419" w:author="xxx" w:date="2016-12-08T15:50:00Z">
    <w:r w:rsidR="00347853" w:rsidRPr="009D78DE">
        <w:rPr>
            <w:sz w:val="26" />
            <w:lang w:val="en-US" /></w:rPr>
        <w:t>.</w:t>
    </w:r>
    <w:del w:id="420" w:author="xxx" w:date="2016-12-08T15:50:00Z">
        <w:r w:rsidR="00347853" w:rsidRPr="009D78DE" w:rsidDel="00347853">
            <w:rPr>
                <w:sz w:val="26" />
                <w:lang w:val="en-US" /></w:rPr>
            <w:delText xml:space="preserve"> </w:delText>
        </w:r>
    </w:del>
</w:moveTo>
<w:moveToRangeEnd w:id="413" />
Comment 7 Buovjaga 2017-01-05 10:34:40 UTC
Created attachment 130169 [details]
DOCX with a moved sentence and added stuff

Ok, with moving a sentence and adding stuff to it in the new location (all in MSO 2013) I confirm the duplication opening in LibreOffice.
Comment 8 Timur 2017-12-29 17:05:57 UTC Comment hidden (obsolete)
Comment 9 Alex Thurgood 2018-01-29 08:11:25 UTC Comment hidden (obsolete)
Comment 10 Buovjaga 2018-01-29 10:35:30 UTC
(In reply to Alex Thurgood from comment #9)
> (In reply to Timur from comment #8)
> > Looks like a duplicate of Bug 114305.
> > This one is older but the other one is clear.
> 
> Indeed. But both this bug and bug 114305 appear to be duplicates of bug 95357

But bug 95357 is not about DOCX.
Comment 11 Buovjaga 2018-01-29 10:35:45 UTC
*** Bug 114305 has been marked as a duplicate of this bug. ***
Comment 12 Buovjaga 2018-01-29 10:36:24 UTC
*** Bug 101580 has been marked as a duplicate of this bug. ***
Comment 13 Gabor Kelemen 2018-01-29 13:10:56 UTC
(In reply to Timur from comment #8)
> Looks like a duplicate of Bug 114305.
> This one is older but the other one is clear.

Thanks :).

Also, while we are at reproducing this: not only drag and drop creates these tags in Word, but Cut + Paste also. Which can be a more common use case I guess.
Comment 14 Commit Notification 2018-07-19 13:35:11 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=bcdebc832b272662d28035007a4796e42d1305ae

tdf#104797 DOCX change tracking: handle moveFrom and moveTo

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 15 Commit Notification 2018-07-20 11:00:13 UTC
László Németh committed a patch related to this issue.
It has been pushed to "libreoffice-6-1":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=04b53321ca56844521787563914fad21513fd58d&h=libreoffice-6-1

tdf#104797 DOCX change tracking: handle moveFrom and moveTo

It will be available in 6.1.1.

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 16 Timur 2018-07-23 13:07:27 UTC Comment hidden (obsolete)
Comment 17 opensuse.lietuviu.kalba 2018-07-23 13:45:03 UTC
Created attachment 143716 [details]
Screenshot of 6.1.1.0.0+ 2466ea26c4bef1e002a24f6845084633e5a058c4

I confirm that seems to be fixed in 

Version: 6.1.1.0.0+
Build ID: 2466ea26c4bef1e002a24f6845084633e5a058c4
CPU threads: 4; OS: Linux 4.4; UI render: default; VCL: x11; 
TinderBox: Linux-rpm_deb-x86_64@70-TDF, Branch:libreoffice-6-1, Time: 2018-07-21_22:43:36
Locale: lt-LT (lt_LT.UTF-8); Calc: group threaded
Comment 18 Timur 2018-07-24 09:11:18 UTC
We are speaking here about opening DOCX created in MSO, with moved tracked paragraph. 
Saving DOCX with tracked moves to DOC results in converting to deletions and insertions so this is DOCX-only. 

From what I see with this patch: 
LO lists the change in Manage Changes window.
LO marks the deleting of the moved text in original place.
LO marks the inserted text in new place.

What's missing - both for DOCX and ODT format:
Tooltip message with MovedFrom and MovedTo instead of current Deleted and Inserted.
"Action" in Manage Changes' List and Filter marked as MovedFrom and MovedTo.
User can accept or reject the change in one step.
Move action for text that is part of the paragraph.

But I guess it won't be dealt with here, because LO doesn't itself support move. Move issue is mentioned in Bug 95357.
Comment 19 Gabor Kelemen 2018-07-24 09:56:55 UTC
(In reply to Timur from comment #18)
> We are speaking here about opening DOCX created in MSO, with moved tracked
> paragraph. 
> Saving DOCX with tracked moves to DOC results in converting to deletions and
> insertions so this is DOCX-only. 
> 
> From what I see with this patch: 
> LO lists the change in Manage Changes window.
> LO marks the deleting of the moved text in original place.
> LO marks the inserted text in new place.
> 

Yes, this is a stopgap measure to convert the MovedFrom - MovedTo pair to delete - insert pair.

> What's missing - both for DOCX and ODT format:
> Tooltip message with MovedFrom and MovedTo instead of current Deleted and
> Inserted.
> "Action" in Manage Changes' List and Filter marked as MovedFrom and MovedTo.
> User can accept or reject the change in one step.
> Move action for text that is part of the paragraph.
> 
> But I guess it won't be dealt with here, because LO doesn't itself support
> move. Move issue is mentioned in Bug 95357.

I'd open a new enhancement bug for this feature, that one doesn't go anywhere regarding consensus :).
Comment 20 Timur 2018-07-27 09:17:25 UTC
Yes, new bug for move and close existing over-discussed.
As for this one, I guess it's done? To save a click, I'll close. 

I suggest this be added to https://wiki.documentfoundation.org/ReleaseNotes/6.1 as
* DOCX change tracking: handle moveFrom and moveTo {{tdf|104797}} (László Németh)
with example image.
Comment 21 opensuse.lietuviu.kalba 2018-07-28 06:14:07 UTC
I doubt whether it is appropriate include note about this bug in 6.1 release notes, if fix will not be present in LibreOffice 6.1.0 (as target is for subsequent LO 6.1.1 now)
Comment 22 Gabor Kelemen 2018-07-28 08:26:54 UTC
(In reply to opensuse.lietuviu.kalba from comment #21)
> I doubt whether it is appropriate include note about this bug in 6.1 release
> notes, if fix will not be present in LibreOffice 6.1.0 (as target is for
> subsequent LO 6.1.1 now)

Good point, yesterday I submitted a backport request for 6-1-0 branch:

https://gerrit.libreoffice.org/#/c/58193/

If this is accepted, we can go to the Release Notes :).
Comment 23 Commit Notification 2018-08-02 19:22:16 UTC
László Németh committed a patch related to this issue.
It has been pushed to "libreoffice-6-1-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=fe2fac02e81fb26969bf507e09aaf0bd7d5ca43b&h=libreoffice-6-1-0

tdf#104797 DOCX change tracking: handle moveFrom and moveTo

It will be available in 6.1.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 24 Gabor Kelemen 2018-08-02 21:56:46 UTC
(In reply to Timur from comment #20)
> I suggest this be added to
> https://wiki.documentfoundation.org/ReleaseNotes/6.1 as
> * DOCX change tracking: handle moveFrom and moveTo {{tdf|104797}} (László
> Németh)
> with example image.

Done, thanks:

https://wiki.documentfoundation.org/ReleaseNotes/6.1#General