[Libreoffice-commits] .: writerfilter/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Sep 19 05:53:35 PDT 2012


 writerfilter/source/rtftok/rtfdocumentimpl.cxx |   22 ++++++++++++++++++++--
 writerfilter/source/rtftok/rtfdocumentimpl.hxx |    1 +
 writerfilter/source/rtftok/rtfsdrimport.cxx    |    2 ++
 3 files changed, 23 insertions(+), 2 deletions(-)

New commits:
commit d56e7c9011e662b39f0e9775e654f62cea8765c2
Author: Eilidh McAdam <eilidh at lanedo.com>
Date:   Wed Sep 19 09:45:49 2012 +0100

    Import RTF shape wrap property.
    
    Property \shpwrN, where N can be
    1: Wrap at top and bottom (no wrap at sides)
    2: Wrap around shape
    3: None (wrap as though shape isn't there)
    4: Wrap tightly around shape
    5: Wrap text through shape
    
    Change-Id: Ic700e06bf9ef894a6efa7e8d033888ed80a7082f
    Reviewed-on: https://gerrit.libreoffice.org/647
    Reviewed-by: Miklos Vajna <vmiklos at suse.cz>
    Tested-by: Miklos Vajna <vmiklos at suse.cz>

diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 282f68a..4acaad9 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -35,6 +35,7 @@
 #include <com/sun/star/text/HoriOrientation.hpp>
 #include <com/sun/star/text/VertOrientation.hpp>
 #include <com/sun/star/text/RelOrientation.hpp>
+#include <com/sun/star/text/WrapTextMode.hpp>
 #include <rtl/tencinfo.h>
 #include <svtools/wmf.hxx>
 #include <svl/lngmisc.hxx>
@@ -597,7 +598,6 @@ int RTFDocumentImpl::resolvePict(bool bInline)
 {
     SvMemoryStream aStream;
     SvStream *pStream = 0;
-
     if (!m_pBinaryData.get())
     {
         pStream = &aStream;
@@ -2746,6 +2746,23 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
                 m_aStates.top().aCharacterAttributes.set(NS_ooxml::LN_CT_WrapSquare_wrapText, pValue);
             }
             break;
+        case RTF_SHPWR:
+            {
+                switch (nParam)
+                {
+                case 1:
+                    m_aStates.top().aShape.nWrap = com::sun::star::text::WrapTextMode_NONE; break;
+                case 2:
+                    m_aStates.top().aShape.nWrap = com::sun::star::text::WrapTextMode_PARALLEL; break;
+                case 3:
+                    m_aStates.top().aShape.nWrap = com::sun::star::text::WrapTextMode_THROUGHT; break;
+                case 4:
+                    m_aStates.top().aShape.nWrap = com::sun::star::text::WrapTextMode_PARALLEL; break;
+                case 5:
+                    m_aStates.top().aShape.nWrap = com::sun::star::text::WrapTextMode_THROUGHT; break;
+                }
+            }
+            break;
         case RTF_CELLX:
             {
                 int nCellX = nParam - m_aStates.top().nCellX;
@@ -4059,7 +4076,8 @@ RTFShape::RTFShape()
     nRight(0),
     nBottom(0),
     nHoriOrientRelation(0),
-    nVertOrientRelation(0)
+    nVertOrientRelation(0),
+    nWrap(-1)
 {
 }
 
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.hxx b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
index e2a5aa6..beec3b5 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.hxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
@@ -257,6 +257,7 @@ namespace writerfilter {
                 int nBottom;
                 sal_Int16 nHoriOrientRelation;
                 sal_Int16 nVertOrientRelation;
+                int nWrap;
         };
 
         /// Stores the properties of a drawing object.
diff --git a/writerfilter/source/rtftok/rtfsdrimport.cxx b/writerfilter/source/rtftok/rtfsdrimport.cxx
index 956ada1..2545c03 100644
--- a/writerfilter/source/rtftok/rtfsdrimport.cxx
+++ b/writerfilter/source/rtftok/rtfsdrimport.cxx
@@ -346,6 +346,8 @@ void RTFSdrImport::resolve(RTFShape& rShape)
             xPropertySet->setPropertyValue("HoriOrientRelation", uno::makeAny(rShape.nHoriOrientRelation));
         if (rShape.nVertOrientRelation != 0)
             xPropertySet->setPropertyValue("VertOrientRelation", uno::makeAny(rShape.nVertOrientRelation));
+        if (rShape.nWrap != -1)
+            xPropertySet->setPropertyValue("Surround", uno::makeAny(rShape.nWrap));
     }
 
     // Send it to dmapper


More information about the Libreoffice-commits mailing list