sc/qa/extras/scdatapilotfieldobj.cxx | 27 +++++++-------------------- 1 file changed, 7 insertions(+), 20 deletions(-)
New commits: commit c2bc993e588dda8ed920da27ee9e1ccfe8e7fa45 Author: Jens Carl <j.car...@gmx.de> Date: Sat Jan 27 19:45:08 2018 +0000 Remove shared mxComponent in scdatapilotfieldobj Change-Id: I96e733f14561037dd2ad1df080adfdb911b8243e Reviewed-on: https://gerrit.libreoffice.org/48754 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Jens Carl <j.car...@gmx.de> diff --git a/sc/qa/extras/scdatapilotfieldobj.cxx b/sc/qa/extras/scdatapilotfieldobj.cxx index d2bf03b74b8e..94c725ad8ce1 100644 --- a/sc/qa/extras/scdatapilotfieldobj.cxx +++ b/sc/qa/extras/scdatapilotfieldobj.cxx @@ -24,8 +24,6 @@ using namespace css::uno; namespace sc_apitest { -#define NUMBER_OF_TESTS 7 - class ScDataPilotFieldObj : public CalcUnoApiTest, public apitest::DataPilotField, public apitest::XDataPilotField, public apitest::XDataPilotFieldGrouping @@ -57,13 +55,9 @@ public: CPPUNIT_TEST_SUITE_END(); private: - static sal_Int32 nTest; - static uno::Reference< lang::XComponent > mxComponent; + uno::Reference< lang::XComponent > mxComponent; }; -sal_Int32 ScDataPilotFieldObj::nTest = 0; -uno::Reference< lang::XComponent > ScDataPilotFieldObj::mxComponent; - ScDataPilotFieldObj::ScDataPilotFieldObj() : CalcUnoApiTest("/sc/qa/extras/testdocuments") { @@ -71,11 +65,6 @@ ScDataPilotFieldObj::ScDataPilotFieldObj() uno::Reference< uno::XInterface > ScDataPilotFieldObj::init() { - OUString aFileURL; - createFileURL("scdatapilotfieldobj.ods", aFileURL); - if(!mxComponent.is()) - mxComponent = loadFromDesktop(aFileURL, "com.sun.star.sheet.SpreadsheetDocument"); - uno::Reference< sheet::XSpreadsheetDocument > xDoc(mxComponent, UNO_QUERY_THROW); CPPUNIT_ASSERT_MESSAGE("no calc document", xDoc.is()); @@ -100,19 +89,17 @@ uno::Reference< uno::XInterface > ScDataPilotFieldObj::init() void ScDataPilotFieldObj::setUp() { - nTest++; - CPPUNIT_ASSERT(nTest <= NUMBER_OF_TESTS); CalcUnoApiTest::setUp(); + + OUString aFileURL; + createFileURL("scdatapilotfieldobj.ods", aFileURL); + mxComponent = loadFromDesktop(aFileURL, "com.sun.star.sheet.SpreadsheetDocument"); + } void ScDataPilotFieldObj::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