[Libreoffice-commits] .: 3 commits - writerfilter/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Oct 17 04:29:54 PDT 2012


 writerfilter/source/rtftok/rtfdocumentimpl.cxx |   28 +++++++++++++++++++++----
 writerfilter/source/rtftok/rtfdocumentimpl.hxx |    4 +--
 writerfilter/source/rtftok/rtfsdrimport.cxx    |    9 --------
 3 files changed, 27 insertions(+), 14 deletions(-)

New commits:
commit 299433d148850d7b3561fe3fcd78968a52749f09
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Wed Oct 17 13:08:10 2012 +0200

    import RTF_DOBYPARA
    
    Change-Id: Ifcfc6e1aca86960f72bcf2a8c7865b192ca1a491

diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 5ae93e1..192cb3b 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -2330,6 +2330,14 @@ int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
                     m_aStates.top().aDrawingObject.aPendingProperties.push_back(aPropertyValue);
                 }
                 break;
+        case RTF_DOBYPARA:
+                {
+                    beans::PropertyValue aPropertyValue;
+                    aPropertyValue.Name = OUString("HoriOrientRelation");
+                    aPropertyValue.Value <<= text::RelOrientation::FRAME;
+                    m_aStates.top().aDrawingObject.aPendingProperties.push_back(aPropertyValue);
+                }
+                break;
         case RTF_CONTEXTUALSPACE:
                 {
                     RTFValue::Pointer_t pValue(new RTFValue(1));
commit db1a183f8f2fa73dbaaa40ff61a03235223f3336
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Wed Oct 17 12:50:32 2012 +0200

    make RTFDocumentImpl::runBreak private
    
    Change-Id: I9af3521d5c7c78da522d02a4436b8eb6ca4f14ce

diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index da0ae75..5ae93e1 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -3673,14 +3673,7 @@ int RTFDocumentImpl::popState()
             xPropertySet->setPropertyValue("FillTransparence", uno::makeAny(sal_Int32(100)));
 
         Mapper().startShape(xShape);
-        Mapper().startParagraphGroup();
-        if (replayShapetext())
-        {
-            Mapper().startCharacterGroup();
-            runBreak();
-            Mapper().endCharacterGroup();
-        }
-        Mapper().endParagraphGroup();
+        replayShapetext();
         Mapper().endShape();
     }
     break;
@@ -3983,11 +3976,17 @@ void RTFDocumentImpl::setDestinationText(OUString& rString)
     m_aStates.top().aDestinationText.append(rString);
 }
 
-bool RTFDocumentImpl::replayShapetext()
+void RTFDocumentImpl::replayShapetext()
 {
-    bool bRet = !m_aShapetextBuffer.empty();
-    replayBuffer(m_aShapetextBuffer);
-    return bRet;
+    Mapper().startParagraphGroup();
+    if (!m_aShapetextBuffer.empty())
+    {
+        replayBuffer(m_aShapetextBuffer);
+        Mapper().startCharacterGroup();
+        runBreak();
+        Mapper().endCharacterGroup();
+    }
+    Mapper().endParagraphGroup();
 }
 
 bool RTFDocumentImpl::getSkipUnknown()
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.hxx b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
index beec3b5..7a0319a 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.hxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
@@ -428,8 +428,7 @@ namespace writerfilter {
                 void setDestinationText(rtl::OUString& rString);
                 /// Resolve a picture: If not inline, then anchored.
                 int resolvePict(bool bInline);
-                void runBreak();
-                bool replayShapetext();
+                void replayShapetext();
                 bool getSkipUnknown();
                 void setSkipUnknown(bool bSkipUnknown);
 
@@ -471,6 +470,7 @@ namespace writerfilter {
                 void singleChar(sal_uInt8 nValue, bool bRunProps = false);
                 // Sends run properties to dmapper, taking care of buffering.
                 void runProps();
+                void runBreak();
                 void parBreak();
                 void tableBreak();
                 void checkNeedPap();
diff --git a/writerfilter/source/rtftok/rtfsdrimport.cxx b/writerfilter/source/rtftok/rtfsdrimport.cxx
index 40504a3..680845f 100644
--- a/writerfilter/source/rtftok/rtfsdrimport.cxx
+++ b/writerfilter/source/rtftok/rtfsdrimport.cxx
@@ -353,14 +353,7 @@ void RTFSdrImport::resolve(RTFShape& rShape)
 
     // Send it to dmapper
     m_rImport.Mapper().startShape(xShape);
-    m_rImport.Mapper().startParagraphGroup();
-    if (m_rImport.replayShapetext())
-    {
-        m_rImport.Mapper().startCharacterGroup();
-        m_rImport.runBreak();
-        m_rImport.Mapper().endCharacterGroup();
-    }
-    m_rImport.Mapper().endParagraphGroup();
+    m_rImport.replayShapetext();
     m_rImport.Mapper().endShape();
 }
 
commit b43a051ab701e032ac43097e95573409af45ee83
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Wed Oct 17 12:36:00 2012 +0200

    implement import of RTF_{DPTXBXTEXT,DPTXBX}
    
    Change-Id: I2e5f47a3e083ec914a5b95a1e038c21b72025a4f

diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index b6a1121..da0ae75 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -1324,6 +1324,7 @@ int RTFDocumentImpl::dispatchDestination(RTFKeyword nKeyword)
             }
             break;
         case RTF_SHPTXT:
+        case RTF_DPTXBXTEXT:
             m_aStates.top().nDestinationState = DESTINATION_SHAPETEXT;
             dispatchFlag(RTF_PARD);
             m_bNeedPap = true;
@@ -2271,6 +2272,7 @@ int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
         case RTF_DPLINE:
         case RTF_DPRECT:
         case RTF_DPELLIPSE:
+        case RTF_DPTXBX:
                 {
                     sal_Int32 nType = 0;
                     switch (nKeyword)
@@ -2284,6 +2286,9 @@ int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
                         case RTF_DPELLIPSE:
                             nType = ESCHER_ShpInst_Ellipse;
                             break;
+                        case RTF_DPTXBX:
+                            nType = ESCHER_ShpInst_TextBox;
+                            break;
                         default:
                             break;
                     }
@@ -3668,6 +3673,14 @@ int RTFDocumentImpl::popState()
             xPropertySet->setPropertyValue("FillTransparence", uno::makeAny(sal_Int32(100)));
 
         Mapper().startShape(xShape);
+        Mapper().startParagraphGroup();
+        if (replayShapetext())
+        {
+            Mapper().startCharacterGroup();
+            runBreak();
+            Mapper().endCharacterGroup();
+        }
+        Mapper().endParagraphGroup();
         Mapper().endShape();
     }
     break;


More information about the Libreoffice-commits mailing list