diff options
author | Jens Carl <j.carl43@gmx.de> | 2018-01-30 07:49:54 +0000 |
---|---|---|
committer | Jens Carl <j.carl43@gmx.de> | 2018-01-30 18:37:53 +0100 |
commit | 300e9990a0795d86de3a315f002ced397945ab5c (patch) | |
tree | 2c725e1f14cf428e234c39f8c31d33c7486a84c8 /sc | |
parent | 2831ae4d07ecc04893022bc9412218f898e4d739 (diff) |
Remove shared mxComponent in scheaderfootercontentobj
Change-Id: Id4546f47af5729f9ba074423c9656f757d739448
Reviewed-on: https://gerrit.libreoffice.org/48883
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Jens Carl <j.carl43@gmx.de>
Diffstat (limited to 'sc')
-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(); } |