summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorJustin Luth <justin.luth@collabora.com>2024-03-05 19:05:29 -0500
committerMiklos Vajna <vmiklos@collabora.com>2024-03-06 11:22:31 +0100
commite0ef7d54b4e4ccbaaada5d2c4a42ba41d961ea69 (patch)
treeb5d6e6b29afc56baef48b295c787b0f6f3c9c085 /sw
parent0d94f6c90788b1d9e90afb3314ffe165c2eafb96 (diff)
tdf#160049 oox import: use margins with left/right HoriOrientRelation
I'm really surprised this wasn't found much earlier. Even DOC format isn't handling this. make CppunitTest_sw_ooxmlexport21 \ CPPUNIT_TEST_NAME=testTdf160049_anchorMarginVML Change-Id: I92ee8eceb6c6bab5f027663bae94d7acdf01be3d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164442 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf160049_anchorMarginVML.docxbin0 -> 76531 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport21.cxx13
2 files changed, 13 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf160049_anchorMarginVML.docx b/sw/qa/extras/ooxmlexport/data/tdf160049_anchorMarginVML.docx
new file mode 100644
index 000000000000..f8cb262f53c8
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf160049_anchorMarginVML.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx
index 2e6c10c99031..d045e18efa32 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx
@@ -13,6 +13,7 @@
#include <com/sun/star/awt/Gradient2.hpp>
#include <com/sun/star/beans/XPropertyState.hpp>
#include <com/sun/star/drawing/FillStyle.hpp>
+#include <com/sun/star/text/RelOrientation.hpp>
#include <com/sun/star/text/XDocumentIndex.hpp>
#include <com/sun/star/text/XTextTable.hpp>
#include <com/sun/star/style/LineSpacing.hpp>
@@ -292,6 +293,18 @@ DECLARE_OOXMLEXPORT_TEST(testTdf158597, "tdf158597.docx")
}
}
+DECLARE_OOXMLEXPORT_TEST(testTdf160049_anchorMarginVML, "tdf160049_anchorMarginVML.docx")
+{
+ // given a VML (Word 2003) document with a LEFT "column/text" anchored image
+ // (which will import as DML compat12 on the round-trip)
+ if (isExported())
+ return;
+ // The image takes into account the margin, so it looks like it is in the middle of the doc,
+ // which is "Paragraph text area"/PRINT_AREA/1, not "Entire paragraph area"/FRAME/0
+ CPPUNIT_ASSERT_EQUAL(css::text::RelOrientation::PRINT_AREA,
+ getProperty<sal_Int16>(getShape(1), "HoriOrientRelation"));
+}
+
DECLARE_OOXMLEXPORT_TEST(testTdf153909_followTextFlow, "tdf153909_followTextFlow.docx")
{
// Although MSO's UI reports "layoutInCell" for the rectangle, it isn't specified or honored