diff --git a/cpp.hint b/cpp.hint index 727243a3f966..06d157563d7f 100644 --- a/cpp.hint +++ b/cpp.hint @@ -58,5 +58,4 @@ #define DECLARE_OOXMLEXPORT_TEST(TestName, filename) DECLARE_SW_ROUNDTRIP_TEST(TestName, filename, nullptr, Test) #define DECLARE_ODFEXPORT_TEST(TestName, filename) DECLARE_SW_ROUNDTRIP_TEST(TestName, filename, nullptr, Test) -#define DECLARE_FODFEXPORT_TEST(TestName, filename) DECLARE_SW_ROUNDTRIP_TEST(TestName, filename, nullptr, Test) #define DECLARE_WW8EXPORT_TEST(TestName, filename) DECLARE_SW_ROUNDTRIP_TEST(TestName, filename, nullptr, Test) diff --git a/sw/qa/extras/fodfexport/fodfexport.cxx b/sw/qa/extras/fodfexport/fodfexport.cxx index 0eddb6809609..a24c0c6d63b0 100644 --- a/sw/qa/extras/fodfexport/fodfexport.cxx +++ b/sw/qa/extras/fodfexport/fodfexport.cxx @@ -57,28 +57,34 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf113696WriterImage) "draw:image[@draw:mime-type='image/png']"); } -DECLARE_FODFEXPORT_TEST(testSvgImageRoundtrip, "SvgImageTest.fodt") +CPPUNIT_TEST_FIXTURE(Test, testSvgImageRoundtrip) { // Related to tdf#123396 + auto verify = [this]() { + // We should have one image (shape) + CPPUNIT_ASSERT_EQUAL(1, getShapes()); - // We should have one image (shape) - CPPUNIT_ASSERT_EQUAL(1, getShapes()); + // Get the shape and extract the Graphic + uno::Reference xShape = getShape(1); + uno::Reference XPropertySet(xShape, uno::UNO_QUERY_THROW); + CPPUNIT_ASSERT(XPropertySet.is()); + uno::Reference xGraphic; + XPropertySet->getPropertyValue(u"Graphic"_ustr) >>= xGraphic; + CPPUNIT_ASSERT(xGraphic.is()); + Graphic aGraphic(xGraphic); - // Get the shape and extract the Graphic - uno::Reference xShape = getShape(1); - uno::Reference XPropertySet(xShape, uno::UNO_QUERY_THROW); - CPPUNIT_ASSERT(XPropertySet.is()); - uno::Reference xGraphic; - XPropertySet->getPropertyValue(u"Graphic"_ustr) >>= xGraphic; - CPPUNIT_ASSERT(xGraphic.is()); - Graphic aGraphic(xGraphic); + // The graphic should be SVG - so should contain a VectorGraphicData + auto const& pVectorGraphicData = aGraphic.getVectorGraphicData(); + CPPUNIT_ASSERT(pVectorGraphicData); - // The graphic should be SVG - so should contain a VectorGraphicData - auto const& pVectorGraphicData = aGraphic.getVectorGraphicData(); - CPPUNIT_ASSERT(pVectorGraphicData); + // The VectorGraphicData type should be SVG + CPPUNIT_ASSERT_EQUAL(VectorGraphicDataType::Svg, pVectorGraphicData->getType()); + }; - // The VectorGraphicData type should be SVG - CPPUNIT_ASSERT_EQUAL(VectorGraphicDataType::Svg, pVectorGraphicData->getType()); + createSwDoc("SvgImageTest.fodt"); + verify(); + saveAndReload(mpFilter); + verify(); } } // end of anonymous namespace diff --git a/sw/qa/inc/swmodeltestbase.hxx b/sw/qa/inc/swmodeltestbase.hxx index e31bcf48860f..765e72002001 100644 --- a/sw/qa/inc/swmodeltestbase.hxx +++ b/sw/qa/inc/swmodeltestbase.hxx @@ -57,7 +57,6 @@ #define DECLARE_OOXMLEXPORT_TEST(TestName, filename) DECLARE_SW_ROUNDTRIP_TEST(TestName, filename, nullptr, Test) #define DECLARE_ODFEXPORT_TEST(TestName, filename) DECLARE_SW_ROUNDTRIP_TEST(TestName, filename, nullptr, Test) -#define DECLARE_FODFEXPORT_TEST(TestName, filename) DECLARE_SW_ROUNDTRIP_TEST(TestName, filename, nullptr, Test) #define DECLARE_WW8EXPORT_TEST(TestName, filename) DECLARE_SW_ROUNDTRIP_TEST(TestName, filename, nullptr, Test) class SwXTextDocument;