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

Lubos Lunak llunak at kemper.freedesktop.org
Thu Jul 19 08:50:59 PDT 2012


 writerfilter/source/rtftok/rtfdocumentimpl.cxx |    4 +++-
 writerfilter/source/rtftok/rtfdocumentimpl.hxx |    2 +-
 writerfilter/source/rtftok/rtfsdrimport.cxx    |   10 ++++++----
 3 files changed, 10 insertions(+), 6 deletions(-)

New commits:
commit 0c1de6d3d6320f91770967d1b23c8dd57d168fe7
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Wed Jul 18 22:47:03 2012 +0200

    fdo#52066 fix RTF import of rectangle shape without text in it
    
    We used to always add a paragraph on shapes, which breaks import of
    abused rectangle shapes with minimal height, used as lines.
    
    Change-Id: Ice240bad68bc030e7889c46f72c45646307f17e5
    
    Signed-off-by: Luboš Luňák <l.lunak at suse.cz>

diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index be34248..08fef7a 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -3624,9 +3624,11 @@ void RTFDocumentImpl::setDestinationText(OUString& rString)
     m_aStates.top().aDestinationText.append(rString);
 }
 
-void RTFDocumentImpl::replayShapetext()
+bool RTFDocumentImpl::replayShapetext()
 {
+    bool bRet = !m_aShapetextBuffer.empty();
     replayBuffer(m_aShapetextBuffer);
+    return bRet;
 }
 
 bool RTFDocumentImpl::getSkipUnknown()
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.hxx b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
index 5756b5a..9778ce7 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.hxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
@@ -368,7 +368,7 @@ namespace writerfilter {
                 /// Resolve a picture: If not inline, then anchored.
                 int resolvePict(bool bInline);
                 void runBreak();
-                void replayShapetext();
+                bool replayShapetext();
                 bool getSkipUnknown();
                 void setSkipUnknown(bool bSkipUnknown);
 
diff --git a/writerfilter/source/rtftok/rtfsdrimport.cxx b/writerfilter/source/rtftok/rtfsdrimport.cxx
index ab4118c..dba4545 100644
--- a/writerfilter/source/rtftok/rtfsdrimport.cxx
+++ b/writerfilter/source/rtftok/rtfsdrimport.cxx
@@ -316,10 +316,12 @@ void RTFSdrImport::resolve(RTFShape& rShape)
     // Send it to dmapper
     m_rImport.Mapper().startShape(xShape);
     m_rImport.Mapper().startParagraphGroup();
-    m_rImport.replayShapetext();
-    m_rImport.Mapper().startCharacterGroup();
-    m_rImport.runBreak();
-    m_rImport.Mapper().endCharacterGroup();
+    if (m_rImport.replayShapetext())
+    {
+        m_rImport.Mapper().startCharacterGroup();
+        m_rImport.runBreak();
+        m_rImport.Mapper().endCharacterGroup();
+    }
     m_rImport.Mapper().endParagraphGroup();
     m_rImport.Mapper().endShape();
 }


More information about the Libreoffice-commits mailing list