Bug 80184 - FILESAVE: Exporting to docx loses comment contents.
Summary: FILESAVE: Exporting to docx loses comment contents.
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.0.0.3 release
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: interoperability
Keywords: bibisectRequest, dataLoss, regression
Depends on:
Blocks:
 
Reported: 2014-06-18 11:59 UTC by grotlek
Modified: 2015-12-17 08:24 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
The sample files demonstrating the bug (28.22 KB, application/gzip)
2014-06-18 11:59 UTC, grotlek
Details
The sample files demonstrating the bug (28.22 KB, application/gzip)
2014-06-18 12:05 UTC, grotlek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description grotlek 2014-06-18 11:59:20 UTC
Created attachment 101297 [details]
The sample files demonstrating the bug

I am using LibreOffice Writer to review a document which I'm storing in .odt format and all is working fine. As part of this, I am creating comments in the right-hand margin.

However I've come accross two issues which combined are preventing me from doing my job. One of them is clearly a fault in LibreOffice Writer, and hence the topic of this bug report. (I mention the second later as an aside, as it makes the discussed issue more serious).

When exporting my .odt file as an MS Word .docx file, the content of all comments is removed.

The fact that comments themselves exist is still kept - it is just the content of the comments that has completely vanished. 

I have reproduced this bug both on the Windows build 4.0.0.3 - downloaded from your website, AND on the current (as of today) Arch Linux build 4.2.4.2 - downloaded via Arch's "pacman" tool.

I have attached files which demonstrate this erroneous behaviour; and this has been reproduced by a user of the #libreoffice IRC room on FreeNode. The files I have attached are both the source .odt file, and the exported files both from the Windows 4.0.0.3 and the Arch Linux 4.2.4.2.

(This shows that the bug was not introduced in the recent changes to the docx code).


Now the aside: MS Office on the computer of the person for whom I'm reviewing the document also will not open these .odt files. The MS Office software claims that the .odt files are corrupt.

While I'm happy to accept that this is a bug in the handling of .odt files by MS Office, when combined with this issue it removes any hope of compatibility between the two products for performing document reviews. I am, in fact, as to a loss of how I am now going to do this review.
Comment 1 grotlek 2014-06-18 12:05:57 UTC
Created attachment 101298 [details]
The sample files demonstrating the bug
Comment 2 Mikko Ahlroth 2014-06-18 12:11:23 UTC
Can confirm with the attached documents on Ubuntu 14.04 with LO 4.2.3.3. Creating an empty document with a comment and saving it as DOCX preserves the comment. But saving the attached ODT as DOCX and opening it again shows the comment content has disappeared. Looking at the DOCX's comments.xml, there is no comment content present.

Changed version to 4.0.0.3 since it is the earliest confirmed.
Comment 3 grotlek 2014-06-18 12:28:08 UTC
If it helps, the .odt document attached was created by the following process:

1. I went and found some source text on wikipedia.
2. Selected and copied the text to the clipboard.
3. Opened LibreOffice Writer and pasted the text.
4. Selected a word to comment on, and used the "post-it" icon in the toolbar to add a comment.
5. Wrote my comment.
6. Saved the document as .odt file.
7. Saved the document again, this time as a .docx file.
8. Closed the document, re-loaded the .docx to confirm errant behaviour.

Unfortunately nothing even moderately complex in there. It does appear to be a simple bug.

To confirm on the second build of LibreOffice, I just loaded the .odt documend and repeated steps 7-8.

The original document I discovered this bug on is a large (but only text content) .rtf document, opened in LibreOffice and then re-saved as .odt to allow me to make the comments in the first place.

(I don't think any of this is particularly relevant; the bug seems to appear regardless of the way the document is constructed.. but it's better to have more information than risk missing something important that I might not consider relevant, I suppose!)
Comment 4 grotlek 2014-06-21 00:43:46 UTC
Checked (as requested in IRC):

When a document is created in LibreOffice and only plain text (no formatting etc) is added, Writer does seem to save the comments, including in the exported .docx.
Comment 5 Yousuf Philips (jay) (retired) 2014-06-21 06:20:10 UTC
Confirmed this on Linux Mint with 4.0.6, 4.1.6, 4.2.5 and 4.2.6. It doesnt happen in 3.6, 4.3 beta 2, or master. Seems as though the fix was added to 4.3 but not ported back to 4.2.
Comment 6 Joel Madero 2014-06-21 16:31:54 UTC
Miklos - I believe the commit below resolved this but wasn't put in 4.2, any way that we can squeeze it into 4.2.6? It's a pretty nasty bug.

http://cgit.freedesktop.org/libreoffice/core/commit/?id=cda6438cc2c9be0032a80910f7e903dd7775838c
Comment 7 David 2014-08-12 16:22:12 UTC
I'm also experiencing this bug (or a variant) in Version: 4.3.0.4 (Mint 13 LTS + Ubuntu 14.04, both) -

The DOCX document was half commented on and saved. Next day completed job (rest of document commented), saved (all in LibO Writer to DOCX format) but ONLY the comments saved in the first editing session will display; those from the second appear to be empty boxes.

Also, trying to open in Word 2010 in Win7 gives a "corrupt file" message, giving as the "detail": "No attribute name may appear more than once in the same start tag or empty element tag." > in `comments.xml`.

Since the xml is all one "line", trying to sort errors is problematic for me (tried to parse syntax using XML tools in Notepad++), and my skills don't go any farther.

Fortunately, all the *content* of my comments is still preserved in Word's `comments.xml` file, although they cannot be displayed owing to the xml errors.

I haven't experienced any problems with the comment feature sticking to ODT filetypes (not possible in this particular case).
Comment 8 Matt Price 2014-12-10 02:04:12 UTC
wondering if this is the same as https://bugs.freedesktop.org/show_bug.cgi?id=73221
Comment 9 Jorendc 2015-05-16 08:57:44 UTC
(In reply to Yousuf (Jay) Philips from comment #5)
> Confirmed this on Linux Mint with 4.0.6, 4.1.6, 4.2.5 and 4.2.6. It doesnt
> happen in 3.6, 4.3 beta 2, or master. Seems as though the fix was added to
> 4.3 but not ported back to 4.2.

I also fail to reproduce, tested using Linux Mint x64 with LibreOffice Version: 5.0.0.0.alpha1+
Build ID: f3070563c3071e05e9c448e261fec1e397bffb48
Locale: nl-BE (nl_BE.UTF-8)

(In reply to David from comment #7)
> I'm also experiencing this bug (or a variant) in Version: 4.3.0.4 (Mint 13
> LTS + Ubuntu 14.04, both) -
>
> Since the xml is all one "line", trying to sort errors is problematic for me
> (tried to parse syntax using XML tools in Notepad++), and my skills don't go
> any farther.
> 
> Fortunately, all the *content* of my comments is still preserved in Word's
> `comments.xml` file, although they cannot be displayed owing to the xml
> errors.

Can you please create a new bug report and attach the ODT and .docx file?

Marking this bug as RESOLVED WORKSFORME since we can't reproduce this particular case anymore.

Kind regards
Joren
Comment 10 Robinson Tryon (qubit) 2015-12-17 08:24:01 UTC
Migrating Whiteboard tags to Keywords: (DataLoss, bibisectRequest)
[NinjaEdit]