diff options
author | Regina Henschel <rb.henschel@t-online.de> | 2022-05-05 17:31:39 +0200 |
---|---|---|
committer | Regina Henschel <rb.henschel@t-online.de> | 2022-05-05 21:27:15 +0200 |
commit | 124382eba6aaeb475b4077920c082bf5c51ac029 (patch) | |
tree | 5439d5d1668b53a18a1cb1a056e43bc06f688f9e /svx/qa/unit | |
parent | cf7e3ac040d1249f6df0d6796e11d834285680f0 (diff) |
tdf#148707 implicit moveTo on all not only on first
The current solution checks implicit moveTo only on the first arc in
a sequence of arcs. The patch moves it into the loop, so that the
implicit moveTo is done for each command in a sequence.
Change-Id: I400fa8fc96d7377ede55296c71e7a82ce891cc24
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133896
Tested-by: Jenkins
Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
Diffstat (limited to 'svx/qa/unit')
-rw-r--r-- | svx/qa/unit/customshapes.cxx | 23 | ||||
-rw-r--r-- | svx/qa/unit/data/tdf148707_two_commands_B_V.odp | bin | 0 -> 13389 bytes |
2 files changed, 23 insertions, 0 deletions
diff --git a/svx/qa/unit/customshapes.cxx b/svx/qa/unit/customshapes.cxx index 62e7728f7556..0b1970378e2a 100644 --- a/svx/qa/unit/customshapes.cxx +++ b/svx/qa/unit/customshapes.cxx @@ -1377,6 +1377,29 @@ CPPUNIT_TEST_FIXTURE(CustomshapesTest, testTdf148714_CurvedArrows) } } } + +CPPUNIT_TEST_FIXTURE(CustomshapesTest, testTdf148707_two_commands_B_V) +{ + // tdf148707 custom shape with multiple command B or multiple command V were drawn with a line + // between the arcs as if the second command was a A or W respectively. + // The test document has a shape with path "V 0 0 50 100 0 50 25 0 50 0 100 100 75 0 100 50 N" + // and a shape with path "B 0 0 50 100 0 50 25 100 50 0 100 100 75 100 100 50 N". + OUString sURL = m_directories.getURLFromSrc(sDataDirectory) + "tdf148707_two_commands_B_V.odp"; + mxComponent = loadFromDesktop(sURL, "com.sun.star.comp.drawing.DrawingDocument"); + for (sal_uInt8 i = 0; i < 2; i++) + { + uno::Reference<drawing::XShape> xShape(getShape(i)); + // In case no line is drawn, two polygons are generated; with line only one polygon + SdrObjCustomShape& rSdrObjCustomShape( + static_cast<SdrObjCustomShape&>(*SdrObject::getSdrObjectFromXShape(xShape))); + EnhancedCustomShape2d aCustomShape2d(rSdrObjCustomShape); + SdrPathObjUniquePtr pPathObj( + static_cast<SdrPathObj*>(aCustomShape2d.CreateLineGeometry().release())); + CPPUNIT_ASSERT_MESSAGE("Could not convert to SdrPathObj", pPathObj); + const basegfx::B2DPolyPolygon aPolyPolygon(pPathObj->GetPathPoly()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("count polygons", sal_uInt32(2), aPolyPolygon.count()); + } +} } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/qa/unit/data/tdf148707_two_commands_B_V.odp b/svx/qa/unit/data/tdf148707_two_commands_B_V.odp Binary files differnew file mode 100644 index 000000000000..c26d371ef6a9 --- /dev/null +++ b/svx/qa/unit/data/tdf148707_two_commands_B_V.odp |