summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorBakos Attila <bakos.attilakaroly@nisz.hu>2020-01-16 13:45:47 +0100
committerLászló Németh <nemeth@numbertext.org>2020-01-20 08:35:11 +0100
commit47bc0ff1ad0f07b07a75f55d3bb898e113a415b2 (patch)
treec1295dc38d1bbd75c52a9d2e200af3f8e4d4372a /sw
parenta86fcb4461cc0e3d309f439247f3efea4c057155 (diff)
tdf#129888 DOCX shape import: handle o:allowincell
(VML) and layoutInCell (DrawingML) attributes to fix regressions caused by commit 10f29d8bf05d44ca8bc11d34d1294ec17f8ac0f1 (tdf#87569 tdf#109411 DOCX import: fix shape anchor in tables). Position of shapes anchored to tables is calculated from the cell margin only if the previous attributes allow that. Change-Id: Ifcfcb7f4959aea522dd45dff00cefd1bb9f4edda Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86922 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org> Signed-off-by: xisco <xiscofauli@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86980 Reviewed-by: Attila Bakos <bakos.attilakaroly@nisz.hu>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf129888dml.docxbin0 -> 17003 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf129888vml.docxbin0 -> 17979 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport14.cxx28
3 files changed, 28 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf129888dml.docx b/sw/qa/extras/ooxmlexport/data/tdf129888dml.docx
new file mode 100644
index 000000000000..1f6b03034fda
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf129888dml.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/data/tdf129888vml.docx b/sw/qa/extras/ooxmlexport/data/tdf129888vml.docx
new file mode 100644
index 000000000000..ee7c60f8a8dc
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf129888vml.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
index 516d65d9bcb8..bb9e3932320f 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
@@ -42,6 +42,34 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf128207, "tdf128207.docx")
assertXPathContent(p_XmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:drawing/wp:anchor/wp:positionH/wp:posOffset", "4445");
}
+DECLARE_OOXMLIMPORT_TEST(testTdf129888vml, "tdf129888vml.docx")
+{
+ //the line shape has anchor in the first cell however it has to
+ //be positioned to an another cell. To reach this we must handle
+ //the o:allowincell attribute of the shape, and its position has
+ //to be calculated from the page frame instead of the table:
+
+ uno::Reference<beans::XPropertySet> xShapeProperties(getShape(1), uno::UNO_QUERY);
+ sal_Int16 nValue;
+ xShapeProperties->getPropertyValue("HoriOrientRelation") >>= nValue;
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("tdf129888vml The line shape has bad place!",
+ text::RelOrientation::PAGE_FRAME, nValue);
+}
+
+DECLARE_OOXMLIMPORT_TEST(testTdf129888dml, "tdf129888dml.docx")
+{
+ //the shape has anchor in the first cell however it has to
+ //be positioned to the right side of the page. To reach this we must handle
+ //the layoutInCell attribute of the shape, and its position has
+ //to be calculated from the page frame instead of the table:
+
+ uno::Reference<beans::XPropertySet> xShapeProperties(getShape(1), uno::UNO_QUERY);
+ sal_Int16 nValue;
+ xShapeProperties->getPropertyValue("HoriOrientRelation") >>= nValue;
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("tdf129888dml The shape has bad place!",
+ text::RelOrientation::PAGE_FRAME, nValue);
+}
+
DECLARE_OOXMLEXPORT_TEST(testTdf87569v, "tdf87569_vml.docx")
{
//the original tdf87569 sample has vml shapes...