[Libreoffice-commits] core.git: Branch 'distro/suse/suse-3.6' - oox/inc oox/source

Cédric Bosdonnat cedric.bosdonnat at free.fr
Thu Feb 21 08:54:48 PST 2013


 oox/inc/oox/vml/vmltextbox.hxx       |    1 +
 oox/source/vml/vmltextbox.cxx        |    8 ++++++++
 oox/source/vml/vmltextboxcontext.cxx |   11 +++++++++++
 3 files changed, 20 insertions(+)

New commits:
commit 94108f529a11062eb2749b5141752c884d106464
Author: Cédric Bosdonnat <cedric.bosdonnat at free.fr>
Date:   Thu Feb 21 17:34:16 2013 +0100

    n#779642: Import vertical layout mode from VML elements.
    (cherry picked from commit 3d46b39491af97ba360fb92182501e6b399f4f56)

diff --git a/oox/inc/oox/vml/vmltextbox.hxx b/oox/inc/oox/vml/vmltextbox.hxx
index 93b06b5..427bb79 100644
--- a/oox/inc/oox/vml/vmltextbox.hxx
+++ b/oox/inc/oox/vml/vmltextbox.hxx
@@ -95,6 +95,7 @@ public:
     /// Text distance from the border (inset attribute of v:textbox), valid only if set.
     bool borderDistanceSet;
     int borderDistanceLeft, borderDistanceTop, borderDistanceRight, borderDistanceBottom;
+    OUString maLayoutFlow;
 
 private:
     typedef ::std::vector< TextPortionModel > PortionVector;
diff --git a/oox/source/vml/vmltextbox.cxx b/oox/source/vml/vmltextbox.cxx
index 965cdfc..f2baebd 100644
--- a/oox/source/vml/vmltextbox.cxx
+++ b/oox/source/vml/vmltextbox.cxx
@@ -30,7 +30,9 @@
 
 #include <rtl/ustrbuf.hxx>
 #include <com/sun/star/awt/FontWeight.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
 #include <com/sun/star/text/XTextAppend.hpp>
+#include <com/sun/star/text/WritingMode.hpp>
 
 namespace oox {
 namespace vml {
@@ -105,6 +107,12 @@ void TextBox::convert(uno::Reference<drawing::XShape> xShape) const
             *pValues++ = *i;
         xTextAppend->appendTextPortion(aIt->maText, aPropSeq);
     }
+
+    if ( maLayoutFlow == "vertical" )
+    {
+        uno::Reference<beans::XPropertySet> xProperties(xShape, uno::UNO_QUERY);
+        xProperties->setPropertyValue( "TextWritingMode", uno::makeAny( text::WritingMode_TB_RL ) );
+    }
 }
 
 } // namespace vml
diff --git a/oox/source/vml/vmltextboxcontext.cxx b/oox/source/vml/vmltextboxcontext.cxx
index a808f43..108b9f9 100644
--- a/oox/source/vml/vmltextboxcontext.cxx
+++ b/oox/source/vml/vmltextboxcontext.cxx
@@ -188,6 +188,17 @@ TextBoxContext::TextBoxContext( ContextHandler2Helper& rParent, TextBox& rTextBo
             value.isEmpty() ? "0.05in" : value, 0, false, false );
         rTextBox.borderDistanceSet = true;
     }
+
+    OUString sStyle = rAttribs.getString( XML_style, OUString() );
+    sal_Int32 nIndex = 0;
+    while( nIndex >= 0 )
+    {
+        OUString aName, aValue;
+        if( ConversionHelper::separatePair( aName, aValue, sStyle.getToken( 0, ';', nIndex ), ':' ) )
+        {
+            if( aName == "layout-flow" )      rTextBox.maLayoutFlow = aValue;
+        }
+    }
 }
 
 ContextHandlerRef TextBoxContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )


More information about the Libreoffice-commits mailing list