Kaydet (Commit) 3d46b394 authored tarafından Cédric Bosdonnat's avatar Cédric Bosdonnat

n#779642: Import vertical layout mode from VML elements.

üst 38302b30
...@@ -86,6 +86,7 @@ public: ...@@ -86,6 +86,7 @@ public:
/// Text distance from the border (inset attribute of v:textbox), valid only if set. /// Text distance from the border (inset attribute of v:textbox), valid only if set.
bool borderDistanceSet; bool borderDistanceSet;
int borderDistanceLeft, borderDistanceTop, borderDistanceRight, borderDistanceBottom; int borderDistanceLeft, borderDistanceTop, borderDistanceRight, borderDistanceBottom;
OUString maLayoutFlow;
private: private:
typedef ::std::vector< TextPortionModel > PortionVector; typedef ::std::vector< TextPortionModel > PortionVector;
......
...@@ -21,7 +21,9 @@ ...@@ -21,7 +21,9 @@
#include <rtl/ustrbuf.hxx> #include <rtl/ustrbuf.hxx>
#include <com/sun/star/awt/FontWeight.hpp> #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/XTextAppend.hpp>
#include <com/sun/star/text/WritingMode.hpp>
namespace oox { namespace oox {
namespace vml { namespace vml {
...@@ -88,6 +90,12 @@ void TextBox::convert(uno::Reference<drawing::XShape> xShape) const ...@@ -88,6 +90,12 @@ void TextBox::convert(uno::Reference<drawing::XShape> xShape) const
*pValues++ = *i; *pValues++ = *i;
xTextAppend->appendTextPortion(aIt->maText, aPropSeq); 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 } // namespace vml
......
...@@ -178,6 +178,17 @@ TextBoxContext::TextBoxContext( ContextHandler2Helper& rParent, TextBox& rTextBo ...@@ -178,6 +178,17 @@ TextBoxContext::TextBoxContext( ContextHandler2Helper& rParent, TextBox& rTextBo
value.isEmpty() ? "0.05in" : value, 0, false, false ); value.isEmpty() ? "0.05in" : value, 0, false, false );
rTextBox.borderDistanceSet = true; 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 ) ContextHandlerRef TextBoxContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment