[Libreoffice-commits] core.git: sc/qa
Jens Carl
j.carl43 at gmx.de
Tue Jan 30 21:38:23 UTC 2018
sc/qa/extras/sclabelrangesobj.cxx | 23 ++++-------------------
1 file changed, 4 insertions(+), 19 deletions(-)
New commits:
commit f8f4e9e605daf307a32531bbe8c89fd4575fea4e
Author: Jens Carl <j.carl43 at gmx.de>
Date: Tue Jan 30 18:07:25 2018 +0000
Remove shared mxComponent (test document) in sclabelrangesobj
Change-Id: I79fb234a55fa03cd0c45bcc22903963f2a353fe5
Reviewed-on: https://gerrit.libreoffice.org/48920
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Jens Carl <j.carl43 at gmx.de>
diff --git a/sc/qa/extras/sclabelrangesobj.cxx b/sc/qa/extras/sclabelrangesobj.cxx
index fd97e7be5261..e10554dae405 100644
--- a/sc/qa/extras/sclabelrangesobj.cxx
+++ b/sc/qa/extras/sclabelrangesobj.cxx
@@ -25,8 +25,6 @@ using namespace com::sun::star;
namespace sc_apitest
{
-#define NUMBER_OF_TESTS 2
-
class ScLabelRangesObj : public CalcUnoApiTest, public apitest::XLabelRanges
{
public:
@@ -45,13 +43,9 @@ public:
CPPUNIT_TEST_SUITE_END();
private:
- static sal_Int32 nTest;
- static uno::Reference<lang::XComponent> mxComponent;
+ uno::Reference<lang::XComponent> mxComponent;
};
-sal_Int32 ScLabelRangesObj::nTest = 0;
-uno::Reference<lang::XComponent> ScLabelRangesObj::mxComponent;
-
ScLabelRangesObj::ScLabelRangesObj()
: CalcUnoApiTest("/sc/qa/extras/testdocuments")
{
@@ -59,10 +53,6 @@ ScLabelRangesObj::ScLabelRangesObj()
uno::Reference<uno::XInterface> ScLabelRangesObj::init()
{
- // create a 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());
@@ -79,19 +69,14 @@ uno::Reference<uno::XInterface> ScLabelRangesObj::init()
void ScLabelRangesObj::setUp()
{
- nTest++;
- CPPUNIT_ASSERT(nTest <= NUMBER_OF_TESTS);
CalcUnoApiTest::setUp();
+ // create a calc document
+ mxComponent = loadFromDesktop("private:factory/scalc");
}
void ScLabelRangesObj::tearDown()
{
- if (nTest == NUMBER_OF_TESTS)
- {
- closeDocument(mxComponent);
- mxComponent.clear();
- }
-
+ closeDocument(mxComponent);
CalcUnoApiTest::tearDown();
}
More information about the Libreoffice-commits
mailing list