From a52970b535759bf862a7786e12da282aa5acfd74 Mon Sep 17 00:00:00 2001 From: Jens Carl Date: Tue, 30 Jan 2018 07:44:24 +0000 Subject: Remove shared mxComponent in scfilterdescriptorbaseobj Change-Id: If92339f38bdb24e364fd378de772fa714f73e380 Reviewed-on: https://gerrit.libreoffice.org/48881 Tested-by: Jenkins Reviewed-by: Jens Carl --- sc/qa/extras/scfilterdescriptorbaseobj.cxx | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) (limited to 'sc') diff --git a/sc/qa/extras/scfilterdescriptorbaseobj.cxx b/sc/qa/extras/scfilterdescriptorbaseobj.cxx index 1fc814af2cbd..993016b77ebb 100644 --- a/sc/qa/extras/scfilterdescriptorbaseobj.cxx +++ b/sc/qa/extras/scfilterdescriptorbaseobj.cxx @@ -22,8 +22,6 @@ using namespace css::uno; namespace sc_apitest { -#define NUMBER_OF_TESTS 1 - class ScFilterDescriptorBaseObj : public CalcUnoApiTest, public apitest::XSheetFilterDescriptor { public: @@ -42,13 +40,9 @@ public: CPPUNIT_TEST_SUITE_END(); private: - static sal_Int32 nTest; - static uno::Reference< lang::XComponent > mxComponent; + uno::Reference< lang::XComponent > mxComponent; }; -sal_Int32 ScFilterDescriptorBaseObj::nTest = 0; -uno::Reference< lang::XComponent > ScFilterDescriptorBaseObj::mxComponent; - ScFilterDescriptorBaseObj::ScFilterDescriptorBaseObj(): CalcUnoApiTest("/sc/qa/extras/testdocuments") { @@ -56,10 +50,6 @@ ScFilterDescriptorBaseObj::ScFilterDescriptorBaseObj(): uno::Reference< uno::XInterface > ScFilterDescriptorBaseObj::init() { - // create a calc document - if (!mxComponent.is()) - mxComponent = loadFromDesktop("private:factory/scalc"); - uno::Reference< sheet::XSpreadsheetDocument > xDoc(mxComponent, uno::UNO_QUERY_THROW); CPPUNIT_ASSERT_MESSAGE("no calc document", xDoc.is()); @@ -77,19 +67,14 @@ uno::Reference< uno::XInterface > ScFilterDescriptorBaseObj::init() void ScFilterDescriptorBaseObj::setUp() { - nTest++; - CPPUNIT_ASSERT(nTest <= NUMBER_OF_TESTS); CalcUnoApiTest::setUp(); + // create a calc document + mxComponent = loadFromDesktop("private:factory/scalc"); } void ScFilterDescriptorBaseObj::tearDown() { - if (nTest == NUMBER_OF_TESTS) - { - closeDocument(mxComponent); - mxComponent.clear(); - } - + closeDocument(mxComponent); CalcUnoApiTest::tearDown(); } -- cgit