summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Carl <j.carl43@gmx.de>2018-01-30 20:04:19 +0000
committerJens Carl <j.carl43@gmx.de>2018-01-30 23:55:24 +0100
commit8b521b2535ca1e80758f57abf1656fc3eb21a47c (patch)
treebf9cc750f81a7b0ef31c7db7908e6934d4e434a6
parent3e32f5530b1292a9edc5fed5997a52d0fa554420 (diff)
Remove shared mxComponent (test document) in scspreadsheetsettingsobj
Change-Id: I6c96bf694ec64fec2ddae66a42cf8cc2a8fc0e7a Reviewed-on: https://gerrit.libreoffice.org/48931 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jens Carl <j.carl43@gmx.de>
-rw-r--r--sc/qa/extras/scspreadsheetsettingsobj.cxx23
1 files changed, 4 insertions, 19 deletions
diff --git a/sc/qa/extras/scspreadsheetsettingsobj.cxx b/sc/qa/extras/scspreadsheetsettingsobj.cxx
index 7cb3e22a6f90..34edd4cc916f 100644
--- a/sc/qa/extras/scspreadsheetsettingsobj.cxx
+++ b/sc/qa/extras/scspreadsheetsettingsobj.cxx
@@ -23,8 +23,6 @@ using namespace com::sun::star;
namespace sc_apitest
{
-#define NUMBER_OF_TESTS 1
-
class ScSpreadsheetSettingsObj : public CalcUnoApiTest, public apitest::GlobalSheetSettings
{
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 ScSpreadsheetSettingsObj::nTest = 0;
-uno::Reference<lang::XComponent> ScSpreadsheetSettingsObj::mxComponent;
-
ScSpreadsheetSettingsObj::ScSpreadsheetSettingsObj()
: CalcUnoApiTest("/sc/qa/extras/testdocuments")
{
@@ -56,10 +50,6 @@ ScSpreadsheetSettingsObj::ScSpreadsheetSettingsObj()
uno::Reference<uno::XInterface> ScSpreadsheetSettingsObj::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());
@@ -69,19 +59,14 @@ uno::Reference<uno::XInterface> ScSpreadsheetSettingsObj::init()
void ScSpreadsheetSettingsObj::setUp()
{
- nTest++;
- CPPUNIT_ASSERT(nTest <= NUMBER_OF_TESTS);
CalcUnoApiTest::setUp();
+ // create a calc document
+ mxComponent = loadFromDesktop("private:factory/scalc");
}
void ScSpreadsheetSettingsObj::tearDown()
{
- if (nTest == NUMBER_OF_TESTS)
- {
- closeDocument(mxComponent);
- mxComponent.clear();
- }
-
+ closeDocument(mxComponent);
CalcUnoApiTest::tearDown();
}