Bug Hunting Session
Bug 46020 - FILESAVE [DOC] [DOCX] Loss of footnotes when exporting to DOC- and DOCX- Files
Summary: FILESAVE [DOC] [DOCX] Loss of footnotes when exporting to DOC- and DOCX- Files
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Master old -3.6
Hardware: Other All
: medium critical
Assignee: Cédric Bosdonnat
URL:
Whiteboard: target:3.7.0 bibisected35 bibisected3...
Keywords: regression
Depends on:
Blocks: mab3.5
  Show dependency treegraph
 
Reported: 2012-02-14 01:11 UTC by ape
Modified: 2013-01-03 18:42 UTC (History)
9 users (show)

See Also:
Crash report or crash signature:


Attachments
test-file (458.58 KB, application/vnd.oasis.opendocument.text)
2012-02-14 01:11 UTC, ape
Details
The test file exported by LibreOffice 3.5.1 as DOC file (177.00 KB, application/msword)
2012-03-21 08:24 UTC, Roman Eisele
Details
console logs (12.90 KB, application/zip)
2012-05-04 11:35 UTC, Julien Nabet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ape 2012-02-14 01:11:48 UTC
Created attachment 57017 [details]
test-file

The program "LibreOffice Writer" for all versions, all operating systems.
The file "DOC-export footnote Error.odt" (see attachment) has lost a few footnotes when exporting to DOC-format:
 1. Open the file "DOC-export footnote Error.odt".
 2. File save as a text document "Microsoft Office 97-2003" - "DOC-export footnote Error.doc".
 3. Reload or reopen the file "DOC-export footnote Error.doc".
 The file "DOC-export footnote Error.doc" lost two footnotes to the file "DOC-export footnote Error.odt" contained on pages 15 and 16 (footnote 63, page 15; footnote 69, pages 16-17).
 This bug is not in the programs "OOo_3.1.1", "OOo-Dev_3.4beta" and "OOo-Dev_OOO340m1".
Comment 1 tester8 2012-02-14 01:37:32 UTC
Reproduced with

LibreOffice 3.5.0rc3
7e68ba2-a744ebf-1f241b7-c506db1-7d53735
Ubuntu 10.04.3 x86
Linux 2.6.32-38-generic Russian UI

It is not easy to see (footnote 63 disappears and 64 became 63) 

Bug doesn't appears in OOo 3.2.0 OOO320m12 (build:9483).
Comment 2 Björn Michaelsen 2012-03-01 08:05:54 UTC
Already reproducable with source-hash-d6cde02dbce8c28c6af836e2dc1120f8a6ef9932.

Regression does appear in oldest version of bibisect-3.5.tar.lzma and must be older.

Also that document get really messed up when being loaded from doc again (e.g. the page counts in the toolbar totally go bonkers)
Comment 3 Roman Eisele 2012-03-21 03:23:22 UTC
[Reproducible] with LibreOffice 3.5.1.2 (Build-ID: dc9775d-05ecbee-0851ad3-1586698-727bf66), German langpack installed, running on MacOS X 10.6.8 German. Footnote 63 disappears, footnote 64 becomes 64 (as said in commend #1), and also the long footnote 69 (beginning "Под «одной причиной» здесь понимается ...") disappears, therefore footnote 70 becomes 68.

Really important data loss.
Comment 4 Jean-Baptiste Faure 2012-03-21 05:45:44 UTC
The bug is already reproducible with LO 3.3.4 (vanilla version) under Ubuntu 11.10 x86_64.
Weird bug. Why these two footnotes and not the others?

Best regards. JBF
Comment 5 Roman Eisele 2012-03-21 07:43:22 UTC
If I try to open the DOC file exported by LibreOffice 3.5.1.2 with MS Word 2010, Word complains it could not open the document; "it is probably damaged". If I try the "Open and repair" feature of Word 2010, the result is the same (the document doesn't open, just the same alert appears). Only opening the file as a generic text file works, but then all formatting is lost.

IMHO this is a hint that the bug is on the export side, e.g. LibreOffice damages the data already when writing it in DOC file format, and not on the import side, e.g. when LibreOffice reads the DOC file in again.

Could someone experienced in reverse-engineering the DOC file format take a look at the DOC file produced by LibreOffice from ape's sample document? Maybe this will give some ideas how exactly the data is damaged and how to fix this bug.
Comment 6 ape 2012-03-21 08:02:14 UTC
(In reply to comment #5)
> If I try to open the DOC file exported by LibreOffice 3.5.1.2 with MS Word
> 2010, Word complains it could not open the document; "it is probably damaged".
> If I try the "Open and repair" feature of Word 2010, the result is the same
> (the document doesn't open, just the same alert appears). Only opening the file
> as a generic text file works, but then all formatting is lost.
 
Word-2010 does not work with ODT_v.1.2 (1.1 - only).

> Could someone experienced in reverse-engineering the DOC file format take a
> look at the DOC file produced by LibreOffice from ape's sample document? Maybe
> this will give some ideas how exactly the data is damaged and how to fix this
> bug.

AOO_Writer-3.4.0 is saving as "DOC" this file without errors.
Comment 7 Roman Eisele 2012-03-21 08:23:02 UTC
(In reply to comment #6)
> > If I try to open the DOC file exported by LibreOffice 3.5.1.2 with MS Word
> > 2010, Word complains it could not open the document; "it is probably damaged".
> > If I try the "Open and repair" feature of Word 2010, the result is the same
> > (the document doesn't open, just the same alert appears). Only opening the
> > file as a generic text file works, but then all formatting is lost.
> 
> Word-2010 does not work with ODT_v.1.2 (1.1 - only).

Right, but please read carefully: I did NOT try to open your original OTD file with MS Word 2010. I tried to open the DOC file (produced by LibreOffice 3.5.1 by opening your ODT file and saving it as "Microsoft Office 97-2003" file) with MS Word 2010. And MS Word should open a DOC file, of course ;-) Therefore, there IS something wrong with the DOC export produced by LibreOffice.

I will attach the DOC produced by LibreOffice 3.5.1 file to this bug report.
Comment 8 Roman Eisele 2012-03-21 08:24:37 UTC
Created attachment 58822 [details]
The test file exported by LibreOffice 3.5.1 as DOC file
Comment 9 Roman Eisele 2012-04-02 01:53:57 UTC
Just for your information:

As a simple user, I had the idea that some minor file format errors in our sample ODT document would be a possible explanation for the loss of footnotes etc. (e.g., think of  Therefore, I tried the ODF valiador at http://odf-validator.rhcloud.com/ to see if it finds some errors in our sample ODT document.

Result: The validator reports some warnings and an error, but no one of the listed problems seems related to footnote stuff or to the real (text) contents at all. It's a pitty ...
Comment 10 Joachim Wiedorn 2012-05-02 08:19:53 UTC
I have tested with LO 3.4.6:

a) opening the test-file .odt and save as .doc: all footnotes are visible!
b) opening the exported test-file .doc:  all footnotes are visible!
Comment 11 Roman Eisele 2012-05-02 09:38:47 UTC
(In reply to comment #10)
> I have tested with LO 3.4.6:
> 
> a) opening the test-file .odt and save as .doc: all footnotes are visible!
> b) opening the exported test-file .doc:  all footnotes are visible!

This would be great, but: are you sure? The problem is not easy to see (cf. comment #1 and comment #3). Do you see all 75 footnotes (the last one, #75, is placed near the headline of the comparative table right before the bibliography)?

For me, the problem is still present with LibreOffice 3.4.6 (German UI, on MacOS X 10.6.8): if I open the ODT file, save it as .doc file, close the .doc file and open it again, the same two footnotes (#63, #69) are missing and therefore only 73 footnotes total left.

PS: Which operating system did you use for your test (please mention this always, as it often makes a difference)? Which version? Which LibreOffice language/UI?
Comment 12 ape 2012-05-02 09:59:20 UTC
(In reply to comment #11)
> (In reply to comment #10)
> > I have tested with LO 3.4.6:...
> 
> PS: Which operating system did you use for your test (please mention this
> always, as it often makes a difference)? Which version? Which LibreOffice
> language/UI?

Joachim Wiedorn was wrong. This bug is an error filter and does not depend on the OS or the LibO's version, including "3.6.0rc0".
------------
 P.S. Things are even worse, if you save "test.odt" as "test.docx". You will lose these two footnotes and the text of several other footnotes (number ~54 and next). But it's another bug which may be created.
Comment 13 Joachim Wiedorn 2012-05-02 13:14:06 UTC
bugzilla-daemon@freedesktop.org wrote on 2012-05-02 16:38:

> This would be great, but: are you sure? The problem is not easy to see (cf.
> comment #1 and comment #3). Do you see all 75 footnotes (the last one, #75, is
> placed near the headline of the comparative table right before the
> bibliography)?

I have tested it again and now I see the same failure also in version
3.4.6 - unfortunately!

> PS: Which operating system did you use for your test (please mention this
> always, as it often makes a difference)? Which version? Which LibreOffice
> language/UI?

Debian 6.0 (Squeeze) + kernel 2.6.32 (64bit) using XFCE (gtk)
LibreOffice 3.4.6 for GNU/Linux (64bit)

---
Have a nice day.

Joachim (Germany)
Comment 14 Julien Nabet 2012-05-04 11:35:50 UTC
Created attachment 61043 [details]
console logs

I reproduced the problem on Debian x86-64, master updated today.
I attached the logs from the opening until the closing.
Comment 15 sasha.libreoffice 2012-06-03 23:58:38 UTC
*** Bug 42768 has been marked as a duplicate of this bug. ***
Comment 16 ape 2012-07-28 04:13:11 UTC
 ODT-file is saved as DOCX-file (see https://bugs.freedesktop.org/attachment.cgi?id=64811). These two footnotes (63 and 68, the numbering of the footnotes to the original file) is also lost and are not shown on the display.
 I think the reason is found in the file "DOC-export_footnote_Error.docx:\word\footnotes.xml":
 - Footnote number 63 (the original), and number 68 (the original) do not have their "id";
 - Text of the footnote is present.
--
P.S. DOCX-file only opens Libre Writer. Created separate reports of other bugs of this file.
Comment 17 Cédric Bosdonnat 2012-08-01 13:43:04 UTC
(In reply to comment #16)
>  ODT-file is saved as DOCX-file (see
> https://bugs.freedesktop.org/attachment.cgi?id=64811). These two footnotes (63
> and 68, the numbering of the footnotes to the original file) is also lost and
> are not shown on the display.
>  I think the reason is found in the file
> "DOC-export_footnote_Error.docx:\word\footnotes.xml":
>  - Footnote number 63 (the original), and number 68 (the original) do not have
> their "id";
>  - Text of the footnote is present.
> --
> P.S. DOCX-file only opens Libre Writer. Created separate reports of other bugs
> of this file.

Could you add the related bugs you created around this one? I'm pretty likely to fix them all: I found two malformed ooxml issues with that document.
Comment 18 Cédric Bosdonnat 2012-08-02 08:19:56 UTC
(In reply to comment #16)
> P.S. DOCX-file only opens Libre Writer. Created separate reports of other bugs
> of this file.

See bug 52610
Comment 20 Not Assigned 2012-08-03 07:58:15 UTC
Cedric Bosdonnat committed a patch related to this issue.
It has been pushed to "libreoffice-3-6":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=108f7a5aa75e3f35b6fa57af402a1e903fefea24&g=libreoffice-3-6

fdo#46020: fixed missing footnote docx/doc/rtf export


It will be available in LibreOffice 3.6.1.
Comment 21 Roman Eisele 2012-08-03 12:52:54 UTC
(In reply to comment #19)
> Fixed in master

@Cédric:
Thank you very much for fixing this issue! This was definitely one of the most insidious software bugs I have seen ever ...
Comment 22 Not Assigned 2012-08-06 14:02:24 UTC
Cedric Bosdonnat committed a patch related to this issue.
It has been pushed to "libreoffice-3-5":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=2e395b785b1d22922572e94f480a5f581027f9de&g=libreoffice-3-5

fdo#46020: fixed missing footnote docx/doc/rtf export


It will be available in LibreOffice 3.5.7.
Comment 23 Not Assigned 2012-08-07 15:30:30 UTC
Cedric Bosdonnat committed a patch related to this issue.
It has been pushed to "libreoffice-3-5-6":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=27d77a6e6f4959cd1781c2e78b4a957ed63e290f&g=libreoffice-3-5-6

fdo#46020: fixed missing footnote docx/doc/rtf export


It will be available already in LibreOffice 3.5.6.
Comment 24 Roman Eisele 2012-08-18 09:25:49 UTC
VERIFIED FIXED with
* LibreOffice 3.5.6.2 (Build ID: e0fbe70-dcba98b-297ab39-994e618-0f858f0)
* LibreOffice 3.6.1.1 (Build ID: 4db6344)
both with German langpack installed and on MacOS X 10.6.8 (Intel).

Now all 75 footnotes are exported to .doc file format.

Thank you very much again for fixing this!
Comment 25 Jason Briggeman 2013-01-03 03:57:48 UTC
I am currently experiencing this bug with LibreOffice 3.6.0.2 - is that to be expected, i.e., was this bug not fixed for this version? (I am operating with Ubuntu 12.04 and LO 3.6.0.2 is the version just rolled out to me by the PPA.)
Comment 26 Julien Nabet 2013-01-03 06:49:19 UTC
Jason: you're with 3.6.0.2, target is 3.6.1 (for 3.6.X). So it's normal.
Do you use LibreOffice ppa?
You can also uninstall Libreoffice packages and retrieve .deb from Libreoffice website.
Comment 27 Jason Briggeman 2013-01-03 18:42:34 UTC
Thanks, Julien. I uninstalled the packages and then went with the 3.5.x PPA, which provided me with the 3.5.7 version and the footnote bug is indeed fixed!