diff options
author | Mark Hung <marklh9@gmail.com> | 2019-12-28 10:01:20 +0800 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2020-01-13 16:31:04 +0100 |
commit | 340b0eedaac17ff26799b09f6bbb2b115712e2d5 (patch) | |
tree | d20cf60c25d7f8ccfab1106f0b90708683aecef4 /sw/source | |
parent | b56e0d7f7fb9f1ca9295ac2ba540a3cf778324b9 (diff) |
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 <vmiklos@collabora.com>
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/core/doc/textboxhelper.cxx | 10 |
1 files changed, 10 insertions, 0 deletions
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, |