diff options
author | Miklos Vajna <vmiklos@frugalware.org> | 2012-01-30 23:30:08 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@frugalware.org> | 2012-01-30 23:35:14 +0100 |
commit | d1f3018b0e6d0889febcf09a6c95a2ec354137c0 (patch) | |
tree | 5c537bd1200b91596586afb4778b2acee46c5695 /writerfilter | |
parent | MaxTextLength apparently needs to take comma in "1,000" into account. (diff) | |
download | core-d1f3018b0e6d0889febcf09a6c95a2ec354137c0.tar.gz core-d1f3018b0e6d0889febcf09a6c95a2ec354137c0.zip |
fdo#43965 more \page vs \pagebb fixes
The previous commit even reset \pagebb at the end of the paragraph,
which is not what the spec says.
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.cxx | 12 | ||||
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.hxx | 2 |
2 files changed, 11 insertions, 3 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index faf3943bdace..a2d44dd1db8e 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -292,6 +292,7 @@ RTFDocumentImpl::RTFDocumentImpl(uno::Reference<uno::XComponentContext> const& x m_bFormField(false), m_bWasInFrame(false), m_bIsInFrame(false), + m_bHasPage(false), m_aUnicodeBuffer() { OSL_ASSERT(xInputStream.is()); @@ -1317,8 +1318,12 @@ int RTFDocumentImpl::dispatchSymbol(RTFKeyword nKeyword) m_bWasInFrame = inFrame(); if (!m_bWasInFrame) m_bNeedPar = false; - // this has to be reset even without a pard, since it's a symbol in RTF terms - m_aStates.top().aParagraphSprms.erase(NS_sprm::LN_PFPageBreakBefore); + if (m_bHasPage) + { + // this has to be reset even without a pard, since it's a symbol in RTF terms + m_aStates.top().aParagraphSprms.erase(NS_sprm::LN_PFPageBreakBefore); + m_bHasPage = false; + } } break; case RTF_SECT: @@ -1444,6 +1449,7 @@ int RTFDocumentImpl::dispatchSymbol(RTFKeyword nKeyword) RTFValue::Pointer_t pValue(new RTFValue(1)); dispatchSymbol(RTF_PAR); m_aStates.top().aParagraphSprms->push_back(make_pair(NS_sprm::LN_PFPageBreakBefore, pValue)); + m_bHasPage = true; } break; default: @@ -1662,7 +1668,7 @@ int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword) case RTF_KEEP: if (m_pCurrentBuffer != &m_aTableBuffer) nParam = NS_sprm::LN_PFKeep; break; case RTF_KEEPN: if (m_pCurrentBuffer != &m_aTableBuffer) nParam = NS_sprm::LN_PFKeepFollow; break; case RTF_INTBL: m_pCurrentBuffer = &m_aTableBuffer; nParam = NS_sprm::LN_PFInTable; break; - case RTF_PAGEBB: nParam = NS_sprm::LN_PFPageBreakBefore; break; + case RTF_PAGEBB: nParam = NS_sprm::LN_PFPageBreakBefore; m_bHasPage = false; break; default: break; } if (nParam >= 0) diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.hxx b/writerfilter/source/rtftok/rtfdocumentimpl.hxx index 178cdb314322..12d414c343a6 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.hxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.hxx @@ -431,6 +431,8 @@ namespace writerfilter { bool m_bWasInFrame; /// If a frame start token is already sent to dmapper (nesting them is not OK). bool m_bIsInFrame; + /// If we should reset the page break property when we start the next paragraph. + bool m_bHasPage; // Unicode characters are collected here so we don't have to send them one by one. rtl::OUStringBuffer m_aUnicodeBuffer; }; |