diff options
author | Cédric Bosdonnat <cedric.bosdonnat@free.fr> | 2013-02-21 17:34:16 +0100 |
---|---|---|
committer | Cédric Bosdonnat <cedric.bosdonnat@free.fr> | 2013-02-21 17:51:33 +0100 |
commit | 94108f529a11062eb2749b5141752c884d106464 (patch) | |
tree | 8cf43f3ce47c0acb8445bc5d66bb13deb0d81180 /oox | |
parent | 9965b124b5631bb0e1bf5be394224251c72fe0e5 (diff) |
n#779642: Import vertical layout mode from VML elements.
(cherry picked from commit 3d46b39491af97ba360fb92182501e6b399f4f56)
Diffstat (limited to 'oox')
-rw-r--r-- | oox/inc/oox/vml/vmltextbox.hxx | 1 | ||||
-rw-r--r-- | oox/source/vml/vmltextbox.cxx | 8 | ||||
-rw-r--r-- | oox/source/vml/vmltextboxcontext.cxx | 11 |
3 files changed, 20 insertions, 0 deletions
diff --git a/oox/inc/oox/vml/vmltextbox.hxx b/oox/inc/oox/vml/vmltextbox.hxx index 93b06b54087f..427bb79a832b 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 965cdfccda90..f2baebdddfc6 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 a808f43729f7..108b9f9b3b9c 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 ) |