diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2020-05-14 15:42:43 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-05-15 08:42:04 +0200 |
commit | 36e62098c8c541c4a3fb63eced591cf29ac56e4a (patch) | |
tree | 2a8b87b9049338819e0cef1997d00fac3b56d135 /sw/qa/extras/unowriter | |
parent | 44006d2fdc67c1b2ff68407b16b4b4939012282c (diff) |
CppUnittest: sw: simplify code. use getShapes and getShape
Change-Id: I494349b99a122f67ed1f2881faf1a37e4358c55b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94214
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/qa/extras/unowriter')
-rw-r--r-- | sw/qa/extras/unowriter/unowriter.cxx | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/sw/qa/extras/unowriter/unowriter.cxx b/sw/qa/extras/unowriter/unowriter.cxx index 6e67892a027f..691d385d6de7 100644 --- a/sw/qa/extras/unowriter/unowriter.cxx +++ b/sw/qa/extras/unowriter/unowriter.cxx @@ -478,10 +478,8 @@ CPPUNIT_TEST_FIXTURE(SwUnoWriter, testDeleteFlyAtCharAtStart) CPPUNIT_ASSERT(rIDCO.InsertGraphicObject(*pWrtShell->GetCursor(), grf, &frameSet, &grfSet)); // check fly - uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference<drawing::XDrawPage> xDrawPage = xDrawPageSupplier->getDrawPage(); - CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xDrawPage->getCount()); - uno::Reference<text::XTextContent> const xShape(xDrawPage->getByIndex(0), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(1, getShapes()); + uno::Reference<text::XTextContent> const xShape(getShape(1), uno::UNO_QUERY); // anchored at start of body text? uno::Reference<text::XText> const xText(pTextDoc->getText()); uno::Reference<text::XTextRangeCompare> const xTextRC(xText, uno::UNO_QUERY); @@ -494,7 +492,7 @@ CPPUNIT_TEST_FIXTURE(SwUnoWriter, testDeleteFlyAtCharAtStart) xCursor->setString(""); // there is exactly one fly - CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xDrawPage->getCount()); + CPPUNIT_ASSERT_EQUAL(1, getShapes()); // select entire body text xCursor->gotoStart(true); @@ -502,7 +500,7 @@ CPPUNIT_TEST_FIXTURE(SwUnoWriter, testDeleteFlyAtCharAtStart) xCursor->setString(""); // there is no fly - CPPUNIT_ASSERT_EQUAL(sal_Int32(0), xDrawPage->getCount()); + CPPUNIT_ASSERT_EQUAL(0, getShapes()); } CPPUNIT_TEST_FIXTURE(SwUnoWriter, testSelectionInTableEnum) |