[PATCH 2/3] fdo#47036 fix RTF import of shapes inside text frames at the start of the doc

Miklos Vajna vmiklos at suse.cz
Sat Mar 24 05:04:54 PDT 2012


---
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index aca4519..16d5c75 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -3266,6 +3266,12 @@ int RTFDocumentImpl::popState()
         Mapper().startShape(xShape);
         Mapper().endShape();
     }
+    else if (m_aStates.top().nDestinationState == DESTINATION_SHAPE && m_aStates.top().aFrame.inFrame())
+    {
+        m_aStates.top().resetFrame();
+        parBreak();
+        m_bNeedPap = true;
+    }
 
     // See if we need to end a track change
     RTFValue::Pointer_t pTrackchange = m_aStates.top().aCharacterSprms.find(NS_ooxml::LN_trackchange);
@@ -3493,6 +3499,11 @@ RTFFrame::RTFFrame(RTFParserState* pParserState)
 
 void RTFFrame::setSprm(Id nId, Id nValue)
 {
+    if (m_pParserState->m_pDocumentImpl->getFirstRun())
+    {
+        m_pParserState->m_pDocumentImpl->checkFirstRun();
+        m_pParserState->m_pDocumentImpl->setNeedPar(false);
+    }
     switch (nId)
     {
         case NS_sprm::LN_PDxaWidth:
-- 
1.7.7


--C7zPtVaVf+AK4Oqc
Content-Type: text/x-patch; charset=utf-8
Content-Disposition: attachment; filename="0003-fdo-47036-fix-RTF-import-of-multi-paragraph-exact-he.patch"



More information about the LibreOffice mailing list