diff options
author | Jens Carl <j.carl43@gmx.de> | 2018-01-30 21:42:08 +0000 |
---|---|---|
committer | Jens Carl <j.carl43@gmx.de> | 2018-01-31 09:05:51 +0100 |
commit | 43b19dc7c23fd75c4e7bedfb8290d296d756573e (patch) | |
tree | 6c64bb80c4c0afbb3bca25f5561598c6df2e533b /sc/qa | |
parent | a8c1083553ee4c0d85bacef4ea4cdef0de8927d3 (diff) |
Remove shared mxComponent (test document) in scsubtotalfieldobj
Change-Id: If47716c6dbc353059c42a2bcd09f7c11ed53796f
Reviewed-on: https://gerrit.libreoffice.org/48937
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/scsubtotalfieldobj.cxx | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/sc/qa/extras/scsubtotalfieldobj.cxx b/sc/qa/extras/scsubtotalfieldobj.cxx index 6ddbaf8686c0..50e55745a756 100644 --- a/sc/qa/extras/scsubtotalfieldobj.cxx +++ b/sc/qa/extras/scsubtotalfieldobj.cxx @@ -31,8 +31,6 @@ using namespace com::sun::star; namespace sc_apitest { -#define NUMBER_OF_TESTS 2 - class ScSubTotalFieldObj : public CalcUnoApiTest, public apitest::XSubTotalField { public: @@ -51,14 +49,10 @@ public: CPPUNIT_TEST_SUITE_END(); private: - static sal_Int32 nTest; - static uno::Reference< lang::XComponent > mxComponent; + uno::Reference< lang::XComponent > mxComponent; }; -sal_Int32 ScSubTotalFieldObj::nTest = 0; -uno::Reference< lang::XComponent > ScSubTotalFieldObj::mxComponent; - ScSubTotalFieldObj::ScSubTotalFieldObj() : CalcUnoApiTest("/sc/qa/extras/testdocuments") { @@ -66,10 +60,6 @@ ScSubTotalFieldObj::ScSubTotalFieldObj() uno::Reference< uno::XInterface > ScSubTotalFieldObj::init() { - // create a calc document - if (!mxComponent.is()) - mxComponent = loadFromDesktop("private:factory/scalc"); - uno::Reference< sheet::XSpreadsheetDocument > xDoc(mxComponent, uno::UNO_QUERY_THROW); CPPUNIT_ASSERT_MESSAGE("no calc document", xDoc.is()); @@ -94,19 +84,15 @@ uno::Reference< uno::XInterface > ScSubTotalFieldObj::init() void ScSubTotalFieldObj::setUp() { - nTest++; - CPPUNIT_ASSERT(nTest <= NUMBER_OF_TESTS); CalcUnoApiTest::setUp(); + // create a calc document + mxComponent = loadFromDesktop("private:factory/scalc"); + } void ScSubTotalFieldObj::tearDown() { - if (nTest == NUMBER_OF_TESTS) - { - closeDocument(mxComponent); - mxComponent.clear(); - } - + closeDocument(mxComponent); CalcUnoApiTest::tearDown(); } |