summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Carl <j.carl43@gmx.de>2018-01-27 19:42:37 +0000
committerJens Carl <j.carl43@gmx.de>2018-01-28 00:31:15 +0100
commit0ed15634fcef7d7a39535afb7e1370d364222e4d (patch)
tree2ed25627789d5b0373fdd83aaae6288a122f961c
parentcbe054d7c58da8ba2a97314ea70e81f5f40870db (diff)
Remove shared mxComponent in scdatabaserangesobj
Change-Id: I55eda7486ebadb02569c5ce21e709704dbf1d795 Reviewed-on: https://gerrit.libreoffice.org/48753 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jens Carl <j.carl43@gmx.de>
-rw-r--r--sc/qa/extras/scdatabaserangesobj.cxx23
1 files changed, 4 insertions, 19 deletions
diff --git a/sc/qa/extras/scdatabaserangesobj.cxx b/sc/qa/extras/scdatabaserangesobj.cxx
index 170663774d37..9df20f8a57b6 100644
--- a/sc/qa/extras/scdatabaserangesobj.cxx
+++ b/sc/qa/extras/scdatabaserangesobj.cxx
@@ -25,8 +25,6 @@ using namespace com::sun::star;
namespace sc_apitest
{
-#define NUMBER_OF_TESTS 1
-
class ScDatabaseRangesObj : public CalcUnoApiTest, public apitest::XDatabaseRanges
{
public:
@@ -44,13 +42,9 @@ public:
CPPUNIT_TEST_SUITE_END();
private:
- static sal_Int32 nTest;
- static uno::Reference<lang::XComponent> mxComponent;
+ uno::Reference<lang::XComponent> mxComponent;
};
-sal_Int32 ScDatabaseRangesObj::nTest = 0;
-uno::Reference<lang::XComponent> ScDatabaseRangesObj::mxComponent;
-
ScDatabaseRangesObj::ScDatabaseRangesObj()
: CalcUnoApiTest("/sc/qa/extras/testdocuments")
{
@@ -58,10 +52,6 @@ ScDatabaseRangesObj::ScDatabaseRangesObj()
uno::Reference<uno::XInterface> ScDatabaseRangesObj::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());
@@ -77,19 +67,14 @@ uno::Reference<uno::XInterface> ScDatabaseRangesObj::init()
void ScDatabaseRangesObj::setUp()
{
- nTest++;
- CPPUNIT_ASSERT(nTest <= NUMBER_OF_TESTS);
CalcUnoApiTest::setUp();
+ // create a calc document
+ mxComponent = loadFromDesktop("private:factory/scalc");
}
void ScDatabaseRangesObj::tearDown()
{
- if (nTest == NUMBER_OF_TESTS)
- {
- closeDocument(mxComponent);
- mxComponent.clear();
- }
-
+ closeDocument(mxComponent);
CalcUnoApiTest::tearDown();
}