diff options
-rw-r--r-- | sc/qa/extras/scheaderfootercontentobj.cxx | 23 |
1 files changed, 4 insertions, 19 deletions
diff --git a/sc/qa/extras/scheaderfootercontentobj.cxx b/sc/qa/extras/scheaderfootercontentobj.cxx index c407d47d154a..cb416f910835 100644 --- a/sc/qa/extras/scheaderfootercontentobj.cxx +++ b/sc/qa/extras/scheaderfootercontentobj.cxx @@ -27,8 +27,6 @@ using namespace com::sun::star; namespace sc_apitest { -#define NUMBER_OF_TESTS 3 - class ScHeaderFooterContentObj : public CalcUnoApiTest, public apitest::XHeaderFooterContent { public: @@ -48,13 +46,9 @@ public: CPPUNIT_TEST_SUITE_END(); private: - static sal_Int32 nTest; - static uno::Reference<lang::XComponent> mxComponent; + uno::Reference<lang::XComponent> mxComponent; }; -sal_Int32 ScHeaderFooterContentObj::nTest = 0; -uno::Reference<lang::XComponent> ScHeaderFooterContentObj::mxComponent; - ScHeaderFooterContentObj::ScHeaderFooterContentObj() : CalcUnoApiTest("/sc/qa/extras/testdocuments") { @@ -62,10 +56,6 @@ ScHeaderFooterContentObj::ScHeaderFooterContentObj() uno::Reference<uno::XInterface> ScHeaderFooterContentObj::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()); @@ -95,19 +85,14 @@ uno::Reference<uno::XInterface> ScHeaderFooterContentObj::init() void ScHeaderFooterContentObj::setUp() { - nTest++; - CPPUNIT_ASSERT(nTest <= NUMBER_OF_TESTS); CalcUnoApiTest::setUp(); + // create a calc document + mxComponent = loadFromDesktop("private:factory/scalc"); } void ScHeaderFooterContentObj::tearDown() { - if (nTest == NUMBER_OF_TESTS) - { - closeDocument(mxComponent); - mxComponent.clear(); - } - + closeDocument(mxComponent); CalcUnoApiTest::tearDown(); } |