diff options
author | Michael Stahl <mstahl@redhat.com> | 2014-02-27 23:48:59 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-03-03 10:31:30 -0600 |
commit | 153993292cc9f11fed8fcba8de45b0c46d5e0ef2 (patch) | |
tree | 772310769244edceee186f784b51230598278472 /writerfilter/source/rtftok/rtfdocumentimpl.hxx | |
parent | cb83b334e489a4ec1cc067145c3f64b129475e7f (diff) |
RTF import: fix spurious page breaks at doc end (related: rhbz#1065629)cp-4.2-branch-point
When a document ends with \sect it's possible that a spurious page break
is created. In fact the spurious page break is always created by the
RTF importer, sometimes it is deleted again by
DomainMapper_Impl::RemoveLastParagraph() and sometimes not.
It is created because on the final \sect RTFDocumentImpl::sectBreak()
still calls startSectionGroup(), and the popState() for the \rtf1 group
then calls sectBreak() another time.
To prevent this, do not call startSectionGroup() from sectBreak() but
instead from setNeedSect(), and ensure that it is called as soon as
anything after \sect is read.
One unit test fails because the \page is not handled properly: the
conversion to \skbpage \sect \skbnone is not correct, because the \skb*
keywords are an exception and affect the \sect that precedes them, not
the following one; sending the \skbpage later unfortunately requires
additional cleanup later.
(cherry picked from commit e3f254ab8211fbab7541cde2100a35c875b0c240)
RTF import: add unit test for page break in continuous section
(cherry picked from commit f03218f43e8c25c2e136d364455f3cdaf95362b6)
RTF import: fix paragraphs in header/footer
(cherry picked from commit 74b3f4f00766d199df3b017d056cf7a00ae52988)
Change-Id: I3c1a3bceb2c8b75bbecdc748170562451ce5f5c3
Reviewed-on: https://gerrit.libreoffice.org/8439
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'writerfilter/source/rtftok/rtfdocumentimpl.hxx')
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.hxx | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.hxx b/writerfilter/source/rtftok/rtfdocumentimpl.hxx index 932ec4689f7c..fa1f3d672c2e 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.hxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.hxx @@ -524,6 +524,9 @@ namespace writerfilter { bool m_bMathNor; /// If the next continous section break should be ignored. bool m_bIgnoreNextContSectBreak; + /// clean up a synthetic page break, see RTF_PAGE + /// if inactive value is -1, otherwise the RTF_SKB* to restore + RTFKeyword m_nResetBreakOnSectBreak; /// If a section break is needed before the end of the doc (false right after a section break). bool m_bNeedSect; /// If aFrame.inFrame() was true in the previous state. |