From 44f20abf66ce3f9806ad95522d7d9ae698350499 Mon Sep 17 00:00:00 2001 From: Regina Henschel Date: Sat, 13 Nov 2021 15:10:52 +0100 Subject: use new method too in existing unit tests in svdraw.cxx Commit 87e5cac has introduced a local method for a common part of the new unit tests. Identical parts are used in two existing unit tests. The patch replaces them with calls to the new method. Change-Id: I2945add642ac38048dd1fab4ffc3f2649a261650 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125168 Tested-by: Jenkins Reviewed-by: Regina Henschel --- svx/qa/unit/svdraw.cxx | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) (limited to 'svx/qa') diff --git a/svx/qa/unit/svdraw.cxx b/svx/qa/unit/svdraw.cxx index f213af12f7de..cab6b56b0ae7 100644 --- a/svx/qa/unit/svdraw.cxx +++ b/svx/qa/unit/svdraw.cxx @@ -127,19 +127,9 @@ CPPUNIT_TEST_FIXTURE(SvdrawTest, testSemiTransparentText) auto pDrawPage = dynamic_cast(xDrawPage.get()); CPPUNIT_ASSERT(pDrawPage); SdrPage* pSdrPage = pDrawPage->GetSdrPage(); - ScopedVclPtrInstance aVirtualDevice; - sdr::contact::ObjectContactOfObjListPainter aObjectContact(*aVirtualDevice, - { pSdrPage->GetObj(0) }, nullptr); - const sdr::contact::ViewObjectContact& rDrawPageVOContact - = pSdrPage->GetViewContact().GetViewObjectContact(aObjectContact); - sdr::contact::DisplayInfo aDisplayInfo; - drawinglayer::primitive2d::Primitive2DContainer xPrimitiveSequence; - rDrawPageVOContact.getPrimitive2DSequenceHierarchy(aDisplayInfo, xPrimitiveSequence); + xmlDocUniquePtr pDocument = lcl_dumpAndParseFirstObjectWithAssert(pSdrPage); // Make sure the text is semi-transparent. - drawinglayer::Primitive2dXmlDump aDumper; - xmlDocUniquePtr pDocument = aDumper.dumpAndParse(xPrimitiveSequence); - // Without the accompanying fix in place, this test would have failed with: // - Expected: 1 // - Actual : 0 @@ -401,19 +391,7 @@ CPPUNIT_TEST_FIXTURE(SvdrawTest, testFontWorks) auto pDrawPage = dynamic_cast(xDrawPage.get()); CPPUNIT_ASSERT(pDrawPage); SdrPage* pSdrPage = pDrawPage->GetSdrPage(); - - ScopedVclPtrInstance aVirtualDevice; - sdr::contact::ObjectContactOfObjListPainter aObjectContact(*aVirtualDevice, - { pSdrPage->GetObj(0) }, nullptr); - const auto& rDrawPageVOContact - = pSdrPage->GetViewContact().GetViewObjectContact(aObjectContact); - sdr::contact::DisplayInfo aDisplayInfo; - drawinglayer::primitive2d::Primitive2DContainer xPrimitiveSequence; - rDrawPageVOContact.getPrimitive2DSequenceHierarchy(aDisplayInfo, xPrimitiveSequence); - - drawinglayer::Primitive2dXmlDump aDumper; - xmlDocUniquePtr pXmlDoc = aDumper.dumpAndParse(xPrimitiveSequence); - CPPUNIT_ASSERT(pXmlDoc); + xmlDocUniquePtr pXmlDoc = lcl_dumpAndParseFirstObjectWithAssert(pSdrPage); assertXPath(pXmlDoc, "/primitive2D", 1); -- cgit v1.2.3