diff options
author | Jens Carl <j.carl43@gmx.de> | 2018-01-30 18:29:40 +0000 |
---|---|---|
committer | Jens Carl <j.carl43@gmx.de> | 2018-01-31 01:11:34 +0100 |
commit | ef52c5bf90713bb4751e36b6849e236a768f0aa4 (patch) | |
tree | 0106c563de430db17c4ca67c279169d103a8bead /sc/qa | |
parent | 1a43f636b20dbeed0c112bd1b97d862184ead089 (diff) |
Remove shared mxComponent (test document) in screcentfunctionsobj
Change-Id: Id0d9e3f86f9e48333f415b4eb2a05b3211473b67
Reviewed-on: https://gerrit.libreoffice.org/48925
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Jens Carl <j.carl43@gmx.de>
Diffstat (limited to 'sc/qa')
-rw-r--r-- | sc/qa/extras/screcentfunctionsobj.cxx | 23 |
1 files changed, 4 insertions, 19 deletions
diff --git a/sc/qa/extras/screcentfunctionsobj.cxx b/sc/qa/extras/screcentfunctionsobj.cxx index 289c87479cb0..4dc32b67b0bd 100644 --- a/sc/qa/extras/screcentfunctionsobj.cxx +++ b/sc/qa/extras/screcentfunctionsobj.cxx @@ -24,8 +24,6 @@ using namespace com::sun::star; namespace sc_apitest { -#define NUMBER_OF_TESTS 3 - class ScRecentFunctionsObj : public CalcUnoApiTest, public apitest::XRecentFunctions { public: @@ -45,13 +43,9 @@ public: CPPUNIT_TEST_SUITE_END(); private: - static sal_Int32 nTest; - static uno::Reference<lang::XComponent> mxComponent; + uno::Reference<lang::XComponent> mxComponent; }; -sal_Int32 ScRecentFunctionsObj::nTest = 0; -uno::Reference<lang::XComponent> ScRecentFunctionsObj::mxComponent; - ScRecentFunctionsObj::ScRecentFunctionsObj() : CalcUnoApiTest("/sc/qa/extras/testdocuments") { @@ -59,10 +53,6 @@ ScRecentFunctionsObj::ScRecentFunctionsObj() uno::Reference<uno::XInterface> ScRecentFunctionsObj::init() { - // create a calc document - if (!mxComponent.is()) - mxComponent = loadFromDesktop("private:factory/scalc"); - uno::Reference<sheet::XSpreadsheetDocument> xDoc(mxComponent, UNO_QUERY_THROW); CPPUNIT_ASSERT_MESSAGE("no calc document", xDoc.is()); @@ -72,19 +62,14 @@ uno::Reference<uno::XInterface> ScRecentFunctionsObj::init() void ScRecentFunctionsObj::setUp() { - nTest++; - CPPUNIT_ASSERT(nTest <= NUMBER_OF_TESTS); CalcUnoApiTest::setUp(); + // create a calc document + mxComponent = loadFromDesktop("private:factory/scalc"); } void ScRecentFunctionsObj::tearDown() { - if (nTest == NUMBER_OF_TESTS) - { - closeDocument(mxComponent); - mxComponent.clear(); - } - + closeDocument(mxComponent); CalcUnoApiTest::tearDown(); } |