diff options
author | Jens Carl <j.carl43@gmx.de> | 2018-01-30 18:07:25 +0000 |
---|---|---|
committer | Jens Carl <j.carl43@gmx.de> | 2018-01-30 22:37:57 +0100 |
commit | f8f4e9e605daf307a32531bbe8c89fd4575fea4e (patch) | |
tree | 22040b5e0a3131d7f8813674c84e6deca781eaf6 /sc | |
parent | 1a8aedb933f6c82c84804de3e282412deb190a79 (diff) |
Remove shared mxComponent (test document) in sclabelrangesobj
Change-Id: I79fb234a55fa03cd0c45bcc22903963f2a353fe5
Reviewed-on: https://gerrit.libreoffice.org/48920
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Jens Carl <j.carl43@gmx.de>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/qa/extras/sclabelrangesobj.cxx | 23 |
1 files changed, 4 insertions, 19 deletions
diff --git a/sc/qa/extras/sclabelrangesobj.cxx b/sc/qa/extras/sclabelrangesobj.cxx index fd97e7be5261..e10554dae405 100644 --- a/sc/qa/extras/sclabelrangesobj.cxx +++ b/sc/qa/extras/sclabelrangesobj.cxx @@ -25,8 +25,6 @@ using namespace com::sun::star; namespace sc_apitest { -#define NUMBER_OF_TESTS 2 - class ScLabelRangesObj : public CalcUnoApiTest, public apitest::XLabelRanges { 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 ScLabelRangesObj::nTest = 0; -uno::Reference<lang::XComponent> ScLabelRangesObj::mxComponent; - ScLabelRangesObj::ScLabelRangesObj() : CalcUnoApiTest("/sc/qa/extras/testdocuments") { @@ -59,10 +53,6 @@ ScLabelRangesObj::ScLabelRangesObj() uno::Reference<uno::XInterface> ScLabelRangesObj::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()); @@ -79,19 +69,14 @@ uno::Reference<uno::XInterface> ScLabelRangesObj::init() void ScLabelRangesObj::setUp() { - nTest++; - CPPUNIT_ASSERT(nTest <= NUMBER_OF_TESTS); CalcUnoApiTest::setUp(); + // create a calc document + mxComponent = loadFromDesktop("private:factory/scalc"); } void ScLabelRangesObj::tearDown() { - if (nTest == NUMBER_OF_TESTS) - { - closeDocument(mxComponent); - mxComponent.clear(); - } - + closeDocument(mxComponent); CalcUnoApiTest::tearDown(); } |