diff options
Diffstat (limited to 'sw/qa')
-rw-r--r-- | sw/qa/extras/rtfimport/data/tdf128611.rtf | 29 | ||||
-rw-r--r-- | sw/qa/extras/rtfimport/rtfimport.cxx | 19 |
2 files changed, 48 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfimport/data/tdf128611.rtf b/sw/qa/extras/rtfimport/data/tdf128611.rtf new file mode 100644 index 000000000000..207252cd8d26 --- /dev/null +++ b/sw/qa/extras/rtfimport/data/tdf128611.rtf @@ -0,0 +1,29 @@ +{\rtf1 +\paperw11906\paperh16838\margl1417\margr1417\margt1417\margb1417 +\pard\plain +{\shp +{\*\shpinst\shpleft-5\shptop248\shpright8933\shpbottom1838\shpfhdr0\shpbxmargin\shpbxignore\shpbymargin\shpbyignore\shpwr0\shpwrk0\shpfblwtxt0\shpz0\shplid1028 +{\sp +{\sn shapeType} +{\sv 20} +} +{\sp +{\sn fFlipH} +{\sv 0} +} +{\sp +{\sn fFlipV} +{\sv 1} +} +{\sp +{\sn posrelh} +{\sv 3} +} +} +{\shprslt +{\*\do\dobxmargin\dobymargin\dodhgt8192 +\dpline\dpptx8938\dppty0\dpptx0\dppty1590\dpx-5\dpy9248\dpxsize8938\dpysize1590\dplinew15\dplinecor0\dplinecog0\dplinecob0} +} +} +\par +} diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx index ce693e11f717..a88dddf2f086 100644 --- a/sw/qa/extras/rtfimport/rtfimport.cxx +++ b/sw/qa/extras/rtfimport/rtfimport.cxx @@ -903,6 +903,25 @@ CPPUNIT_TEST_FIXTURE(Test, testOleInline) getProperty<text::TextContentAnchorType>(getShape(1), "AnchorType")); } +CPPUNIT_TEST_FIXTURE(Test, testTdf128611) +{ + load(mpTestDocumentPath, "tdf128611.rtf"); + auto aPolyPolySequence + = getProperty<uno::Sequence<uno::Sequence<awt::Point>>>(getShape(1), "PolyPolygon"); + CPPUNIT_ASSERT(aPolyPolySequence.hasElements()); + uno::Sequence<awt::Point>& rPolygon = aPolyPolySequence[0]; + CPPUNIT_ASSERT_GREATER(static_cast<sal_uInt32>(1), rPolygon.size()); + sal_Int32 nY1 = rPolygon[0].Y; + sal_Int32 nY2 = rPolygon[1].Y; + + // Without the accompanying fix in place, this test would have failed with: + // - Expected greater than: 6242 + // - Actual : 3438 + // i.e. the vertical flip was missing, and the y1 > y2 assert failed, because the line pointed + // from top left to bottom right, not bottom left to top right. + CPPUNIT_ASSERT_GREATER(nY2, nY1); +} + CPPUNIT_TEST_FIXTURE(Test, testFdo80742) { load(mpTestDocumentPath, "fdo80742.rtf"); |