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-02-21 17:45:19 +0100
commit3d46b39491af97ba360fb92182501e6b399f4f56 (patch)
tree872d8a5ef947857e55a8e9331fa7888fcdc105ef /oox
parent38302b308559b8e34916a07ea3a160085c596c2e (diff)
n#779642: Import vertical layout mode from VML elements.
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 f3c4102f3def..65b8f34dbdc1 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 {
@@ -88,6 +90,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 9d1c4eee1508..ca124bcb4d18 100644
--- a/oox/source/vml/vmltextboxcontext.cxx
+++ b/oox/source/vml/vmltextboxcontext.cxx
@@ -178,6 +178,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 )