summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2019-08-08 20:32:23 +0200
committerMiklos Vajna <vmiklos@collabora.com>2019-08-09 09:10:33 +0200
commit29bd64dd93150cfbec646f5af7c75996fd15d8e5 (patch)
tree9b35c1f50c3b5259ee312daba8c32b5d8288af4d /sw
parent8387a6db641b29e6ff3c2f4cdc4688f538cbe35f (diff)
sw btlr writing mode: handle DOC export of textframes
DOC import is somewhat working: the rendering result is OK, but it would be rather better to convert the btlr direction to a Writer text frame as well, later. Change-Id: I37ad2e8b70c5eef655c1f00922360c0105a69158 Reviewed-on: https://gerrit.libreoffice.org/77175 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/ww8export/data/btlr-frame.odtbin0 -> 8564 bytes
-rw-r--r--sw/qa/extras/ww8export/ww8export3.cxx14
-rw-r--r--sw/source/filter/ww8/wrtw8esh.cxx3
3 files changed, 17 insertions, 0 deletions
diff --git a/sw/qa/extras/ww8export/data/btlr-frame.odt b/sw/qa/extras/ww8export/data/btlr-frame.odt
new file mode 100644
index 000000000000..31cb03849c53
--- /dev/null
+++ b/sw/qa/extras/ww8export/data/btlr-frame.odt
Binary files differ
diff --git a/sw/qa/extras/ww8export/ww8export3.cxx b/sw/qa/extras/ww8export/ww8export3.cxx
index a38424cc3ce1..b8a6d4056d13 100644
--- a/sw/qa/extras/ww8export/ww8export3.cxx
+++ b/sw/qa/extras/ww8export/ww8export3.cxx
@@ -294,6 +294,20 @@ DECLARE_WW8EXPORT_TEST(testTdf126708emf, "tdf126708_containsemf.odt")
CPPUNIT_ASSERT(abs(xSize.Width - 17000) <= 6);
}
+DECLARE_WW8EXPORT_TEST(testBtlrFrame, "btlr-frame.odt")
+{
+ if (!mbExported)
+ {
+ return;
+ }
+
+ // Without the accompanying fix in place, this test would have failed with a
+ // beans.UnknownPropertyException, as the writing direction was lost, so the default direction
+ // resulted in a conversion to a Writer text frame.
+ uno::Reference<beans::XPropertySet> xFrame(getShape(1), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(9000), getProperty<sal_Int32>(xFrame, "RotateAngle"));
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx
index 919ff1fd46b0..422e007a1cbc 100644
--- a/sw/source/filter/ww8/wrtw8esh.cxx
+++ b/sw/source/filter/ww8/wrtw8esh.cxx
@@ -2882,6 +2882,9 @@ sal_Int32 SwEscherEx::WriteTextFlyFrame(const DrawObj &rObj, sal_uInt32 nShapeId
case SvxFrameDirection::Vertical_RL_TB:
nFlow=mso_txflTtoBA;
break;
+ case SvxFrameDirection::Vertical_LR_BT:
+ nFlow = mso_txflBtoT;
+ break;
}
aPropOpt.AddOpt( ESCHER_Prop_txflTextFlow, nFlow );