summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2018-04-26 12:03:12 +0200
committerAndras Timar <andras.timar@collabora.com>2018-05-15 10:14:53 +0200
commit64d5de06c8a6367595943e2fa0e346ba8cf7e338 (patch)
treeb7816598bb1ba841236d433b77957ecb6f75343e /writerfilter
parent5fe46c18dc98d893b8e2ff479e59a8ec37402c78 (diff)
tdf#117246 RTF import: don't loose page breaks inside nested groups
Regression from e3f254ab8211fbab7541cde2100a35c875b0c240 (RTF import: fix spurious page breaks at doc end (related: rhbz#1065629), 2014-02-27), the problem was that now we update the parser state to remember the next section break should set the break type of the current section to "next page", but this state should be remembered once the RTF group ends ("}" character), otherwise \page will be represented with a continuous break, i.e. lost. (cherry picked from commit 4a93b46e4652e73ed3460e4c66999d94e50db4b7) Change-Id: I69a8413f45e17e11d6d676c7bfd13ca7560b4d43 Reviewed-on: https://gerrit.libreoffice.org/53506 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit fc1ee8a8473beadbf5d364e059bba6c8006562af)
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.cxx9
1 files changed, 9 insertions, 0 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 795f38f1ee89..4f1accba6bab 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -3341,6 +3341,15 @@ RTFError RTFDocumentImpl::popState()
// don't do it again in the outer state later.
m_aStates.top().nTableRowWidthAfter = 0;
+ if (m_nResetBreakOnSectBreak != RTF_invalid && !m_aStates.empty())
+ {
+ // Section break type created for \page still has an effect in the
+ // outer state as well.
+ RTFValue::Pointer_t pType = aState.aSectionSprms.find(NS_ooxml::LN_EG_SectPrContents_type);
+ if (pType)
+ m_aStates.top().aSectionSprms.set(NS_ooxml::LN_EG_SectPrContents_type, pType);
+ }
+
return RTFError::OK;
}