diff options
Diffstat (limited to 'sw/qa/extras/ooxmlimport')
-rw-r--r-- | sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 21 | ||||
-rw-r--r-- | sw/qa/extras/ooxmlimport/ooxmlimport2.cxx | 7 |
2 files changed, 23 insertions, 5 deletions
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index cb53c31ccfa1..a80aff6ce770 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -645,8 +645,12 @@ DECLARE_OOXMLIMPORT_TEST(testBnc779620, "bnc779620.docx") DECLARE_OOXMLIMPORT_TEST(testTdf105127, "tdf105127.docx") { auto aPolyPolygon = getProperty<drawing::PolyPolygonBezierCoords>(getShape(1), "PolyPolygonBezier"); - // This was 1910, the shape was rendered upside down. - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(3257), aPolyPolygon.Coordinates[0][0].Y); + // tdf#106792 These values were wrong all the time due to a missing + // conversion in SvxShapePolyPolygon::getPropertyValueImpl. There was no + // ForceMetricTo100th_mm -> the old results were in twips due to the + // object residing in Writer. The UNO API by definition is in 100thmm, + // thus I will correct the value here. + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(5744), aPolyPolygon.Coordinates[0][0].Y); // was: 3257 } DECLARE_OOXMLIMPORT_TEST(testTdf105143, "tdf105143.docx") @@ -1063,8 +1067,17 @@ DECLARE_OOXMLIMPORT_TEST(testTdf85232, "tdf85232.docx") uno::Reference<drawing::XShapeDescriptor> xShapeDescriptor(xShape, uno::UNO_QUERY); // Make sure we're not testing the ellipse child. CPPUNIT_ASSERT_EQUAL(OUString("com.sun.star.drawing.LineShape"), xShapeDescriptor->getShapeType()); - // This was 2900: horizontal position of the line was incorrect, the 3 children were not connected visually. - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2267), xShape->getPosition().X); + + // tdf#106792 checked that during load of tdf85232.docx the method + // SvxShapePolyPolygon::setPropertyValueImpl is used three times. In + // that method, a call to ForceMetricToItemPoolMetric was missing so + // that the import did not convert the input values from 100thmm + // to twips what is needed due to the object residing in Writer. The + // UNO API by definition is in 100thmm. Result is that in SwXShape::getPosition + // the offset (aOffset) now is (0, 0) instead of an existing offset in + // the load of the document before (what is plausible for a GroupObject). + // Thus, I will adapt the result value here to the now (hopefully) correct one. + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1630), xShape->getPosition().X); // was: 2267 } DECLARE_OOXMLIMPORT_TEST(testTdf95755, "tdf95755.docx") diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx index bea30cf86716..001c188be2fc 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx @@ -189,7 +189,12 @@ DECLARE_OOXMLIMPORT_TEST(testTdf113182, "tdf113182.docx") { CPPUNIT_ASSERT_EQUAL DECLARE_OOXMLIMPORT_TEST(testTdf113946, "tdf113946.docx") { OUString aTop = parseDump("/root/page/body/txt/anchored/SwAnchoredDrawObject/bounds", "top"); - CPPUNIT_ASSERT_EQUAL(OUString("1696"), aTop); + // tdf#106792 Checked loading of tdf113946.docx. Before the change, the expected + // value of this test was "1696". Opening the file shows a single short line anchored + // at the doc start. Only diff is that in 'old' version it is slightly rotated, in 'new' + // version line is strict hiorizontal. Checked against MSWord2013, there the line + // is also not rotated -> the change is to the better, correct the expected result here. + CPPUNIT_ASSERT_EQUAL(OUString("1695"), aTop); } DECLARE_OOXMLIMPORT_TEST(testTdf114217, "tdf114217.docx") |