diff options
author | Regina Henschel <rb.henschel@t-online.de> | 2019-06-08 21:49:50 +0200 |
---|---|---|
committer | Regina Henschel <rb.henschel@t-online.de> | 2019-06-10 20:00:58 +0200 |
commit | 39599fc689364b70cf83e834a5742cc2181b13b0 (patch) | |
tree | 5fac8d65185a2a44fd507268226f6b14a30e6b82 /svx/qa | |
parent | c473c5b462f33df439b4b62b394c5d7811a05c7c (diff) |
tdf#125782 use correct 'current point' for quadraticcurveto
Use the same way to get the 'current point' as in
command arcangleto. The error was visible in shape teardrop.
Change-Id: Ie7af2b9111150bae7e3ea492eeb439a0cc2bfe7c
Reviewed-on: https://gerrit.libreoffice.org/73723
Tested-by: Jenkins
Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
Diffstat (limited to 'svx/qa')
-rw-r--r-- | svx/qa/unit/customshapes.cxx | 20 | ||||
-rw-r--r-- | svx/qa/unit/data/tdf125782_QuadraticCurveTo.odg | bin | 0 -> 9910 bytes |
2 files changed, 20 insertions, 0 deletions
diff --git a/svx/qa/unit/customshapes.cxx b/svx/qa/unit/customshapes.cxx index 6426d72ab970..b70a8e536218 100644 --- a/svx/qa/unit/customshapes.cxx +++ b/svx/qa/unit/customshapes.cxx @@ -393,6 +393,26 @@ CPPUNIT_TEST_FIXTURE(CustomshapesTest, testTdf115813_OOXML_XY_handle) } CPPUNIT_ASSERT_EQUAL(OUString(), sErrors); } + +CPPUNIT_TEST_FIXTURE(CustomshapesTest, testQuadraticCurveTo) +{ + // tdf125782 command Q (quadraticcurveto) uses wrong 'current point'. + // When converting to cubic Bezier curve, this had resulted in a wrong first control point. + // The quadraticcurveto segment starts in shape center in the test file. The first control + // point should produce a horizontal tangent in the start point. + const OUString sFileName("tdf125782_QuadraticCurveTo.odg"); + const OUString sURL = m_directories.getURLFromSrc(sDataDirectory) + sFileName; + mxComponent = loadFromDesktop(sURL, "com.sun.star.comp.drawing.DrawingDocument"); + CPPUNIT_ASSERT_MESSAGE("Could not load document", mxComponent.is()); + uno::Reference<drawing::XShape> xShape(getShape(0)); + uno::Reference<beans::XPropertySet> xShapeProps(xShape, uno::UNO_QUERY); + CPPUNIT_ASSERT_MESSAGE("Could not get the shape properties", xShapeProps.is()); + awt::Rectangle aBoundRect; + xShapeProps->getPropertyValue(UNO_NAME_MISC_OBJ_BOUNDRECT) >>= aBoundRect; + const double fHeight = static_cast<double>(aBoundRect.Height); + //Add some tolerance + CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("bad height of quadraticcurveto", 3004, fHeight, 10.0); +} } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/qa/unit/data/tdf125782_QuadraticCurveTo.odg b/svx/qa/unit/data/tdf125782_QuadraticCurveTo.odg Binary files differnew file mode 100644 index 000000000000..ba7b495367ce --- /dev/null +++ b/svx/qa/unit/data/tdf125782_QuadraticCurveTo.odg |