sw/qa/extras/uiwriter/data2/tdf129655-vtextbox.odt |binary sw/qa/extras/uiwriter/uiwriter2.cxx | 6 ++++++ sw/source/core/doc/textboxhelper.cxx | 10 ++++++++++ 3 files changed, 16 insertions(+)
New commits: commit 340b0eedaac17ff26799b09f6bbb2b115712e2d5 Author: Mark Hung <mark...@gmail.com> AuthorDate: Sat Dec 28 10:01:20 2019 +0800 Commit: Miklos Vajna <vmik...@collabora.com> CommitDate: Mon Jan 13 16:31:04 2020 +0100 tdf#129655 Sync TextWritingMode to frame direction. Sync the text writing mode of a shape to the frame direction of the attached text box ( a text frame ). Change-Id: Ied9ff1a1d0f53d7ef78a83a086af0a2c1ca5eb36 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86638 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmik...@collabora.com> diff --git a/sw/qa/extras/uiwriter/data2/tdf129655-vtextbox.odt b/sw/qa/extras/uiwriter/data2/tdf129655-vtextbox.odt new file mode 100644 index 000000000000..8d668400c386 Binary files /dev/null and b/sw/qa/extras/uiwriter/data2/tdf129655-vtextbox.odt differ diff --git a/sw/qa/extras/uiwriter/uiwriter2.cxx b/sw/qa/extras/uiwriter/uiwriter2.cxx index c9548208150b..31f095a2c0d3 100644 --- a/sw/qa/extras/uiwriter/uiwriter2.cxx +++ b/sw/qa/extras/uiwriter/uiwriter2.cxx @@ -2451,4 +2451,10 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf90069) CPPUNIT_ASSERT_EQUAL(OUString("Lohit Devanagari"), sFontName); } +CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf129655) +{ + createDoc("tdf129655-vtextbox.odt"); + xmlDocPtr pXmlDoc = parseLayoutDump(); + assertXPath(pXmlDoc, "//fly/txt[@WritingMode='Vertical']", 1); +} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/doc/textboxhelper.cxx b/sw/source/core/doc/textboxhelper.cxx index 3c4e63a12b2f..37939224daf6 100644 --- a/sw/source/core/doc/textboxhelper.cxx +++ b/sw/source/core/doc/textboxhelper.cxx @@ -42,6 +42,7 @@ #include <com/sun/star/text/WrapTextMode.hpp> #include <com/sun/star/text/XTextDocument.hpp> #include <com/sun/star/table/BorderLine2.hpp> +#include <com/sun/star/text/WritingMode.hpp> #include <com/sun/star/text/WritingMode2.hpp> using namespace com::sun::star; @@ -124,6 +125,9 @@ void SwTextBoxHelper::create(SwFrameFormat* pShape) xShapePropertySet->getPropertyValue(UNO_NAME_TEXT_AUTOGROWHEIGHT)); syncProperty(pShape, RES_TEXT_VERT_ADJUST, 0, xShapePropertySet->getPropertyValue(UNO_NAME_TEXT_VERT_ADJUST)); + text::WritingMode eMode; + if (xShapePropertySet->getPropertyValue(UNO_NAME_TEXT_WRITINGMODE) >>= eMode) + syncProperty(pShape, RES_FRAMEDIR, 0, uno::makeAny(sal_Int16(eMode))); } void SwTextBoxHelper::destroy(SwFrameFormat* pShape) @@ -386,6 +390,12 @@ void SwTextBoxHelper::syncProperty(SwFrameFormat* pShape, const OUString& rPrope syncProperty(pShape, RES_BOX, TOP_BORDER_DISTANCE, rValue); else if (rPropertyName == UNO_NAME_TEXT_LOWERDIST) syncProperty(pShape, RES_BOX, BOTTOM_BORDER_DISTANCE, rValue); + else if (rPropertyName == UNO_NAME_TEXT_WRITINGMODE) + { + text::WritingMode eMode; + if (rValue >>= eMode) + syncProperty(pShape, RES_FRAMEDIR, 0, uno::makeAny(sal_Int16(eMode))); + } } void SwTextBoxHelper::getProperty(SwFrameFormat const* pShape, sal_uInt16 nWID, sal_uInt8 nMemberID, _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits