[Libreoffice-commits] core.git: Branch 'libreoffice-6-4' - sw/qa sw/source
Mark Hung (via logerrit)
logerrit at kemper.freedesktop.org
Fri Jan 17 16:17:44 UTC 2020
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 bc47eabad3f593aedd71307334fa50b222604bdd
Author: Mark Hung <marklh9 at gmail.com>
AuthorDate: Sat Dec 28 10:01:20 2019 +0800
Commit: Miklos Vajna <vmiklos at collabora.com>
CommitDate: Fri Jan 17 17:17:13 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 <vmiklos at collabora.com>
Signed-off-by: xisco <xiscofauli at libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86961
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 79601dfddcd5..921c7dcd1468 100644
--- a/sw/qa/extras/uiwriter/uiwriter2.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter2.cxx
@@ -2421,4 +2421,10 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testOfz18563)
TestImportDOCX(aFileStream);
}
+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,
More information about the Libreoffice-commits
mailing list