diff options
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(); } |