Bug 89991 - Save ODT as DOCX turns on Show Changes when Record Changes also on
Summary: Save ODT as DOCX turns on Show Changes when Record Changes also on
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: filters and storage (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: Other All
: high normal
Assignee: Not Assigned
URL:
Whiteboard: target:6.4.0 target:6.3.0.1
Keywords: filter:docx, implementationError
: 98400 (view as bug list)
Depends on: 104023
Blocks: Track-Changes DOCX-Track-Changes
  Show dependency treegraph
 
Reported: 2015-03-13 14:15 UTC by Timur
Modified: 2021-02-02 07:15 UTC (History)
12 users (show)

See Also:
Crash report or crash signature:


Attachments
Save as DOCX turns on Show Changes when Record Changes also on (19.20 KB, text/odt)
2015-03-13 14:15 UTC, Timur
Details
hideTrackChanges.patch: proof of concept patch for using revisionView insDel for import (2.31 KB, patch)
2019-06-11 10:25 UTC, Justin L
Details
tdf89991_hideTrackedChanges_insDel-false.docx: test document containing revisionView insDel=false (5.48 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2019-06-11 10:47 UTC, Justin L
Details
hide2010RT.docx: MSO2010 saved using "revisionView markup=0" for review - final (WITHOUT markup) (13.86 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2019-06-13 06:05 UTC, Justin L
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Timur 2015-03-13 14:15:25 UTC
Created attachment 114078 [details]
Save as DOCX turns on Show Changes when Record Changes also on

Steps to reproduce:

1) Open a file in Writer, add some lines; save as .odt and close.
2) Re-open file. Turn on Edit/Changes/Show (should already be on) and Edit/Changes/Record. Save and close
3) Re-open file. Make some edits, then turn off Edit/Changes/Show but leave Edit/Changes/Record on. Save and close.
4) Re-open file. Save as .docx, then close.
5) The .docx will show all the changes.

OR save the attachment as DOCX and reopen.

Similar problem is also with Calc. This can be reproduced from LO 3.3.0.4.
Comment 1 A (Andy) 2015-03-13 22:11:21 UTC
Reproducible with LO 4.4.1.2, Win 8.1
Comment 2 tommy27 2015-06-18 20:36:07 UTC
still reproducible with LO 4.4.3.2 an 5.1.0.0 alpha (Win 8.1 x64)
Comment 3 Buovjaga 2015-10-09 05:58:45 UTC
*** Bug 94479 has been marked as a duplicate of this bug. ***
Comment 4 Timur 2015-10-12 06:40:42 UTC
*** Bug 94832 has been marked as a duplicate of this bug. ***
Comment 5 Andrew Wetmore 2015-10-20 18:05:04 UTC
*** Bug 95139 has been marked as a duplicate of this bug. ***
Comment 6 mike.linux 2015-10-21 18:31:49 UTC
Another variant of this issue is:
When editing a DOCX document with Record Changes ON and Show Changes OFF, when I save the document (CTRL+S), the Show Changes automatically switches back ON by itself (displaying ALL the changes, which is VERY distracting). (From bug 94832). 
I would like Show Changes to remain OFF after saving the document. 
This does NOT occur when working with ODT documents.
I'm a technical content editor and I use this way of working VERY often. 
Thanks for your help. Regards.
Comment 7 sdc.blanco 2016-04-29 09:29:06 UTC
I can confirm the behavior described in Comment 6 with LO 5.1.2.2 and Windows
Comment 8 Stefano 2016-05-18 04:58:48 UTC
Confirming the bug on 5.1.2.2 on Linux 64 bit.
Comment 9 clarinet 2016-07-03 20:11:41 UTC
Confirmed bug still present in 5.1.4.2 Mac (OSX 10.11.5).
Comment 10 Justin L 2016-11-19 16:35:59 UTC
Question: is it possible in Microsoft Word to save the file with the various reviewing option retained?  I just tried in Word 2003 and Word 2013 saving with "simple markup", "all markup", "No Markup" and "Original". Each one opened up in "all markup" mode - so AFAICS, the answer is no.

If MS can't do it, I'm not sure if there is any precedence for adding LO specific settings in the .docx format.  Likely this bug should be marked as WONTFIX.

Show changes is enabled in LO for .docx because:
DocumentRedlineManager::DocumentRedlineManager( SwDoc& i_rSwdoc ) : meRedlineFlags(RedlineFlags::ShowInsert | RedlineFlags::ShowDelete),

and because the document has no setting to disable this default-on behaviour, markup is always shown when the document loads.
Comment 11 Timur 2016-11-23 16:52:43 UTC Comment hidden (obsolete)
Comment 12 Justin L 2016-11-25 10:21:21 UTC
Timur - try again and verify that this is not an APPLICATION level setting in MSO.  I just tried MSO2013 and it always used the last-used-setting for a new document - including ones created by LO.  So, I got simple-markup when opening up a LO track-changes document when that was the setting from the last time Word shutdown.  (Please attach an example .docx if you find one that forces simple markup.)
Comment 13 Timur 2016-11-28 14:44:20 UTC
Justin, I don't see what you mean, sorry.

First you wrote for Word 2013 saving: "Each one opened up in all markup mode", but I wrote "All markup, No Markup and Original opened up in all markup, but when saved with simple markup it also opened up with that", then you wrote "MSO2013 used the last-used-setting for a new document, I got simple-markup when opening up a LO track-changes document when that was the setting from the last time Word shutdown."
Comment 12 seems to be contrary to points 1 and 2 from Comment 11. Could you please comment point-by-point on my Comment 11, what you can confirm and what not?

Options can be set in MSO per https://support.microsoft.com/en-us/kb/831771 in "Options-Trust Center-Trust Center Settings-Privacy Options-Make hidden markup visible when opening or saving", it that's the one you're referring to, but I didn't change them, it's checked in my case, I guess it's default setting.
Comment 14 Timur 2016-11-28 15:01:45 UTC
As an additional thought: 
Previous link says "when you open a document that contains tracked changes, the document appears in the Final Showing Markup view to indicate that the document contains tracked changes. This behavior is by default."
But it still needs to be explained why this happens only with DOCX and not DOC and why it happens in LO only when Record on. MSO doesn't seem to depend on whether Track Changes is on, just if there are tracked changes in the document.

It seems to me there are 2 options, please correct:
- to simply treat this as WontFix, as suggested in Comment 10, because LO doesn't have Simple markup and Show changes (off) is like All markup (No markup), which is consistent with MSO behavior 
- to keep this as New, as suggested in Comment 11, by saving DOCX with Show changes off like Simple markup, which is consistent with LO behavior for saving and opening DOCX and DOC
Comment 15 Justin L 2016-11-28 18:50:55 UTC
(In reply to Timur from comment #13)
> Justin, I don't see what you mean, sorry.

Try this in MSO: enable track changes, set All Markup mode, make some change and save. Now, switch the view to Simple markup and then exit Word *without* saving.  Restart word and open the document.  I expect that it will be in Simple markup mode, not All Markup.  Please confirm.

Then do the reverse.  Save some changes in the document while in simple markup mode.  Switch to All markup, restart without saving, and it will open in All markup mode.  So the mode it opens is NOT related to the document itself, but the last mode that MSO was in.

The same should be true with an LO saved documents. If I'm wrong, please provide a proof document.
(My always-in-All-Markup-mode observation in comment 10 should be discarded as poor testing. Comment 11 forced me to retest more thoroughly.)

So a possible solution then is to save the last-selected setting for "show changes" in the user profile - and use that as the default instead of the current default of "show changes". Then it would apply to every format (not just docx) that does not save this setting inside of the document itself. This user-profile setting probably should *not* apply to new documents - in that case show changes should still be the default, so that when track changes is enabled, the changes will be shown automatically.
Comment 16 Timur 2016-11-28 19:40:56 UTC
I see now, looks like you're right for the last mode that MSO was in when it was closed. Although I don't know whether such option exists in MSO. 

I think that (LO way?) saving the mode in the file is better than app mode.
That could be controlled with some option, like MSO's "Make hidden markup visible when opening or saving" but (unlike MSO which has it checked or not) with: Always, Never, As saved in the document. 
This or what you proposed, should be a new bug (although it's related to Bug 104006).

But I still don't understand why this bug happens in LO on RT, as in Description, only when Record is on, and only with DOCX.
Comment 17 Peter Lemkin 2016-11-29 06:00:57 UTC
As I am an editor, these are very annoying problems. However, another related problem has been ignored. There is NO way one can TELL the status of record changes vs. record changes being turned off. There is a red circle and I imagine the idea was to have it turn green when 'on', but it NEVER changes and one has to change it and test to find out. The exact same problem for show changes vs. do not show changes. Again, as an editor, these are some of the more important settings. Only by shifting between the two a few times can I tell and I have edited papers thinking the tracking changes was on, when it was not and causing me a great problem.
Comment 18 Justin L 2016-11-29 07:39:04 UTC
Based on my testing, the following formats in LO (inherited from OOo) apparently save the "show changes" status inside the document itself: .odt, .doc, .ods

The formats that support track changes, but do not retain the "show status" setting in LO are: .docx, .rtf, .uot,     .xls, .xlsx, .uos.

In MSO2013 Excel, show changes is always off (.xlsx, .xls) but turns on for "any changes since the last save" as soon as you browse through the "highlight changes" wizard.

In MSO2013 Word: for both .doc and .docx format, the "show changes" setting is not saved inside of the document, but the last-used-state is saved in the user profile - either simple markup or all markup.  (In Word 2003/2007 there is no simple markup option and it always opens in show-final-with-markup mode, so for .doc, either LO adds a custom setting, or MSO no longer honours an existing setting.)
Comment 19 Timur 2016-11-29 09:22:55 UTC
@Peter:
* "status of record changes vs. record changes being turned off" - from 5.2 there's Show Track Changes Bar toolbar button, which should be turned on, and then you can see Show and Record status (I used to add and keep those button in the toolbar manually before, and 5.1 had Record button visible by default)
* "There is a red circle and I imagine the idea was to have it turn green when 'on" - if you're referring to Record Changes button, it's pressed when turned on, which is quite fine, no need for color change
* "same problem for show changes vs. do not show changes" - same solution, just keep the buttons in the toolbar, they are pressed when in use. 
As you said, it's an off-topic discussion, so we should not proceed on this here.
Comment 20 Timur 2016-11-29 09:26:09 UTC
@Justin: could you formulate a solution?

Personally, I'm not in favor of "save last-used-state in the user profile" approach. 
Could we proceed (for docx and maybe xlsx in this bug) with this "save the status inside the document" for all types?
Could we add a related option (in another bug) "Make tracked changes visible when opening or saving" with: Show Changes, Note Changes, No Changes, As Saved in the Document. 

Should we also add something like "note changes" (aka "simple markup"), that should show only (the already existing) line aside to changes (but changed from black to red color) and change Show Changes button to drop-down with Show Changes and Note Changes? This is a separate bug but I'd like you to confirm before I submit it.
Comment 21 Mike Kaganski 2017-04-24 06:20:44 UTC
(Just to sort things):

A number of bugs (namely, bug 94479, bug 95139, bug 94832), as well as comment 6 here, mention a different problem: the Show Changes status changes on Save, not on reload. This is really different, because this shouldn't depend on either last used or saved in document option, and this is a flaw of the saving process. So, I believe that marking some of them as duplicate of this one is wrong, and should be tracked separately. I am not sure if this is still reproducible, though, because all mentions of that known to me are limited to 5.1.x and earlier, including e.g. https://ask.libreoffice.org/en/question/58105
Comment 22 Justin L 2017-04-25 05:54:14 UTC
(In reply to Mike Kaganski from comment #21)
> A number of bugs (namely, bug 94479, bug 95139, bug 94832), as well as
> comment 6 here, mention a different problem: the Show Changes status changes
> on Save, not on reload. I am not sure if
> this is still reproducible, though, because all mentions of that known to me
> are limited to 5.1.x and earlier.

These were fixed in 5.3 master (documented in bug 97103), and backported to 5.2.0.

Thanks to author Michael Stahl 2016-06-08 10:31:06 (GMT)
commit: a59c4e26abbdd0720d24d3ddc0d6a05a67a31aaf
tdf#97103 sw: fix restoring of SetRedlineMode on DOCX/RTF export
Comment 23 Justin L 2018-08-23 18:41:48 UTC
*** Bug 98400 has been marked as a duplicate of this bug. ***
Comment 24 Justin L 2019-06-10 13:45:41 UTC
So how does DOC do it?   For export:
    pDop->fRMView = pLayout == nullptr || !pLayout->IsHideRedlines();
    pDop->fRMPrint = pDop->fRMView;

and for import:
    isHideRedlines = !m_xWDop->fRMView;
    m_rDoc.GetDocumentRedlineManager().SetHideRedlines(isHideRedlines);

Possibly, this is the comparable setting for DOCX???
<w:revisionView w:insDel="true" />

However, if I add this to a DOCX file, then MSWord shows the changes regardless of the setting, so either it means something different, or it doesn't work for Word 2010/2003.  In a Microsoft context, someone else also thought it SHOULD show track changes, but also found that it didn't. https://stackoverflow.com/questions/47030234/show-reviewing-pane-in-word-client-by-default

2.14.1.69
revisionView (Visibility of Annotation Types)
This element specifies which forms of annotations shall be visible for a WordprocessingML document when it is displayed. This setting shall not affect whether annotations are added or persisted, it shall only affect the display of the annotations which exist in the document's contents (persisted or in memory). If this element is omitted, then all forms of annotations shall be visible.

insDel (Display Content Revisions)
Specifies if revisions to content (i.e. insertions, deletions, and moves) should be included when the contents of this document are displayed. If this attribute is omitted, then insertions, deletions, and moves shall be displayed when annotations are visible based on application-level settings. [Example: Consider the WordprocessingML below specifying that insertions, deletions, and moves shall be displayed: <w:revisionView w:insDel="true" /> The insDel attribute has a value of true, specifying that insertions, deletions, and moves shall be rendered when the document's annotations are displayed.
Comment 25 Justin L 2019-06-11 10:25:27 UTC
Created attachment 152096 [details]
hideTrackChanges.patch: proof of concept patch for using revisionView insDel for import

(In reply to Justin L from comment #24)
>  <w:revisionView w:insDel="true" />
If this is supposed to manage "Show Tracked Changes", then the attached import patch almost works. Unfortunately, it permanently disables the viewing of track changes, so it only serves as a code-pointer.
Comment 26 Justin L 2019-06-11 10:47:30 UTC
Created attachment 152097 [details]
tdf89991_hideTrackedChanges_insDel-false.docx: test document containing revisionView insDel=false
Comment 27 Justin L 2019-06-11 17:37:32 UTC
(In reply to Justin L from comment #25)
> Unfortunately, it permanently disables the viewing of track changes
The likely cause for it being difficult to simply manage show/hide is:
commit 2dda396f4de051cccf3442f17c84bf2ff5d1db1d
Author: Michael Stahl
Date:   Tue Jan 8 13:32:05 2019 +0100
    tdf#122452 sw_redlinehide: WW8 import/export sets layout show/hide mode
    ... and not SetRedlineFlags(), similar to the way the ODF filter does it.
    
    The RTF/DOCX filters don't appear to be able to export the show/hide
    flag currently, they can only handle the enabled flag.
Comment 28 László Németh 2019-06-12 12:09:35 UTC
Proposed fix: https://gerrit.libreoffice.org/#/c/73885/

@Justin: I'm sorry, I have just seen, that you attached a patch, too. I was asked to check your comment a day before yesterday. You were right, we have to use SetHideRedlines here, too. But we have to use also the Show Changes mode during the import. Thanks for your help!

@All: thanks for your help!
Comment 29 Commit Notification 2019-06-12 19:01:03 UTC
László Németh committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/0e27158c4f6a6a7676a77afb6b37dd30b3f6d100%5E%21

tdf#89991 DOCX: import/export Show changes mode

It will be available in 6.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 30 Justin L 2019-06-13 05:42:39 UTC
(In reply to László Németh from comment #28)
> @Justin: I'm sorry, I have just seen, that you attached a patch, too.
No problem. I never assigned the bug to myself and didn't have the knowledge needed to take my ideas to completion. So I'm glad you took over.

Valuable information from your commit message: documents exported from MSO with DISABLED Show Changes and DISABLED Options -> Trust Center -> Trust Center Settings -> Privacy Options -> Make hidden markup visible when opening or saving. (Note: this last setting is also needed for MSO obeying the document's settings in order to open in "Final" mode without markup).
Comment 31 Justin L 2019-06-13 06:05:37 UTC
Created attachment 152149 [details]
hide2010RT.docx: MSO2010 saved using "revisionView markup=0" for review - final (WITHOUT markup)
Comment 32 Commit Notification 2019-06-13 14:47:38 UTC
László Németh committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/8b3c861c46ae12d21b7b3a550e2daa21d2006b77%5E%21

tdf#89991 DOCX: import Show changes from older formats

It will be available in 6.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 33 Commit Notification 2019-06-18 12:09:54 UTC
László Németh committed a patch related to this issue.
It has been pushed to "libreoffice-6-3":

https://git.libreoffice.org/core/+/0620ccd4dc5422f8d3253c7b044a16043b00da35%5E%21

tdf#89991 DOCX: import/export Show changes mode

It will be available in 6.3.0.1.

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 34 Commit Notification 2019-06-18 13:35:32 UTC
László Németh committed a patch related to this issue.
It has been pushed to "libreoffice-6-3":

https://git.libreoffice.org/core/+/d56be0923966deab3f49bc460a5d233d1301430f%5E%21

tdf#89991 DOCX: import Show changes from older formats

It will be available in 6.3.0.1.

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.