diff options
author | Miklos Vajna <vmiklos@frugalware.org> | 2011-09-03 17:10:13 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@frugalware.org> | 2011-09-03 17:12:23 +0200 |
commit | 1a2894941e25e7580eec7c189bf94989056d0d9c (patch) | |
tree | 49a6325993921b4cccf0df79f95c21a693326b98 /writerfilter | |
parent | Actually show some text (diff) | |
download | core-1a2894941e25e7580eec7c189bf94989056d0d9c.tar.gz core-1a2894941e25e7580eec7c189bf94989056d0d9c.zip |
Related: fdo#38966 RTF import should not ignore page breaks before empty pars
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.cxx | 41 | ||||
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.hxx | 1 |
2 files changed, 25 insertions, 17 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index 658a3d28b7fc..f4a72267b35f 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -409,6 +409,28 @@ void RTFDocumentImpl::checkFirstRun() } } +void RTFDocumentImpl::checkNeedPap() +{ + if (m_bNeedPap) + { + checkChangedFrame(); + + if (!m_pCurrentBuffer) + { + writerfilter::Reference<Properties>::Pointer_t const pParagraphProperties( + new RTFReferenceProperties(m_aStates.top().aParagraphAttributes, m_aStates.top().aParagraphSprms) + ); + Mapper().props(pParagraphProperties); + } + else + { + 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; + } +} + void RTFDocumentImpl::runBreak() { sal_uInt8 sBreak[] = { 0xd }; @@ -426,6 +448,7 @@ void RTFDocumentImpl::tableBreak() void RTFDocumentImpl::parBreak() { checkFirstRun(); + checkNeedPap(); // end previous paragraph Mapper().startCharacterGroup(); runBreak(); @@ -864,24 +887,8 @@ void RTFDocumentImpl::text(OUString& rString) return; } - writerfilter::Reference<Properties>::Pointer_t const pParagraphProperties( - new RTFReferenceProperties(m_aStates.top().aParagraphAttributes, m_aStates.top().aParagraphSprms) - ); - checkFirstRun(); - if (m_bNeedPap) - { - checkChangedFrame(); - - if (!m_pCurrentBuffer) - Mapper().props(pParagraphProperties); - else - { - 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; - } + checkNeedPap(); // Don't return earlier, a bookmark start has to be in a paragraph group. if (m_aStates.top().nDestinationState == DESTINATION_BOOKMARKSTART) diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.hxx b/writerfilter/source/rtftok/rtfdocumentimpl.hxx index d5a65ef2629e..66a2839fb4b5 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.hxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.hxx @@ -339,6 +339,7 @@ namespace writerfilter { void tableBreak(); /// If this is the first run of the document, starts the initial paragraph. void checkFirstRun(); + void checkNeedPap(); void sectBreak(bool bFinal); void replayBuffer(RTFBuffer_t& rBuffer); bool inFrame(); |