summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Carl <j.carl43@gmx.de>2018-01-27 19:47:07 +0000
committerJens Carl <j.carl43@gmx.de>2018-01-28 00:32:25 +0100
commit6e641f93e837a33c8d4364fdbd88b3d4c52de20c (patch)
tree4f7d79841acf45c8b71f00a55c5ea6d0c9e8afaf
parentc2bc993e588dda8ed920da27ee9e1ccfe8e7fa45 (diff)
Remove shared mxComponent in scdatapilotitemobj
Change-Id: I9e1b98f203e5e85c25947d6b26f62f36672264c8 Reviewed-on: https://gerrit.libreoffice.org/48755 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jens Carl <j.carl43@gmx.de>
-rw-r--r--sc/qa/extras/scdatapilotitemobj.cxx22
1 files changed, 4 insertions, 18 deletions
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();
}