summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf147978_enhancedPath_commandABVW.odtbin0 -> 11581 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport17.cxx16
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport7.cxx24
-rw-r--r--sw/source/filter/ww8/docxsdrexport.cxx20
4 files changed, 31 insertions, 29 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf147978_enhancedPath_commandABVW.odt b/sw/qa/extras/ooxmlexport/data/tdf147978_enhancedPath_commandABVW.odt
new file mode 100644
index 000000000000..d9ef07db5920
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf147978_enhancedPath_commandABVW.odt
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx
index ea1d894f67ad..f23721767fc9 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx
@@ -266,6 +266,22 @@ DECLARE_OOXMLEXPORT_TEST(testTdf144668, "tdf144668.odt")
CPPUNIT_ASSERT_EQUAL(OUString("[001]"), getProperty<OUString>(xPara2, "ListLabelString"));
}
+CPPUNIT_TEST_FIXTURE(Test, testTdf147978enhancedPathABVW)
+{
+ load(DATA_DIRECTORY, "tdf147978_enhancedPath_commandABVW.odt");
+ CPPUNIT_ASSERT(mxComponent);
+ save("Office Open XML Text", maTempFile);
+ mxComponent->dispose();
+ mxComponent = loadFromDesktop(maTempFile.GetURL(), "com.sun.star.text.TextDocument");
+ // Make sure the new implemented export for commands A,B,V and W use the correct arc between
+ // the given two points, here the short one.
+ for (sal_Int16 i = 1 ; i <= 4; ++i)
+ {
+ uno::Reference<drawing::XShape> xShape = getShape(i);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(506), getProperty<awt::Rectangle>(xShape, "BoundRect").Height);
+ }
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx
index a16de671a6ba..2960f4a2c6c7 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx
@@ -1133,24 +1133,30 @@ CPPUNIT_TEST_FIXTURE(Test, testFlipAndRotateCustomShape)
CPPUNIT_ASSERT_EQUAL(1, getShapes());
CPPUNIT_ASSERT_EQUAL(1, getPages());
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
- // there should be no flipH and flipV attributes in this case
+ // there should be no flipH
assertXPathNoAttribute(pXmlDoc, "//a:xfrm", "flipH");
- assertXPathNoAttribute(pXmlDoc, "//a:xfrm", "flipV");
+ // flipV should be there
+ assertXPath(pXmlDoc, "//a:xfrm", "flipV", "1");
// check rotation angle
- assertXPath(pXmlDoc, "//a:xfrm", "rot", "13500000");
+ assertXPath(pXmlDoc, "//a:xfrm", "rot", "8100000");
+ // point values depend on path size, values as of March 2022
+ assertXPath(pXmlDoc, "//a:custGeom/a:pathLst/a:path", "w", "21600");
+ assertXPath(pXmlDoc, "//a:custGeom/a:pathLst/a:path", "h", "21600");
// check the first few coordinates of the polygon
CPPUNIT_ASSERT_DOUBLES_EQUAL(
- 2351, getXPath(pXmlDoc, "//a:custGeom/a:pathLst/a:path/a:lnTo[1]/a:pt", "x").toInt32(), 1);
+ 0, getXPath(pXmlDoc, "//a:custGeom/a:pathLst/a:path/a:moveTo/a:pt", "x").toInt32(), 1);
CPPUNIT_ASSERT_DOUBLES_EQUAL(
- 3171, getXPath(pXmlDoc, "//a:custGeom/a:pathLst/a:path/a:lnTo[1]/a:pt", "y").toInt32(), 1);
+ 15831, getXPath(pXmlDoc, "//a:custGeom/a:pathLst/a:path/a:moveTo/a:pt", "y").toInt32(), 1);
CPPUNIT_ASSERT_DOUBLES_EQUAL(
- 1695, getXPath(pXmlDoc, "//a:custGeom/a:pathLst/a:path/a:lnTo[2]/a:pt", "x").toInt32(), 1);
+ 6098, getXPath(pXmlDoc, "//a:custGeom/a:pathLst/a:path/a:lnTo[1]/a:pt", "x").toInt32(), 1);
CPPUNIT_ASSERT_DOUBLES_EQUAL(
- 3171, getXPath(pXmlDoc, "//a:custGeom/a:pathLst/a:path/a:lnTo[2]/a:pt", "y").toInt32(), 1);
+ 10062, getXPath(pXmlDoc, "//a:custGeom/a:pathLst/a:path/a:lnTo[1]/a:pt", "y").toInt32(), 1);
CPPUNIT_ASSERT_DOUBLES_EQUAL(
- 1695, getXPath(pXmlDoc, "//a:custGeom/a:pathLst/a:path/a:lnTo[3]/a:pt", "x").toInt32(), 1);
+ 13284, getXPath(pXmlDoc, "//a:custGeom/a:pathLst/a:path/a:lnTo[4]/a:pt", "x").toInt32(), 1);
CPPUNIT_ASSERT_DOUBLES_EQUAL(
- 1701, getXPath(pXmlDoc, "//a:custGeom/a:pathLst/a:path/a:lnTo[3]/a:pt", "y").toInt32(), 1);
+ 6098, getXPath(pXmlDoc, "//a:custGeom/a:pathLst/a:path/a:lnTo[4]/a:pt", "y").toInt32(), 1);
+ // check path is closed
+ assertXPath(pXmlDoc, "//a:close", 1);
}
CPPUNIT_TEST_FIXTURE(Test, testTdf92335)
diff --git a/sw/source/filter/ww8/docxsdrexport.cxx b/sw/source/filter/ww8/docxsdrexport.cxx
index 7166ed49565f..98257391c9cc 100644
--- a/sw/source/filter/ww8/docxsdrexport.cxx
+++ b/sw/source/filter/ww8/docxsdrexport.cxx
@@ -346,26 +346,6 @@ tools::Polygon lcl_CreateContourPolygon(SdrObject* pSdrObj)
basegfx::B2DHomMatrix aScale(basegfx::utils::createScaleB2DHomMatrix(fScaleX, fScaleY));
aPolyPolygon.transform(aScale);
- // ToDo: In some cases (see ShapeExport::WriteCustomShape()) flip is suppressed when
- // calling WriteShapeTransformation(), because the path in custGeom contains already
- // flipped coordinates. In such cases the wrap polygon needs to contain flipped
- // coordinates too. That is missing here.
-
- // "moon" and "msp-spt89" (up-right-arrow) are currently mirrored horizontally. But
- // that is removed on export in shapes.cxx. So need to remove it in wrap polygon too.
- uno::Reference<drawing::XShape> xShape(pSdrObj->getUnoShape(), uno::UNO_QUERY);
- uno::Reference<beans::XPropertySet> xProps(xShape, uno::UNO_QUERY);
- comphelper::SequenceAsHashMap aCustomShapeGeometry(
- xProps->getPropertyValue("CustomShapeGeometry"));
- auto it = aCustomShapeGeometry.find("Type");
- if (it != aCustomShapeGeometry.end()
- && (aCustomShapeGeometry["Type"].get<OUString>() == "moon"
- || aCustomShapeGeometry["Type"].get<OUString>() == "mso-spt89"))
- {
- basegfx::B2DHomMatrix aFlipH(basegfx::utils::createScaleB2DHomMatrix(-1.0, 1.0));
- aPolyPolygon.transform(aFlipH);
- }
-
basegfx::B2DHomMatrix aTranslateToCenter(
basegfx::utils::createTranslateB2DHomMatrix(10800.0, 10800.0));
aPolyPolygon.transform(aTranslateToCenter);