Bug 60789 - docx document content not shown, several pages missing
Summary: docx document content not shown, several pages missing
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.0.0.3 release
Hardware: All All
: medium major
Assignee: Michael Stahl (CIB)
URL:
Whiteboard: bibisected40 target:4.1.0 target:4.0.2
Keywords: regression
Depends on: 61000
Blocks:
  Show dependency treegraph
 
Reported: 2013-02-13 13:34 UTC by Moritz Moeller-Herrmann
Modified: 2013-02-26 09:35 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
File triggering the error (52.83 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2013-02-13 13:34 UTC, Moritz Moeller-Herrmann
Details
Correct PDF output from MSO2012 (288.76 KB, application/pdf)
2013-02-13 13:35 UTC, Moritz Moeller-Herrmann
Details
False output from LibreOffice 4.0 (51.43 KB, application/pdf)
2013-02-13 13:35 UTC, Moritz Moeller-Herrmann
Details
bibisect40 log (2.81 KB, text/plain)
2013-02-17 12:54 UTC, Jorendc
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Moritz Moeller-Herrmann 2013-02-13 13:34:13 UTC
Created attachment 74750 [details]
File triggering the error

When I open the attached document, libreoffice 4.0 (unlike previous versions, the problem seems absent in 3.6) shows only the very first of eight pages. Since not showing eight pages of content without any warning is a major issue, I consider this a critical regression, which should be fixed ASAP.

The problem seems to be triggered by the use of macro placeholders in the file (two fields to be filled in, whose content is then shown elsewhere in the document).
Comment 1 Moritz Moeller-Herrmann 2013-02-13 13:35:08 UTC
Created attachment 74751 [details]
Correct PDF output from MSO2012
Comment 2 Moritz Moeller-Herrmann 2013-02-13 13:35:53 UTC
Created attachment 74752 [details]
False output from LibreOffice 4.0
Comment 3 Jorendc 2013-02-17 12:44:59 UTC
I can confirm this behavior using Linux Mint 14 x64 with LibreOffice 4.0.0. Therefore I mark this as NEW. I can't test with latest master due Bug 61000. 

Following [1] I mark this bug as 'Major medium':
* Major: inability to open a document (correctly)
* medium, not high, because it CAN open but not complete

[1] https://wiki.documentfoundation.org/images/0/06/Prioritizing_Bugs_Flowchart.jpg
Comment 4 Jorendc 2013-02-17 12:53:22 UTC
This is a regression (see bibisect log).
Comment 6 Jorendc 2013-02-17 12:56:57 UTC
@Miklos, Michael: in the bibisectrange I see some commits to writer from both of you. As non-developer I can't determine which commit broke the fileopen of this kind of document.

Thanks for looking at this,
Kind regards,
Joren
Comment 7 Jan Holesovsky 2013-02-20 13:15:50 UTC
Joren: Thank you so much for the bi-bisect, I've found the offending commit thanks to that really quickly.  It is:

8c0a8d9db351fc05534d7552036889543f3a89d4 is the first bad commit
commit 8c0a8d9db351fc05534d7552036889543f3a89d4
Author: Miklos Vajna <vmiklos@suse.cz>
Date:   Thu Jul 12 11:07:41 2012 +0200

    writerfilter: read w:commentRangeStart and w:commentRangeEnd elements
    
    Change-Id: I8da1e43ffe6a78f14ab0901ae73c4ee39f1cbe44

:040000 040000 0452fd355fdeb88eb7f6706f6445f2f36e25515a 691a9668643be1565068c09eee33ebb5aa7c82bf M	writerfilter

Miklos: Can you please have a look?  Thank you!
Comment 8 Michael Stahl (CIB) 2013-02-20 14:43:20 UTC
i started looking at this yesterday, and the problem is that there
is a commentRangeStart in the document and immediately next is a text field,
and inserting the text field calls SwXTextCursor::setString()
which disposes the bookmark of the SwXTextRange that is stored as
m_aAnnotationPosition.m_xStart in writerfilter.

then inserting the annotation on the disposed text range throws;
the exception is easy to handle but then we're missing 2 of the
comments on the first page...
Comment 9 Not Assigned 2013-02-20 15:47:15 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=4c165c708ce852b4d52527422b327b2f6ad73685

fdo#60789: writerfilter: continue the import if comment insertion fails



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 10 Not Assigned 2013-02-20 15:47:35 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=6145c6efa4f346287ed9693c9d00038d829d5a35

fdo#60789: writerfilter: do not insert a character at field start



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 11 Not Assigned 2013-02-21 08:24:59 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-4-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=a09865cc0f177a28622330866b3ad5baf4b99bd6&h=libreoffice-4-0

fdo#60789: writerfilter: continue the import if comment insertion fails


It will be available in LibreOffice 4.0.2.

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 12 Not Assigned 2013-02-21 08:31:11 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-4-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=310b5976bb827a0ffb274f70878852e4474a0559&h=libreoffice-4-0

fdo#60789: writerfilter: do not insert a character at field start


It will be available in LibreOffice 4.0.2.

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 Jorendc 2013-02-21 08:32:44 UTC
Thank you Michael; I'll test tomorrow with daily builds (can't build today).
Comment 14 Moritz Moeller-Herrmann 2013-02-21 12:01:36 UTC
Thank you everyone, I am absolutely impressed by the responsiveness of libreoffice - with openoffice.org, many bugs I reported are still not worked on. Great job!
Comment 15 Jan Holesovsky 2013-02-26 09:35:06 UTC
I guess we can close the bug now :-)  Michael - thanks for the fix!