diff options
-rw-r--r-- | sc/qa/extras/scdatapilottablesobj.cxx | 27 |
1 files changed, 4 insertions, 23 deletions
diff --git a/sc/qa/extras/scdatapilottablesobj.cxx b/sc/qa/extras/scdatapilottablesobj.cxx index 6b17298fdf97..0f44daa60fb5 100644 --- a/sc/qa/extras/scdatapilottablesobj.cxx +++ b/sc/qa/extras/scdatapilottablesobj.cxx @@ -30,8 +30,6 @@ using namespace com::sun::star; namespace sc_apitest { -#define NUMBER_OF_TESTS 1 - class ScDataPilotTablesObj : public CalcUnoApiTest, public apitest::XDataPilotTables { public: @@ -50,13 +48,9 @@ public: CPPUNIT_TEST_SUITE_END(); private: - static sal_Int32 nTest; - static uno::Reference<lang::XComponent> mxComponent; + uno::Reference<lang::XComponent> mxComponent; }; -sal_Int32 ScDataPilotTablesObj::nTest = 0; -uno::Reference<lang::XComponent> ScDataPilotTablesObj::mxComponent; - ScDataPilotTablesObj::ScDataPilotTablesObj() : CalcUnoApiTest("/sc/qa/extras/testdocuments") { @@ -64,10 +58,6 @@ ScDataPilotTablesObj::ScDataPilotTablesObj() uno::Reference<uno::XInterface> ScDataPilotTablesObj::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()); @@ -93,10 +83,6 @@ uno::Reference<uno::XInterface> ScDataPilotTablesObj::init() uno::Reference<uno::XInterface> ScDataPilotTablesObj::getXSpreadsheet() { - // 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()); @@ -109,19 +95,14 @@ uno::Reference<uno::XInterface> ScDataPilotTablesObj::getXSpreadsheet() void ScDataPilotTablesObj::setUp() { - nTest++; - CPPUNIT_ASSERT(nTest <= NUMBER_OF_TESTS); CalcUnoApiTest::setUp(); + // create a calc document + mxComponent = loadFromDesktop("private:factory/scalc"); } void ScDataPilotTablesObj::tearDown() { - if (nTest == NUMBER_OF_TESTS) - { - closeDocument(mxComponent); - mxComponent.clear(); - } - + closeDocument(mxComponent); CalcUnoApiTest::tearDown(); } |