summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.cxx9
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.hxx2
2 files changed, 10 insertions, 1 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 3ebb8da59f0c..a910401e99fa 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -280,7 +280,8 @@ RTFDocumentImpl::RTFDocumentImpl(uno::Reference<uno::XComponentContext> const& x
m_aHexBuffer(),
m_bIgnoreNextContSectBreak(false),
m_bNeedSect(true),
- m_bWasInFrame(false)
+ m_bWasInFrame(false),
+ m_bHadPicture(false)
{
OSL_ASSERT(xInputStream.is());
m_pInStream.reset(utl::UcbStreamHelper::CreateStream(xInputStream, sal_True));
@@ -480,6 +481,8 @@ void RTFDocumentImpl::parBreak()
Mapper().endCharacterGroup();
Mapper().endParagraphGroup();
+ m_bHadPicture = false;
+
// start new one
Mapper().startParagraphGroup();
}
@@ -789,6 +792,8 @@ int RTFDocumentImpl::resolvePict(bool bInline)
m_pCurrentBuffer->push_back(make_pair(BUFFER_PROPS, pValue));
}
+ // Make sure we don't loose these properties with a too early reset.
+ m_bHadPicture = true;
return 0;
}
@@ -1926,6 +1931,8 @@ int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
}
break;
case RTF_PARD:
+ if (m_bHadPicture)
+ dispatchSymbol(RTF_PAR);
m_aStates.top().aParagraphSprms = m_aDefaultState.aParagraphSprms;
m_aStates.top().aParagraphAttributes = m_aDefaultState.aParagraphAttributes;
m_aStates.top().resetFrame();
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.hxx b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
index d36a5ec37d34..5e88ef84d212 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.hxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
@@ -520,6 +520,8 @@ namespace writerfilter {
bool m_bNeedSect;
/// If aFrame.inFrame() was true in the previous state.
bool m_bWasInFrame;
+ /// A picture was seen in the current paragraph.
+ bool m_bHadPicture;
};
} // namespace rtftok
} // namespace writerfilter