summaryrefslogtreecommitdiff
path: root/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2020-05-14 15:42:43 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-05-15 08:42:04 +0200
commit36e62098c8c541c4a3fb63eced591cf29ac56e4a (patch)
tree2a8b87b9049338819e0cef1997d00fac3b56d135 /sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
parent44006d2fdc67c1b2ff68407b16b4b4939012282c (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/ooxmlexport/ooxmlexport4.cxx')
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport4.cxx15
1 files changed, 3 insertions, 12 deletions
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
index f90bc6d357d7..00976d2c3022 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
@@ -68,10 +68,8 @@ DECLARE_OOXMLEXPORT_TEST(testRelorientation, "relorientation.docx")
DECLARE_OOXMLEXPORT_TEST(testBezier, "bezier.odt")
{
CPPUNIT_ASSERT_EQUAL(1, getPages());
- uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY);
- uno::Reference<container::XIndexAccess> xDraws = xDrawPageSupplier->getDrawPage();
// Check that no shape got lost: a bezier, a line and a text shape.
- CPPUNIT_ASSERT_EQUAL(sal_Int32(3), xDraws->getCount());
+ CPPUNIT_ASSERT_EQUAL(3, getShapes());
}
DECLARE_OOXMLEXPORT_TEST(testGroupshapeTextbox, "groupshape-textbox.docx")
@@ -406,12 +404,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testChartInFooter, "chart-in-footer.docx")
"rId1");
uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY);
- if (xDrawPageSupplier.is())
- {
- // If xDrawPage->getCount()==1, then document contains one shape.
- uno::Reference<container::XIndexAccess> xDrawPage = xDrawPageSupplier->getDrawPage();
- CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xDrawPage->getCount()); // One shape in the doc
- }
+ CPPUNIT_ASSERT_EQUAL(1, getShapes());
}
DECLARE_OOXMLEXPORT_TEST(testNestedTextFrames, "nested-text-frames.odt")
@@ -461,9 +454,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testAbi11739, "abi11739.docx")
DECLARE_OOXMLEXPORT_TEST(testEmbeddedXlsx, "embedded-xlsx.docx")
{
// check there are two objects and they are FrameShapes
- uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY);
- uno::Reference<container::XIndexAccess> xDraws = xDrawPageSupplier->getDrawPage();
- CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xDraws->getCount());
+ CPPUNIT_ASSERT_EQUAL(2, getShapes());
CPPUNIT_ASSERT_EQUAL(OUString("FrameShape"), getShape(1)->getShapeType());
CPPUNIT_ASSERT_EQUAL(OUString("FrameShape"), getShape(2)->getShapeType());