diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2022-11-01 10:02:37 +0100 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2022-11-01 10:55:18 +0100 |
commit | bc770e44c1e8c9686f0eb7eac49dd42717fb494f (patch) | |
tree | 09853533a279cac99779711733fbeee6c78f9e20 /svx/qa/unit/table.cxx | |
parent | 8ec62a84c84d818d01cd3e6dcb874e1a801512c7 (diff) |
CppunitTest_svx_unit: inherit from UnoApiTest
Change-Id: I12e6032c178039eb7b87a1ef063a69c63a0f814b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142093
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'svx/qa/unit/table.cxx')
-rw-r--r-- | svx/qa/unit/table.cxx | 35 |
1 files changed, 9 insertions, 26 deletions
diff --git a/svx/qa/unit/table.cxx b/svx/qa/unit/table.cxx index c68abe18beea..c91344c24b6d 100644 --- a/svx/qa/unit/table.cxx +++ b/svx/qa/unit/table.cxx @@ -7,8 +7,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include <test/bootstrapfixture.hxx> -#include <unotest/macros_test.hxx> +#include <test/unoapi_test.hxx> #include <test/xmltesttools.hxx> #include <com/sun/star/drawing/XDrawPagesSupplier.hpp> @@ -35,27 +34,13 @@ using namespace ::com::sun::star; namespace { /// Tests for svx/source/table/ code. -class Test : public test::BootstrapFixture, public unotest::MacrosTest, public XmlTestTools +class Test : public UnoApiTest, public XmlTestTools { -protected: - uno::Reference<lang::XComponent> mxComponent; - public: - virtual void setUp() override - { - test::BootstrapFixture::setUp(); - mxDesktop.set(frame::Desktop::create(m_xContext)); - } - - virtual void tearDown() override + Test() + : UnoApiTest("svx/qa/unit/data/") { - if (mxComponent.is()) - { - mxComponent->dispose(); - } - test::BootstrapFixture::tearDown(); } - uno::Reference<lang::XComponent>& getComponent() { return mxComponent; } drawinglayer::primitive2d::Primitive2DContainer renderPageToPrimitives(const uno::Reference<drawing::XDrawPage>& xDrawPage); @@ -81,12 +66,10 @@ Test::renderPageToPrimitives(const uno::Reference<drawing::XDrawPage>& xDrawPage CPPUNIT_TEST_FIXTURE(Test, testTableShadowBlur) { // Given a document containing a table with a blurry shadow: - test::Directories aDirectories; - OUString aURL = aDirectories.getURLFromSrc(u"svx/qa/unit/data/table-shadow-blur.pptx"); - getComponent() = loadFromDesktop(aURL); + loadFromURL(u"table-shadow-blur.pptx"); // When rendering the table shadow to primitives: - uno::Reference<drawing::XDrawPagesSupplier> xDrawPagesSupplier(getComponent(), uno::UNO_QUERY); + uno::Reference<drawing::XDrawPagesSupplier> xDrawPagesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference<drawing::XDrawPage> xDrawPage(xDrawPagesSupplier->getDrawPages()->getByIndex(0), uno::UNO_QUERY); drawinglayer::primitive2d::Primitive2DContainer xPrimitiveSequence @@ -108,13 +91,13 @@ CPPUNIT_TEST_FIXTURE(Test, testTableShadowBlur) CPPUNIT_TEST_FIXTURE(Test, testSvxTableControllerSetAttrToSelectedShape) { // Given a document with a table shape, editing cell text: - getComponent() = loadFromDesktop("private:factory/simpress", - "com.sun.star.presentation.PresentationDocument"); + mxComponent = loadFromDesktop("private:factory/simpress", + "com.sun.star.presentation.PresentationDocument"); uno::Sequence<beans::PropertyValue> aArgs = { comphelper::makePropertyValue("Rows", sal_Int32(2)), comphelper::makePropertyValue("Columns", sal_Int32(2)) }; dispatchCommand(mxComponent, ".uno:InsertTable", aArgs); - uno::Reference<drawing::XDrawPagesSupplier> xDrawPagesSupplier(getComponent(), uno::UNO_QUERY); + uno::Reference<drawing::XDrawPagesSupplier> xDrawPagesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference<drawing::XDrawPage> xDrawPage(xDrawPagesSupplier->getDrawPages()->getByIndex(0), uno::UNO_QUERY); auto pDrawPage = dynamic_cast<SvxDrawPage*>(xDrawPage.get()); |