diff options
author | Jens Carl <j.carl43@gmx.de> | 2018-01-30 23:02:41 +0000 |
---|---|---|
committer | Jens Carl <j.carl43@gmx.de> | 2018-01-31 05:25:36 +0100 |
commit | 96a47c604df8187ab5c68d9941d71e8f07acce6d (patch) | |
tree | 9ee69b37d466d46c8088be749ffb8acca16f29f3 /sc | |
parent | 00bf3c837120fa95bfa9df5cc4de33bacb9b5288 (diff) |
Remove shared mxComponent (test document) in scviewpaneobj
Change-Id: I8bf7adb11e49d926a5910a4bd8279e16cf34833f
Reviewed-on: https://gerrit.libreoffice.org/48943
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Jens Carl <j.carl43@gmx.de>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/qa/extras/scviewpaneobj.cxx | 30 |
1 files changed, 8 insertions, 22 deletions
diff --git a/sc/qa/extras/scviewpaneobj.cxx b/sc/qa/extras/scviewpaneobj.cxx index 02ceb63824e0..6e74fa8a4434 100644 --- a/sc/qa/extras/scviewpaneobj.cxx +++ b/sc/qa/extras/scviewpaneobj.cxx @@ -23,8 +23,6 @@ using namespace css::uno; namespace sc_apitest { -#define NUMBER_OF_TESTS 3 - class ScViewPaneObj : public CalcUnoApiTest, public apitest::XViewPane { public: @@ -35,32 +33,25 @@ public: virtual void tearDown() override; CPPUNIT_TEST_SUITE(ScViewPaneObj); + + // XViewPane CPPUNIT_TEST(testFirstVisibleColumn); CPPUNIT_TEST(testFirstVisibleRow); CPPUNIT_TEST(testVisibleRange); + CPPUNIT_TEST_SUITE_END(); private: - - static sal_Int32 nTest; - static uno::Reference<lang::XComponent> mxComponent; - + uno::Reference<lang::XComponent> mxComponent; }; -sal_Int32 ScViewPaneObj::nTest = 0; -uno::Reference< lang::XComponent > ScViewPaneObj::mxComponent; - ScViewPaneObj::ScViewPaneObj() - : CalcUnoApiTest("/sc/qa/extras/testdocuments") + : CalcUnoApiTest("/sc/qa/extras/testdocuments") { } uno::Reference< uno::XInterface > ScViewPaneObj::init() { - // create a calc document - if (!mxComponent.is()) - mxComponent = loadFromDesktop("private:factory/scalc"); - uno::Reference< sheet::XSpreadsheetDocument > xSheetDoc(mxComponent, uno::UNO_QUERY_THROW); CPPUNIT_ASSERT_MESSAGE("no calc document!", xSheetDoc.is()); @@ -73,19 +64,14 @@ uno::Reference< uno::XInterface > ScViewPaneObj::init() void ScViewPaneObj::setUp() { - nTest++; - CPPUNIT_ASSERT(nTest <= NUMBER_OF_TESTS); CalcUnoApiTest::setUp(); + // create a calc document + mxComponent = loadFromDesktop("private:factory/scalc"); } void ScViewPaneObj::tearDown() { - if (nTest == NUMBER_OF_TESTS) - { - closeDocument(mxComponent); - mxComponent.clear(); - } - + closeDocument(mxComponent); CalcUnoApiTest::tearDown(); } |