summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorCédric Bosdonnat <cedric.bosdonnat@free.fr>2013-02-21 17:34:16 +0100
committerCédric Bosdonnat <cedric.bosdonnat@free.fr>2013-04-02 11:13:35 +0200
commite8387897bba3ba2863a0975a106486d852dc67db (patch)
tree018a3a329462cffc1bfd0fa620028fca15b95c76 /oox
parentd623db401a080aa15b711a267bc6072e2c0b9446 (diff)
n#779642: Import vertical layout mode from VML elements.
(cherry picked from commit 3d46b39491af97ba360fb92182501e6b399f4f56) (cherry picked from commit 94108f529a11062eb2749b5141752c884d106464)
Diffstat (limited to 'oox')
-rw-r--r--oox/inc/oox/vml/vmltextbox.hxx1
-rw-r--r--oox/source/vml/vmltextbox.cxx8
-rw-r--r--oox/source/vml/vmltextboxcontext.cxx11
3 files changed, 20 insertions, 0 deletions
diff --git a/oox/inc/oox/vml/vmltextbox.hxx b/oox/inc/oox/vml/vmltextbox.hxx
index 1dc30ab11e48..f234b00b9665 100644
--- a/oox/inc/oox/vml/vmltextbox.hxx
+++ b/oox/inc/oox/vml/vmltextbox.hxx
@@ -86,6 +86,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 4af0a9d67cc0..72a18ce64748 100644
--- a/oox/source/vml/vmltextbox.cxx
+++ b/oox/source/vml/vmltextbox.cxx
@@ -21,7 +21,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 {
@@ -90,6 +92,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 3755cc7efd5b..b96bb605f9e9 100644
--- a/oox/source/vml/vmltextboxcontext.cxx
+++ b/oox/source/vml/vmltextboxcontext.cxx
@@ -179,6 +179,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 )