[Libreoffice-commits] .: Branch 'libreoffice-3-6' - writerfilter/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Sat Dec 1 12:51:43 PST 2012


 writerfilter/source/rtftok/rtfdocumentimpl.cxx |    9 ++++++++-
 writerfilter/source/rtftok/rtfdocumentimpl.hxx |    2 ++
 2 files changed, 10 insertions(+), 1 deletion(-)

New commits:
commit fb17de573c582eca7548bf8cd0a0ea86cfad17df
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Fri Nov 30 16:32:56 2012 +0100

    fdo#57708 fix RTF import of pictures right before text frames
    
    Change-Id: Ibfeaadd5b48fd48c2c1f20de5dc272d9a326bfc4
    (cherry picked from commit 8063e36115a11ddf3db05928db9287947beee74d)
    Reviewed-on: https://gerrit.libreoffice.org/1215
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 3ebb8da..a910401 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 d36a5ec..5e88ef8 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


More information about the Libreoffice-commits mailing list