summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorJens Carl <j.carl43@gmx.de>2018-01-30 07:27:08 +0000
committerJens Carl <j.carl43@gmx.de>2018-01-30 18:24:08 +0100
commit6d0341880f3da35f2f1d51fd4c6603b758a11b22 (patch)
treef89b652d55313ef7be4aff6e19ca9fcba06a133b /sc
parent8958ed763e91794ed744a75c59461c745a42bc63 (diff)
Remove shared mxComponent in scdatapilottablesobj
Change-Id: I0648bab36217a63155e78e4f4bb56da93fde888f Reviewed-on: https://gerrit.libreoffice.org/48876 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jens Carl <j.carl43@gmx.de>
Diffstat (limited to 'sc')
-rw-r--r--sc/qa/extras/scdatapilottablesobj.cxx27
1 files changed, 4 insertions, 23 deletions
diff --git a/sc/qa/extras/scdatapilottablesobj.cxx b/sc/qa/extras/scdatapilottablesobj.cxx
index 6b17298fdf97..0f44daa60fb5 100644
--- a/sc/qa/extras/scdatapilottablesobj.cxx
+++ b/sc/qa/extras/scdatapilottablesobj.cxx
@@ -30,8 +30,6 @@ using namespace com::sun::star;
namespace sc_apitest
{
-#define NUMBER_OF_TESTS 1
-
class ScDataPilotTablesObj : public CalcUnoApiTest, public apitest::XDataPilotTables
{
public:
@@ -50,13 +48,9 @@ public:
CPPUNIT_TEST_SUITE_END();
private:
- static sal_Int32 nTest;
- static uno::Reference<lang::XComponent> mxComponent;
+ uno::Reference<lang::XComponent> mxComponent;
};
-sal_Int32 ScDataPilotTablesObj::nTest = 0;
-uno::Reference<lang::XComponent> ScDataPilotTablesObj::mxComponent;
-
ScDataPilotTablesObj::ScDataPilotTablesObj()
: CalcUnoApiTest("/sc/qa/extras/testdocuments")
{
@@ -64,10 +58,6 @@ ScDataPilotTablesObj::ScDataPilotTablesObj()
uno::Reference<uno::XInterface> ScDataPilotTablesObj::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());
@@ -93,10 +83,6 @@ uno::Reference<uno::XInterface> ScDataPilotTablesObj::init()
uno::Reference<uno::XInterface> ScDataPilotTablesObj::getXSpreadsheet()
{
- // 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());
@@ -109,19 +95,14 @@ uno::Reference<uno::XInterface> ScDataPilotTablesObj::getXSpreadsheet()
void ScDataPilotTablesObj::setUp()
{
- nTest++;
- CPPUNIT_ASSERT(nTest <= NUMBER_OF_TESTS);
CalcUnoApiTest::setUp();
+ // create a calc document
+ mxComponent = loadFromDesktop("private:factory/scalc");
}
void ScDataPilotTablesObj::tearDown()
{
- if (nTest == NUMBER_OF_TESTS)
- {
- closeDocument(mxComponent);
- mxComponent.clear();
- }
-
+ closeDocument(mxComponent);
CalcUnoApiTest::tearDown();
}