diff options
author | Miklos Vajna <vmiklos@frugalware.org> | 2011-08-19 13:08:13 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@frugalware.org> | 2011-08-19 17:20:01 +0200 |
commit | c9bdee0b19174214bfbc04a944ff8266b0303351 (patch) | |
tree | 6221fdaddf35408263bf80a07ad51598ea4e604f /writerfilter | |
parent | multiple sections in a frame are not allowed (diff) | |
download | core-c9bdee0b19174214bfbc04a944ff8266b0303351.tar.gz core-c9bdee0b19174214bfbc04a944ff8266b0303351.zip |
handle sections containing no paragraphs
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.cxx | 6 | ||||
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.hxx | 2 |
2 files changed, 8 insertions, 0 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index 214f0cd8bc0f..02f5d79a401b 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -271,6 +271,7 @@ RTFDocumentImpl::RTFDocumentImpl(uno::Reference<uno::XComponentContext> const& x m_bFirstRow(true), m_bNeedPap(false), m_bNeedCr(false), + m_bNeedPar(true), m_aListTableSprms(), m_aSettingsTableSprms(), m_xStorage(), @@ -440,6 +441,9 @@ void RTFDocumentImpl::parBreak() void RTFDocumentImpl::sectBreak(bool bFinal = false) { + // If there is no paragraph in this section, then insert a dummy one, as required by Writer + if (m_bNeedPar) + dispatchSymbol(RTF_PAR); checkChangedFrame(); while (m_nHeaderFooterPositions.size()) { @@ -471,6 +475,7 @@ void RTFDocumentImpl::sectBreak(bool bFinal = false) Mapper().startSectionGroup(); Mapper().startParagraphGroup(); } + m_bNeedPar = true; } void RTFDocumentImpl::seek(sal_uInt32 nPos) @@ -1294,6 +1299,7 @@ int RTFDocumentImpl::dispatchSymbol(RTFKeyword nKeyword) // but don't emit properties yet, since they may change till the first text token arrives m_bNeedPap = true; m_bWasInFrame = inFrame(); + m_bNeedPar = false; } break; case RTF_SECT: diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.hxx b/writerfilter/source/rtftok/rtfdocumentimpl.hxx index e10c727e374d..d48b0498949f 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.hxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.hxx @@ -371,6 +371,8 @@ namespace writerfilter { bool m_bNeedPap; /// If we need to emit a CR at the end of substream. bool m_bNeedCr; + /// If we need to add a dummy paragraph before a section break. + bool m_bNeedPar; /// The list table and list override table combined. RTFSprms m_aListTableSprms; /// The settings table. |