Created attachment 48812 [details] Example where the extra blank page is visible See attached example.rtf It contains of 3 pages, but there will 4 in libreoffice (the last one being blank). In for example MS Office there will be 3 displayed. I have modifed the example, see example_modified.rtf, and removed the last \sect and then only 3 pages are displayed. but the problem here is libreoffice and not the documents as far as I can tell, I have the same problem with all rtf documents
Created attachment 48813 [details] The last "\sect" is removed, then no extra blank page is visible
If I open example.rtf with LO 3.5.0 beta-1 I get indeed 4 pages. But, if I create a text document with 2 pages in ODF format and then save this doc as RTF file, I get 2 pages as expected when I reopen the RTF file. I do not have MS-Office to test a document produced by MS-Word in RTF format. @Ron: please provide a description step by step how you produced this RTF file. Side notes: 1/ Abiword 2.5.8 see only one page; it does not detect or handle the page break 2/ In my RTF file I do not see any \sect nor \sbkpage Best regards. JBF
[This is an automated message.] This bug was filed before the changes to Bugzilla on 2011-10-16. Thus it started right out as NEW without ever being explicitly confirmed. The bug is changed to state NEEDINFO for this reason. To move this bug from NEEDINFO back to NEW please check if the bug still persists with the 3.5.0 beta1 or beta2 prereleases. Details on how to test the 3.5.0 beta1 can be found at: http://wiki.documentfoundation.org/QA/BugHunting_Session_3.5.0.-1 more detail on this bulk operation: http://nabble.documentfoundation.org/RFC-Operation-Spamzilla-tp3607474p3607474.html
In our case we create the RTF with Apache FOP, see <https://issues.apache.org/bugzilla/show_bug.cgi?id=51484>. We can work-around the issue there, but according to my understanding of the spec that I found at <http://www.biblioscape.com/rtf15_spec.htm#Heading27>, this seems to be a problem in LibreOffice.
Dear bug submitter! Due to the fact, that there are a lot of NEEDINFO bugs with no answer within the last six months, we close all of these bugs. To keep this message short, more infos are available @ https://wiki.documentfoundation.org/QA/NeedinfoClosure#Statement Thanks for understanding and hopefully updating your bug, so that everything is prepared for developers to fix your problem. Yours! Florian
reproduced in 3.6.1 on Fedora 64 bit. First attachment in Writer has 4 page. In msWord 2003 for comparison number of pages is 3.
on pc Debian x86-64 with master sources updated today, I reproduced this. Miklós: is it invalid there's a final sect in the rtf file or should import rtf part in LO be fixed?
If the file isn't invalid, here's a proposed patch: diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index 7c4f545..ce3aeb5 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -506,7 +506,13 @@ void RTFDocumentImpl::sectBreak(bool bFinal = false) bool bNeedSect = m_bNeedSect; // If there is no paragraph in this section, then insert a dummy one, as required by Writer if (m_bNeedPar) + { + // sometimes the rtf file has \sect at the end (see fdo#39001) + // in this case, there shouldn't be a new page + if (bFinal) + return; dispatchSymbol(RTF_PAR); + } // It's allowed to not have a non-table paragraph at the end of an RTF doc, add it now if required. if (m_bNeedFinalPar && bFinal) {
The patch was wrong, sorry guys. Hopefully Miklos pinpointed this.
Miklos Vajna committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=4108f285207ed4a60c8876a8206bc5f2d7f05620 fdo#39001 RTF import: fix fake empty page at the end of the doc 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.
-4-1 review: https://gerrit.libreoffice.org/4737
Miklos Vajna committed a patch related to this issue. It has been pushed to "libreoffice-4-1": http://cgit.freedesktop.org/libreoffice/core/commit/?id=5430b9e0f4082025ff9bf7621d18292db0361121&h=libreoffice-4-1 fdo#39001 RTF import: fix fake empty page at the end of the doc It will be available in LibreOffice 4.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.