diff options
-rw-r--r-- | oox/source/vml/vmlshape.cxx | 8 | ||||
-rw-r--r-- | sw/qa/extras/ooxmlimport/data/tbrl-frame-vml.docx | bin | 0 -> 22756 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlimport/ooxmlimport2.cxx | 12 |
3 files changed, 20 insertions, 0 deletions
diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx index 27d7b51959ca..a7529493e401 100644 --- a/oox/source/vml/vmlshape.cxx +++ b/oox/source/vml/vmlshape.cxx @@ -52,6 +52,7 @@ #include <com/sun/star/text/GraphicCrop.hpp> #include <com/sun/star/security/DocumentDigitalSignatures.hpp> #include <com/sun/star/security/XDocumentDigitalSignatures.hpp> +#include <com/sun/star/text/WritingMode2.hpp> #include <rtl/math.hxx> #include <rtl/ustrbuf.hxx> #include <sal/log.hxx> @@ -726,6 +727,13 @@ Reference< XShape > SimpleShape::implConvertAndInsert( const Reference< XShapes PropertySet( xShape ).setAnyProperty( PROP_RightBorderDistance, makeAny( sal_Int32( getTextBox()->borderDistanceRight ))); PropertySet( xShape ).setAnyProperty( PROP_BottomBorderDistance, makeAny( sal_Int32( getTextBox()->borderDistanceBottom ))); } + + if (getTextBox()->maLayoutFlow == "vertical" && maTypeModel.maLayoutFlowAlt.isEmpty()) + { + PropertySet(xShape).setAnyProperty(PROP_WritingMode, + uno::makeAny(text::WritingMode2::TB_RL)); + } + if (!maTypeModel.maLayoutFlowAlt.isEmpty()) { // Can't handle this property here, as the frame is not attached yet: pass it to writerfilter. diff --git a/sw/qa/extras/ooxmlimport/data/tbrl-frame-vml.docx b/sw/qa/extras/ooxmlimport/data/tbrl-frame-vml.docx Binary files differnew file mode 100644 index 000000000000..c697e5846ce6 --- /dev/null +++ b/sw/qa/extras/ooxmlimport/data/tbrl-frame-vml.docx diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx index 1c7282623b00..80967be606d7 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx @@ -18,6 +18,7 @@ #include <wrtsh.hxx> #include <com/sun/star/document/XEmbeddedObjectSupplier2.hpp> #include <com/sun/star/embed/Aspects.hpp> +#include <com/sun/star/text/WritingMode2.hpp> class Test : public SwModelTestBase { @@ -255,6 +256,17 @@ DECLARE_OOXMLIMPORT_TEST(testTdf113946, "tdf113946.docx") CPPUNIT_ASSERT_EQUAL(OUString("1695"), aTop); } +DECLARE_OOXMLIMPORT_TEST(testTbrlFrameVml, "tbrl-frame-vml.docx") +{ + uno::Reference<beans::XPropertySet> xTextFrame(getShape(1), uno::UNO_QUERY); + CPPUNIT_ASSERT(xTextFrame.is()); + + auto nActual = getProperty<sal_Int16>(xTextFrame, "WritingMode"); + // Without the accompanying fix in place, this test would have failed with 'Expected: 2; Actual: + // 4', i.e. writing direction was inherited from page, instead of explicit tbrl. + CPPUNIT_ASSERT_EQUAL(text::WritingMode2::TB_RL, nActual); +} + DECLARE_OOXMLIMPORT_TEST(testTdf121804, "tdf121804.docx") { uno::Reference<container::XIndexAccess> xGroup(getShape(1), uno::UNO_QUERY); |