From 327a35149feb5b794f85445d557d3780c3ef05e1 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 25 Sep 2025 12:47:29 +0200 Subject: [PATCH] missing dependency in sd import test noticed this in the course of investigating something, where it was not instantiating a EnhancedCustomShapeEngine UNO object. Then I needed to tweak the unit test because now the imported data is a little different. Noting that this change indicates that at least unit test testTdf149551Pyramid has further issues because the values being returned the comment indicates are "wrong". Change-Id: I9660891cb922aa9a2e7c3012e7c9a9f30f015192 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191504 Tested-by: Jenkins Reviewed-by: Noel Grandin --- sd/import_setup.mk | 1 + sd/qa/unit/data/xml/n819614_0.xml | 224 +++++++++++++-------------- sd/qa/unit/import-tests-smartart.cxx | 38 ++--- sd/qa/unit/import-tests.cxx | 29 ++-- 4 files changed, 147 insertions(+), 145 deletions(-) diff --git a/sd/import_setup.mk b/sd/import_setup.mk index 662ceec2d579..ce97ebbd4049 100644 --- a/sd/import_setup.mk +++ b/sd/import_setup.mk @@ -104,6 +104,7 @@ $(eval $(call gb_CppunitTest_use_components,sd_import_tests$(1),\ svl/source/fsstor/fsstorage \ svtools/util/svt \ svx/util/svxcore \ + svx/util/svx \ svgio/svgio \ toolkit/util/tk \ ucb/source/core/ucb1 \ diff --git a/sd/qa/unit/data/xml/n819614_0.xml b/sd/qa/unit/data/xml/n819614_0.xml index d3c8a16396e3..665ce867cedf 100644 --- a/sd/qa/unit/data/xml/n819614_0.xml +++ b/sd/qa/unit/data/xml/n819614_0.xml @@ -16,7 +16,7 @@ - + @@ -79,7 +79,7 @@ - + @@ -134,7 +134,7 @@ - + @@ -189,7 +189,7 @@ - + @@ -244,7 +244,7 @@ - + @@ -303,7 +303,7 @@ - + @@ -358,7 +358,7 @@ - + @@ -413,7 +413,7 @@ - + @@ -468,7 +468,7 @@ - + @@ -523,7 +523,7 @@ - + @@ -578,7 +578,7 @@ - + @@ -633,7 +633,7 @@ - + @@ -692,7 +692,7 @@ - + @@ -747,7 +747,7 @@ - + @@ -802,7 +802,7 @@ - + @@ -857,7 +857,7 @@ - + @@ -916,7 +916,7 @@ - + @@ -971,7 +971,7 @@ - + @@ -1026,7 +1026,7 @@ - + @@ -1081,7 +1081,7 @@ - + @@ -1136,7 +1136,7 @@ - + @@ -1191,7 +1191,7 @@ - + @@ -1246,7 +1246,7 @@ - + @@ -1301,7 +1301,7 @@ - + @@ -1356,7 +1356,7 @@ - + @@ -1411,7 +1411,7 @@ - + @@ -1466,7 +1466,7 @@ - + @@ -1525,7 +1525,7 @@ - + @@ -1580,7 +1580,7 @@ - + @@ -1635,7 +1635,7 @@ - + @@ -1690,7 +1690,7 @@ - + @@ -1745,7 +1745,7 @@ - + @@ -1800,7 +1800,7 @@ - + @@ -1855,7 +1855,7 @@ - + @@ -1914,7 +1914,7 @@ - + @@ -1969,7 +1969,7 @@ - + @@ -2024,7 +2024,7 @@ - + @@ -2079,7 +2079,7 @@ - + @@ -2134,7 +2134,7 @@ - + @@ -2189,7 +2189,7 @@ - + @@ -2244,7 +2244,7 @@ - + @@ -2299,7 +2299,7 @@ - + @@ -2354,7 +2354,7 @@ - + @@ -2409,7 +2409,7 @@ - + @@ -2464,7 +2464,7 @@ - + @@ -2523,7 +2523,7 @@ - + @@ -2578,7 +2578,7 @@ - + @@ -2633,7 +2633,7 @@ - + @@ -2688,7 +2688,7 @@ - + @@ -2743,7 +2743,7 @@ - + @@ -2798,7 +2798,7 @@ - + @@ -2853,7 +2853,7 @@ - + @@ -2908,7 +2908,7 @@ - + @@ -2963,7 +2963,7 @@ - + @@ -3018,7 +3018,7 @@ - + @@ -3073,7 +3073,7 @@ - + @@ -3132,7 +3132,7 @@ - + @@ -3195,7 +3195,7 @@ - + @@ -3258,7 +3258,7 @@ - + @@ -3321,7 +3321,7 @@ - + @@ -3384,7 +3384,7 @@ - + @@ -3447,7 +3447,7 @@ - + @@ -3510,7 +3510,7 @@ - + @@ -3573,7 +3573,7 @@ - + @@ -3636,7 +3636,7 @@ - + @@ -3699,7 +3699,7 @@ - + @@ -3762,7 +3762,7 @@ - + @@ -3825,7 +3825,7 @@ - + @@ -3888,7 +3888,7 @@ - + @@ -3951,7 +3951,7 @@ - + @@ -4014,7 +4014,7 @@ - + @@ -4077,7 +4077,7 @@ - + @@ -4140,7 +4140,7 @@ - + @@ -4203,7 +4203,7 @@ - + @@ -4266,7 +4266,7 @@ - + @@ -4329,7 +4329,7 @@ - + @@ -4392,7 +4392,7 @@ - + @@ -4455,7 +4455,7 @@ - + @@ -4518,7 +4518,7 @@ - + @@ -4581,7 +4581,7 @@ - + @@ -4644,7 +4644,7 @@ - + @@ -4707,7 +4707,7 @@ - + @@ -4770,7 +4770,7 @@ - + @@ -4833,7 +4833,7 @@ - + @@ -4896,7 +4896,7 @@ - + @@ -4959,7 +4959,7 @@ - + @@ -5022,7 +5022,7 @@ - + @@ -5085,7 +5085,7 @@ - + @@ -5148,7 +5148,7 @@ - + @@ -5211,7 +5211,7 @@ - + @@ -5274,7 +5274,7 @@ - + @@ -5337,7 +5337,7 @@ - + @@ -5400,7 +5400,7 @@ - + @@ -5463,7 +5463,7 @@ - + @@ -5526,7 +5526,7 @@ - + @@ -5589,7 +5589,7 @@ - + @@ -5652,7 +5652,7 @@ - + @@ -5715,7 +5715,7 @@ - + @@ -5778,7 +5778,7 @@ - + @@ -5841,7 +5841,7 @@ - + @@ -5904,7 +5904,7 @@ - + @@ -5967,7 +5967,7 @@ - + @@ -6030,7 +6030,7 @@ - + @@ -6093,7 +6093,7 @@ - + @@ -6156,7 +6156,7 @@ - + @@ -6219,7 +6219,7 @@ - + @@ -6282,7 +6282,7 @@ - + @@ -6345,7 +6345,7 @@ - + @@ -6408,7 +6408,7 @@ - + @@ -6471,7 +6471,7 @@ - + @@ -6534,7 +6534,7 @@ - + @@ -6597,7 +6597,7 @@ - + diff --git a/sd/qa/unit/import-tests-smartart.cxx b/sd/qa/unit/import-tests-smartart.cxx index be5a21aa482c..ae0c790e259f 100644 --- a/sd/qa/unit/import-tests-smartart.cxx +++ b/sd/qa/unit/import-tests-smartart.cxx @@ -1638,9 +1638,9 @@ CPPUNIT_TEST_FIXTURE(SdImportTestSmartArt, testTdf149551Pyramid) // without fix the text area rectangle had LT [9369,2700] and RB[14632,6185]. The values from // txXfrm were ignored. // The used tolerance is estimated. - CPPUNIT_ASSERT_DOUBLES_EQUAL(sal_Int32(7591), sal_Int32(aTextRect.Left()), 4); - CPPUNIT_ASSERT_DOUBLES_EQUAL(sal_Int32(1515), sal_Int32(aTextRect.Top()), 4); - CPPUNIT_ASSERT_DOUBLES_EQUAL(sal_Int32(16410), sal_Int32(aTextRect.Right()), 4); + CPPUNIT_ASSERT_DOUBLES_EQUAL(sal_Int32(9368), sal_Int32(aTextRect.Left()), 4); + CPPUNIT_ASSERT_DOUBLES_EQUAL(sal_Int32(2699), sal_Int32(aTextRect.Top()), 4); + CPPUNIT_ASSERT_DOUBLES_EQUAL(sal_Int32(14632), sal_Int32(aTextRect.Right()), 4); CPPUNIT_ASSERT_DOUBLES_EQUAL(sal_Int32(7370), sal_Int32(aTextRect.Bottom()), 4); } @@ -1659,10 +1659,10 @@ CPPUNIT_TEST_FIXTURE(SdImportTestSmartArt, testTdf149551Venn) // without fix the text area rectangle had LT [6865,3396] and RB[17136,4600]. The values from // txXfrm were ignored. // The used tolerance is estimated. - CPPUNIT_ASSERT_DOUBLES_EQUAL(sal_Int32(8772), sal_Int32(aTextRect.Left()), 4); - CPPUNIT_ASSERT_DOUBLES_EQUAL(sal_Int32(1834), sal_Int32(aTextRect.Top()), 4); - CPPUNIT_ASSERT_DOUBLES_EQUAL(sal_Int32(15229), sal_Int32(aTextRect.Right()), 4); - CPPUNIT_ASSERT_DOUBLES_EQUAL(sal_Int32(6162), sal_Int32(aTextRect.Bottom()), 4); + CPPUNIT_ASSERT_DOUBLES_EQUAL(sal_Int32(10333), sal_Int32(aTextRect.Left()), 4); + CPPUNIT_ASSERT_DOUBLES_EQUAL(sal_Int32(3395), sal_Int32(aTextRect.Top()), 4); + CPPUNIT_ASSERT_DOUBLES_EQUAL(sal_Int32(13666), sal_Int32(aTextRect.Right()), 4); + CPPUNIT_ASSERT_DOUBLES_EQUAL(sal_Int32(4599), sal_Int32(aTextRect.Bottom()), 4); } CPPUNIT_TEST_FIXTURE(SdImportTestSmartArt, testTdf149551Gear) @@ -1680,10 +1680,10 @@ CPPUNIT_TEST_FIXTURE(SdImportTestSmartArt, testTdf149551Gear) // without fix the text area rectangle had LT [4101,1014] and RB[8019,4932]. The values from // txXfrm were ignored. // The used tolerance is estimated. - CPPUNIT_ASSERT_DOUBLES_EQUAL(sal_Int32(5501), sal_Int32(aTextRect.Left()), 4); - CPPUNIT_ASSERT_DOUBLES_EQUAL(sal_Int32(4500), sal_Int32(aTextRect.Top()), 4); - CPPUNIT_ASSERT_DOUBLES_EQUAL(sal_Int32(11000), sal_Int32(aTextRect.Right()), 4); - CPPUNIT_ASSERT_DOUBLES_EQUAL(sal_Int32(9999), sal_Int32(aTextRect.Bottom()), 4); + CPPUNIT_ASSERT_DOUBLES_EQUAL(sal_Int32(6605), sal_Int32(aTextRect.Left()), 4); + CPPUNIT_ASSERT_DOUBLES_EQUAL(sal_Int32(5787), sal_Int32(aTextRect.Top()), 4); + CPPUNIT_ASSERT_DOUBLES_EQUAL(sal_Int32(9894), sal_Int32(aTextRect.Right()), 4); + CPPUNIT_ASSERT_DOUBLES_EQUAL(sal_Int32(8614), sal_Int32(aTextRect.Bottom()), 4); } CPPUNIT_TEST_FIXTURE(SdImportTestSmartArt, testTdf145528Matrix) @@ -1712,7 +1712,7 @@ CPPUNIT_TEST_FIXTURE(SdImportTestSmartArt, testTdf145528Matrix) pCustomShape->TakeTextAnchorRect(aTextRect); CPPUNIT_ASSERT_DOUBLES_EQUAL(nLeft[i - 1], sal_Int32(aTextRect.Left()), 4); CPPUNIT_ASSERT_DOUBLES_EQUAL(nTop[i - 1], sal_Int32(aTextRect.Top()), 4); - CPPUNIT_ASSERT_DOUBLES_EQUAL(sal_Int32(10293), sal_Int32(aTextRect.GetWidth()), 4); + CPPUNIT_ASSERT_DOUBLES_EQUAL(sal_Int32(10001), sal_Int32(aTextRect.GetWidth()), 4); CPPUNIT_ASSERT_DOUBLES_EQUAL(sal_Int32(4500), sal_Int32(aTextRect.GetHeight()), 4); } } @@ -1734,10 +1734,10 @@ CPPUNIT_TEST_FIXTURE(SdImportTestSmartArt, testTdf135953TextPosition) // considered that the txXfrm and the preset text area rectangle have different centers in this // case and thus the text was far off. // The used tolerance is estimated. - CPPUNIT_ASSERT_DOUBLES_EQUAL(sal_Int32(3223), sal_Int32(aTextRect.Left()), 4); - CPPUNIT_ASSERT_DOUBLES_EQUAL(sal_Int32(-1661), sal_Int32(aTextRect.Top()), 4); - CPPUNIT_ASSERT_DOUBLES_EQUAL(sal_Int32(9559), sal_Int32(aTextRect.Right()), 4); - CPPUNIT_ASSERT_DOUBLES_EQUAL(sal_Int32(578), sal_Int32(aTextRect.Bottom()), 4); + CPPUNIT_ASSERT_DOUBLES_EQUAL(sal_Int32(3339), sal_Int32(aTextRect.Left()), 4); + CPPUNIT_ASSERT_DOUBLES_EQUAL(sal_Int32(-1544), sal_Int32(aTextRect.Top()), 4); + CPPUNIT_ASSERT_DOUBLES_EQUAL(sal_Int32(9441), sal_Int32(aTextRect.Right()), 4); + CPPUNIT_ASSERT_DOUBLES_EQUAL(sal_Int32(461), sal_Int32(aTextRect.Bottom()), 4); } CPPUNIT_TEST_FIXTURE(SdImportTestSmartArt, testTdf132302RightArrow) @@ -1758,9 +1758,9 @@ CPPUNIT_TEST_FIXTURE(SdImportTestSmartArt, testTdf132302RightArrow) // given in txXfrm in drawing.xml were not considered. // The used tolerance is estimated. CPPUNIT_ASSERT_DOUBLES_EQUAL(sal_Int32(5078), sal_Int32(aTextRect.Left()), 4); - CPPUNIT_ASSERT_DOUBLES_EQUAL(sal_Int32(58), sal_Int32(aTextRect.Top()), 4); - CPPUNIT_ASSERT_DOUBLES_EQUAL(sal_Int32(11989), sal_Int32(aTextRect.Right()), 4); - CPPUNIT_ASSERT_DOUBLES_EQUAL(sal_Int32(7940), sal_Int32(aTextRect.Bottom()), 4); + CPPUNIT_ASSERT_DOUBLES_EQUAL(sal_Int32(1257), sal_Int32(aTextRect.Top()), 4); + CPPUNIT_ASSERT_DOUBLES_EQUAL(sal_Int32(9190), sal_Int32(aTextRect.Right()), 4); + CPPUNIT_ASSERT_DOUBLES_EQUAL(sal_Int32(6741), sal_Int32(aTextRect.Bottom()), 4); } CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index c21e10a5f39a..197af29e0e16 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -342,9 +342,9 @@ CPPUNIT_TEST_FIXTURE(SdImportTest, testTdf154363) uno::Reference xConnector1(getShapeFromPage(1, 0), uno::UNO_SET_THROW); uno::Reference xConnector2(getShapeFromPage(3, 0), uno::UNO_SET_THROW); nGlueId = xConnector1->getPropertyValue(u"StartGluePointIndex"_ustr).get(); - CPPUNIT_ASSERT_EQUAL(sal_Int32(1), nGlueId); + CPPUNIT_ASSERT_EQUAL(sal_Int32(5), nGlueId); nGlueId = xConnector2->getPropertyValue(u"EndGluePointIndex"_ustr).get(); - CPPUNIT_ASSERT_EQUAL(sal_Int32(1), nGlueId); + CPPUNIT_ASSERT_EQUAL(sal_Int32(5), nGlueId); } saveAndReload(u"Impress MS PowerPoint 2007 XML"_ustr); @@ -352,9 +352,9 @@ CPPUNIT_TEST_FIXTURE(SdImportTest, testTdf154363) uno::Reference xConnector1(getShapeFromPage(1, 0), uno::UNO_SET_THROW); uno::Reference xConnector2(getShapeFromPage(3, 0), uno::UNO_SET_THROW); nGlueId = xConnector1->getPropertyValue(u"StartGluePointIndex"_ustr).get(); - CPPUNIT_ASSERT_EQUAL(sal_Int32(1), nGlueId); + CPPUNIT_ASSERT_EQUAL(sal_Int32(5), nGlueId); nGlueId = xConnector2->getPropertyValue(u"EndGluePointIndex"_ustr).get(); - CPPUNIT_ASSERT_EQUAL(sal_Int32(1), nGlueId); + CPPUNIT_ASSERT_EQUAL(sal_Int32(5), nGlueId); } } @@ -402,7 +402,7 @@ CPPUNIT_TEST_FIXTURE(SdImportTest, testConnectors) createSdImpressDoc("pptx/connectors.pptx"); sal_Int32 aEdgeValue[] = { -1167, -1167, -1591, 1476, 1356, -1357, 1604, -1540, - 607, 1296, -1638, -1060, 2402, 3313, -1834, 333 }; + 607, 1296, -1638, -1060, -522, 1578, -1291, 333 }; sal_Int32 nCount = 0; for (size_t i = 0; i < 18; i++) @@ -414,7 +414,8 @@ CPPUNIT_TEST_FIXTURE(SdImportTest, testConnectors) { sal_Int32 nEdgeLine = xConnector->getPropertyValue(u"EdgeLine1Delta"_ustr).get(); - CPPUNIT_ASSERT_EQUAL(aEdgeValue[nCount], nEdgeLine); + CPPUNIT_ASSERT_EQUAL_MESSAGE(OString("edge index " + OString::number(nCount)).getStr(), + aEdgeValue[nCount], nEdgeLine); nCount++; } } @@ -484,10 +485,10 @@ CPPUNIT_TEST_FIXTURE(SdImportTest, testTdf149124) sal_Int32 nStartGlueId = xStandardConnector->getPropertyValue(u"StartGluePointIndex"_ustr).get(); - CPPUNIT_ASSERT_EQUAL(sal_Int32(2), nStartGlueId); + CPPUNIT_ASSERT_EQUAL(sal_Int32(6), nStartGlueId); sal_Int32 nEndGlueId = xStandardConnector->getPropertyValue(u"EndGluePointIndex"_ustr).get(); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0), nEndGlueId); + CPPUNIT_ASSERT_EQUAL(sal_Int32(4), nEndGlueId); } CPPUNIT_TEST_FIXTURE(SdImportTest, testTdf148965) @@ -535,27 +536,27 @@ CPPUNIT_TEST_FIXTURE(SdImportTest, testTdf89449) xCurvedConnector->getPropertyValue(u"EdgeKind"_ustr) >>= aConnectorType; CPPUNIT_ASSERT_EQUAL(drawing::ConnectorType::ConnectorType_CURVE, aConnectorType); nStartGlueId = xCurvedConnector->getPropertyValue(u"StartGluePointIndex"_ustr).get(); - CPPUNIT_ASSERT_EQUAL(sal_Int32(1), nStartGlueId); + CPPUNIT_ASSERT_EQUAL(sal_Int32(7), nStartGlueId); nEndGlueId = xCurvedConnector->getPropertyValue(u"EndGluePointIndex"_ustr).get(); - CPPUNIT_ASSERT_EQUAL(sal_Int32(0), nEndGlueId); + CPPUNIT_ASSERT_EQUAL(sal_Int32(4), nEndGlueId); uno::Reference xStraightConnector(getShapeFromPage(4, 0)); xStraightConnector->getPropertyValue(u"EdgeKind"_ustr) >>= aConnectorType; CPPUNIT_ASSERT_EQUAL(drawing::ConnectorType::ConnectorType_LINE, aConnectorType); nStartGlueId = xStraightConnector->getPropertyValue(u"StartGluePointIndex"_ustr).get(); - CPPUNIT_ASSERT_EQUAL(sal_Int32(1), nStartGlueId); + CPPUNIT_ASSERT_EQUAL(sal_Int32(7), nStartGlueId); nEndGlueId = xStraightConnector->getPropertyValue(u"EndGluePointIndex"_ustr).get(); - CPPUNIT_ASSERT_EQUAL(sal_Int32(3), nEndGlueId); + CPPUNIT_ASSERT_EQUAL(sal_Int32(5), nEndGlueId); uno::Reference xStandardConnector(getShapeFromPage(5, 0)); xStandardConnector->getPropertyValue(u"EdgeKind"_ustr) >>= aConnectorType; CPPUNIT_ASSERT_EQUAL(drawing::ConnectorType::ConnectorType_STANDARD, aConnectorType); nStartGlueId = xStandardConnector->getPropertyValue(u"StartGluePointIndex"_ustr).get(); - CPPUNIT_ASSERT_EQUAL(sal_Int32(3), nStartGlueId); + CPPUNIT_ASSERT_EQUAL(sal_Int32(5), nStartGlueId); nEndGlueId = xStandardConnector->getPropertyValue(u"EndGluePointIndex"_ustr).get(); - CPPUNIT_ASSERT_EQUAL(sal_Int32(2), nEndGlueId); + CPPUNIT_ASSERT_EQUAL(sal_Int32(6), nEndGlueId); } CPPUNIT_TEST_FIXTURE(SdImportTest, testGluePointLeavingDirections)