summaryrefslogtreecommitdiff
path: root/svx/qa
diff options
context:
space:
mode:
authorRegina Henschel <rb.henschel@t-online.de>2021-11-13 15:10:52 +0100
committerRegina Henschel <rb.henschel@t-online.de>2021-11-13 18:42:09 +0100
commit44f20abf66ce3f9806ad95522d7d9ae698350499 (patch)
tree31b3eac4f8169cffc68ba81e7153b6ffc1e26732 /svx/qa
parent97ef7881cec4f7baa1ef8e7b6b84b6848f8c5f4a (diff)
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 <rb.henschel@t-online.de>
Diffstat (limited to 'svx/qa')
-rw-r--r--svx/qa/unit/svdraw.cxx26
1 files changed, 2 insertions, 24 deletions
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<SvxDrawPage*>(xDrawPage.get());
CPPUNIT_ASSERT(pDrawPage);
SdrPage* pSdrPage = pDrawPage->GetSdrPage();
- ScopedVclPtrInstance<VirtualDevice> 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<SvxDrawPage*>(xDrawPage.get());
CPPUNIT_ASSERT(pDrawPage);
SdrPage* pSdrPage = pDrawPage->GetSdrPage();
-
- ScopedVclPtrInstance<VirtualDevice> 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);