sc/qa/extras/scdatapilotitemobj.cxx | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-)
New commits: commit 6e641f93e837a33c8d4364fdbd88b3d4c52de20c Author: Jens Carl <j.car...@gmx.de> Date: Sat Jan 27 19:47:07 2018 +0000 Remove shared mxComponent in scdatapilotitemobj Change-Id: I9e1b98f203e5e85c25947d6b26f62f36672264c8 Reviewed-on: https://gerrit.libreoffice.org/48755 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Jens Carl <j.car...@gmx.de> diff --git a/sc/qa/extras/scdatapilotitemobj.cxx b/sc/qa/extras/scdatapilotitemobj.cxx index b23253bb531c..ab2d44338b80 100644 --- a/sc/qa/extras/scdatapilotitemobj.cxx +++ b/sc/qa/extras/scdatapilotitemobj.cxx @@ -31,8 +31,6 @@ using namespace css::uno; namespace sc_apitest { -#define NUMBER_OF_TESTS 1 - class ScDataPilotItemObj : public CalcUnoApiTest, public apitest::DataPilotItem { public: @@ -50,14 +48,11 @@ public: CPPUNIT_TEST_SUITE_END(); private: - static sal_Int32 nTest; static sal_Int32 nMaxFieldIndex; - static uno::Reference< lang::XComponent > mxComponent; + uno::Reference< lang::XComponent > mxComponent; }; -sal_Int32 ScDataPilotItemObj::nTest = 0; sal_Int32 ScDataPilotItemObj::nMaxFieldIndex = 6; -uno::Reference< lang::XComponent > ScDataPilotItemObj::mxComponent; ScDataPilotItemObj::ScDataPilotItemObj() : CalcUnoApiTest("/sc/qa/extras/testdocuments") @@ -69,10 +64,6 @@ uno::Reference< uno::XInterface > ScDataPilotItemObj::init() table::CellRangeAddress sCellRangeAddress(0, 1, 0, nMaxFieldIndex - 1, nMaxFieldIndex - 1); table::CellAddress sCellAddress(0, 7, 8); - // create 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()); @@ -125,19 +116,14 @@ uno::Reference< uno::XInterface > ScDataPilotItemObj::init() void ScDataPilotItemObj::setUp() { - nTest++; - CPPUNIT_ASSERT(nTest <= NUMBER_OF_TESTS); CalcUnoApiTest::setUp(); + // create calc document + mxComponent = loadFromDesktop("private:factory/scalc"); } void ScDataPilotItemObj::tearDown() { - if (nTest == NUMBER_OF_TESTS) - { - closeDocument(mxComponent); - mxComponent.clear(); - } - + closeDocument(mxComponent); CalcUnoApiTest::tearDown(); } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits