diff options
author | Jens Carl <j.carl43@gmx.de> | 2018-01-30 18:05:05 +0000 |
---|---|---|
committer | Jens Carl <j.carl43@gmx.de> | 2018-01-30 21:41:49 +0100 |
commit | 7af7c18c11cfdb781daf6a8c4c7112d247f8c4a0 (patch) | |
tree | 6c43ed43f12989511cdbfbd74b7083c97408a956 /sc/qa/extras | |
parent | c38f11918568f33400f7f774c591f76926fe2755 (diff) |
Remove shared mxComponent (test document) in sclabelrangeobj
Change-Id: I5d9ab4b1ec384298334399dc2e02c3dcc6b2ca57
Reviewed-on: https://gerrit.libreoffice.org/48919
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Jens Carl <j.carl43@gmx.de>
Diffstat (limited to 'sc/qa/extras')
-rw-r--r-- | sc/qa/extras/sclabelrangeobj.cxx | 23 |
1 files changed, 4 insertions, 19 deletions
diff --git a/sc/qa/extras/sclabelrangeobj.cxx b/sc/qa/extras/sclabelrangeobj.cxx index a0f0ed78c8f2..4cbbac83f776 100644 --- a/sc/qa/extras/sclabelrangeobj.cxx +++ b/sc/qa/extras/sclabelrangeobj.cxx @@ -26,8 +26,6 @@ using namespace com::sun::star; namespace sc_apitest { -#define NUMBER_OF_TESTS 2 - class ScLabelRangeObj : public CalcUnoApiTest, public apitest::XLabelRange { public: @@ -46,13 +44,9 @@ public: CPPUNIT_TEST_SUITE_END(); private: - static sal_Int32 nTest; - static uno::Reference<lang::XComponent> mxComponent; + uno::Reference<lang::XComponent> mxComponent; }; -sal_Int32 ScLabelRangeObj::nTest = 0; -uno::Reference<lang::XComponent> ScLabelRangeObj::mxComponent; - ScLabelRangeObj::ScLabelRangeObj() : CalcUnoApiTest("/sc/qa/extras/testdocuments") { @@ -60,10 +54,6 @@ ScLabelRangeObj::ScLabelRangeObj() uno::Reference<uno::XInterface> ScLabelRangeObj::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()); @@ -82,19 +72,14 @@ uno::Reference<uno::XInterface> ScLabelRangeObj::init() void ScLabelRangeObj::setUp() { - nTest++; - CPPUNIT_ASSERT(nTest <= NUMBER_OF_TESTS); CalcUnoApiTest::setUp(); + // create calc document + mxComponent = loadFromDesktop("private:factory/scalc"); } void ScLabelRangeObj::tearDown() { - if (nTest == NUMBER_OF_TESTS) - { - closeDocument(mxComponent); - mxComponent.clear(); - } - + closeDocument(mxComponent); CalcUnoApiTest::tearDown(); } |