diff options
author | Miklos Vajna <vmiklos@frugalware.org> | 2012-02-02 09:21:25 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@frugalware.org> | 2012-02-10 10:06:05 +0100 |
commit | 63dfa72b5eca7be9df3076314055c5c74aa1f4fa (patch) | |
tree | 909a4b02c8b5a6f01d97d2310a0ef56657b143a3 /writerfilter | |
parent | n744512: Fixed formatting of tables. (diff) | |
download | core-63dfa72b5eca7be9df3076314055c5c74aa1f4fa.tar.gz core-63dfa72b5eca7be9df3076314055c5c74aa1f4fa.zip |
n#703032 fix RTF import of page breaks right before text frames
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.cxx | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index 721d3bb566e4..a3a9e7301699 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -409,12 +409,25 @@ void RTFDocumentImpl::checkNeedPap() { if (m_bNeedPap) { + m_bNeedPap = false; // reset early, so we can avoid recursion when calling ourselves if (!m_pCurrentBuffer) { writerfilter::Reference<Properties>::Pointer_t const pParagraphProperties( new RTFReferenceProperties(m_aStates.top().aParagraphAttributes, m_aStates.top().aParagraphSprms) ); + + // Writer will ignore a page break before a text frame, so guard it with empty paragraphs + bool hasBreakBeforeFrame = m_aStates.top().aFrame.hasProperties() && + m_aStates.top().aParagraphSprms.find(NS_sprm::LN_PFPageBreakBefore).get(); + if (hasBreakBeforeFrame) + { + dispatchSymbol(RTF_PAR); + m_bNeedPap = false; + m_aStates.top().aParagraphSprms.erase(NS_sprm::LN_PFPageBreakBefore); + } Mapper().props(pParagraphProperties); + if (hasBreakBeforeFrame) + dispatchSymbol(RTF_PAR); if (m_aStates.top().aFrame.hasProperties()) { @@ -428,7 +441,6 @@ void RTFDocumentImpl::checkNeedPap() RTFValue::Pointer_t pValue(new RTFValue(m_aStates.top().aParagraphAttributes, m_aStates.top().aParagraphSprms)); m_pCurrentBuffer->push_back(make_pair(BUFFER_PROPS, pValue)); } - m_bNeedPap = false; } } |