diff options
Diffstat (limited to 'writerfilter/qa/cppunittests/dmapper/TextEffectsHandler.cxx')
-rw-r--r-- | writerfilter/qa/cppunittests/dmapper/TextEffectsHandler.cxx | 37 |
1 files changed, 8 insertions, 29 deletions
diff --git a/writerfilter/qa/cppunittests/dmapper/TextEffectsHandler.cxx b/writerfilter/qa/cppunittests/dmapper/TextEffectsHandler.cxx index 45a689b6b084..78373e1044f6 100644 --- a/writerfilter/qa/cppunittests/dmapper/TextEffectsHandler.cxx +++ b/writerfilter/qa/cppunittests/dmapper/TextEffectsHandler.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 <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/frame/Desktop.hpp> @@ -19,40 +18,20 @@ using namespace ::com::sun::star; namespace { /// Tests for writerfilter/source/dmapper/TextEffectsHandler.cxx. -class Test : public test::BootstrapFixture, public unotest::MacrosTest +class Test : public UnoApiTest { -private: - uno::Reference<lang::XComponent> mxComponent; - public: - void setUp() override; - void tearDown() override; - uno::Reference<lang::XComponent>& getComponent() { return mxComponent; } + Test() + : UnoApiTest("/writerfilter/qa/cppunittests/dmapper/data/") + { + } }; -void Test::setUp() -{ - test::BootstrapFixture::setUp(); - - mxDesktop.set(frame::Desktop::create(mxComponentContext)); -} - -void Test::tearDown() -{ - if (mxComponent.is()) - mxComponent->dispose(); - - test::BootstrapFixture::tearDown(); -} - -constexpr OUStringLiteral DATA_DIRECTORY = u"/writerfilter/qa/cppunittests/dmapper/data/"; - CPPUNIT_TEST_FIXTURE(Test, testSemiTransparentText) { // Load a document with a single paragraph: second text portion has semi-transparent text. - OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "semi-transparent-text.docx"; - getComponent() = loadFromDesktop(aURL); - uno::Reference<text::XTextDocument> xTextDocument(getComponent(), uno::UNO_QUERY); + loadFromURL(u"semi-transparent-text.docx"); + uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY); uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xTextDocument->getText(), uno::UNO_QUERY); uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration(); |