Kaydet (Commit) c9bdee0b authored tarafından Miklos Vajna's avatar Miklos Vajna

handle sections containing no paragraphs

üst 82336dbc
...@@ -271,6 +271,7 @@ RTFDocumentImpl::RTFDocumentImpl(uno::Reference<uno::XComponentContext> const& x ...@@ -271,6 +271,7 @@ RTFDocumentImpl::RTFDocumentImpl(uno::Reference<uno::XComponentContext> const& x
m_bFirstRow(true), m_bFirstRow(true),
m_bNeedPap(false), m_bNeedPap(false),
m_bNeedCr(false), m_bNeedCr(false),
m_bNeedPar(true),
m_aListTableSprms(), m_aListTableSprms(),
m_aSettingsTableSprms(), m_aSettingsTableSprms(),
m_xStorage(), m_xStorage(),
...@@ -440,6 +441,9 @@ void RTFDocumentImpl::parBreak() ...@@ -440,6 +441,9 @@ void RTFDocumentImpl::parBreak()
void RTFDocumentImpl::sectBreak(bool bFinal = false) 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(); checkChangedFrame();
while (m_nHeaderFooterPositions.size()) while (m_nHeaderFooterPositions.size())
{ {
...@@ -471,6 +475,7 @@ void RTFDocumentImpl::sectBreak(bool bFinal = false) ...@@ -471,6 +475,7 @@ void RTFDocumentImpl::sectBreak(bool bFinal = false)
Mapper().startSectionGroup(); Mapper().startSectionGroup();
Mapper().startParagraphGroup(); Mapper().startParagraphGroup();
} }
m_bNeedPar = true;
} }
void RTFDocumentImpl::seek(sal_uInt32 nPos) void RTFDocumentImpl::seek(sal_uInt32 nPos)
...@@ -1294,6 +1299,7 @@ int RTFDocumentImpl::dispatchSymbol(RTFKeyword nKeyword) ...@@ -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 // but don't emit properties yet, since they may change till the first text token arrives
m_bNeedPap = true; m_bNeedPap = true;
m_bWasInFrame = inFrame(); m_bWasInFrame = inFrame();
m_bNeedPar = false;
} }
break; break;
case RTF_SECT: case RTF_SECT:
......
...@@ -371,6 +371,8 @@ namespace writerfilter { ...@@ -371,6 +371,8 @@ namespace writerfilter {
bool m_bNeedPap; bool m_bNeedPap;
/// If we need to emit a CR at the end of substream. /// If we need to emit a CR at the end of substream.
bool m_bNeedCr; 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. /// The list table and list override table combined.
RTFSprms m_aListTableSprms; RTFSprms m_aListTableSprms;
/// The settings table. /// The settings table.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment