summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2012-11-30 16:32:56 +0100
committerMiklos Vajna <vmiklos@suse.cz>2012-11-30 17:25:15 +0100
commit8063e36115a11ddf3db05928db9287947beee74d (patch)
treec2e1a6b21e53e092608fa91fc7e5a9acd7768741 /writerfilter
parentb836bf389d1150c9cafbb0aefa641af2316e536c (diff)
fdo#57708 fix RTF import of pictures right before text frames
Change-Id: Ibfeaadd5b48fd48c2c1f20de5dc272d9a326bfc4
Diffstat (limited to 'writerfilter')
-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 5a2f9b628440..9c988d7400c7 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -274,7 +274,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));
@@ -497,6 +498,8 @@ void RTFDocumentImpl::parBreak()
Mapper().endCharacterGroup();
Mapper().endParagraphGroup();
+ m_bHadPicture = false;
+
// start new one
Mapper().startParagraphGroup();
}
@@ -813,6 +816,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;
}
@@ -2055,6 +2060,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 7147fa7b79df..fad32e6f471f 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.hxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
@@ -587,6 +587,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