diff options
author | Jens Carl <j.carl43@gmx.de> | 2018-01-30 07:52:38 +0000 |
---|---|---|
committer | Jens Carl <j.carl43@gmx.de> | 2018-01-30 18:38:11 +0100 |
commit | 16846fd2b4343ee04b9098df9d0c60b0aed2c361 (patch) | |
tree | 3c6625ea8be9ddcaa997d940a04fe9ce3d22ce17 /sc | |
parent | 300e9990a0795d86de3a315f002ced397945ab5c (diff) |
Remove shared mxComponent in scimportdescriptorbaseobj
Change-Id: I11e80ca9e985650db783a8bee6b0334ec5be0d4c
Reviewed-on: https://gerrit.libreoffice.org/48885
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Jens Carl <j.carl43@gmx.de>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/qa/extras/scimportdescriptorbaseobj.cxx | 27 |
1 files changed, 4 insertions, 23 deletions
diff --git a/sc/qa/extras/scimportdescriptorbaseobj.cxx b/sc/qa/extras/scimportdescriptorbaseobj.cxx index e4957e95f131..fbb8b623d7c3 100644 --- a/sc/qa/extras/scimportdescriptorbaseobj.cxx +++ b/sc/qa/extras/scimportdescriptorbaseobj.cxx @@ -26,8 +26,6 @@ using namespace com::sun::star; namespace sc_apitest { -#define NUMBER_OF_TESTS 1 - class ScImportDescriptorBaseObj : public CalcUnoApiTest, public apitest::DatabaseImportDescriptor { public: @@ -47,13 +45,9 @@ public: CPPUNIT_TEST_SUITE_END(); private: - static sal_Int32 nTest; - static uno::Reference<lang::XComponent> mxComponent; + uno::Reference<lang::XComponent> mxComponent; }; -sal_Int32 ScImportDescriptorBaseObj::nTest = 0; -uno::Reference<lang::XComponent> ScImportDescriptorBaseObj::mxComponent; - ScImportDescriptorBaseObj::ScImportDescriptorBaseObj() : CalcUnoApiTest("/sc/qa/extras/testdocuments") { @@ -61,10 +55,6 @@ ScImportDescriptorBaseObj::ScImportDescriptorBaseObj() uno::Reference<uno::XInterface> ScImportDescriptorBaseObj::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()); @@ -77,10 +67,6 @@ uno::Reference<uno::XInterface> ScImportDescriptorBaseObj::init() uno::Reference<uno::XInterface> ScImportDescriptorBaseObj::getXImportable() { - // 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()); @@ -94,19 +80,14 @@ uno::Reference<uno::XInterface> ScImportDescriptorBaseObj::getXImportable() void ScImportDescriptorBaseObj::setUp() { - nTest++; - CPPUNIT_ASSERT(nTest <= NUMBER_OF_TESTS); CalcUnoApiTest::setUp(); + // create a calc document + mxComponent = loadFromDesktop("private:factory/scalc"); } void ScImportDescriptorBaseObj::tearDown() { - if (nTest == NUMBER_OF_TESTS) - { - closeDocument(mxComponent); - mxComponent.clear(); - } - + closeDocument(mxComponent); CalcUnoApiTest::tearDown(); } |