[Libreoffice-commits] core.git: 2 commits - sc/qa
Jens Carl
j.carl43 at gmx.de
Sat Jan 27 07:32:30 UTC 2018
sc/qa/extras/scarealinkobj.cxx | 22 +++-------------------
sc/qa/extras/scarealinksobj.cxx | 22 +++-------------------
2 files changed, 6 insertions(+), 38 deletions(-)
New commits:
commit 926ce174109c6e140012bf2dca92650f38d7e9ba
Author: Jens Carl <j.carl43 at gmx.de>
Date: Sat Jan 27 01:09:24 2018 +0000
Remove shared mxComponent in scarealinksobj
Change-Id: I86263b5d023b095759d572421d3ef1fc291c0cfd
Reviewed-on: https://gerrit.libreoffice.org/48730
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Jens Carl <j.carl43 at gmx.de>
diff --git a/sc/qa/extras/scarealinksobj.cxx b/sc/qa/extras/scarealinksobj.cxx
index 21a90ee6f6c0..df65526c8d0f 100644
--- a/sc/qa/extras/scarealinksobj.cxx
+++ b/sc/qa/extras/scarealinksobj.cxx
@@ -22,8 +22,6 @@ using namespace css::uno;
namespace sc_apitest {
-#define NUMBER_OF_TESTS 2
-
class ScAreaLinksObj : public CalcUnoApiTest, public apitest::XAreaLinks
{
public:
@@ -42,14 +40,10 @@ public:
CPPUNIT_TEST_SUITE_END();
private:
- static sal_Int32 nTest;
- static uno::Reference< lang::XComponent > mxComponent;
+ uno::Reference< lang::XComponent > mxComponent;
};
-sal_Int32 ScAreaLinksObj::nTest = 0;
-uno::Reference< lang::XComponent > ScAreaLinksObj::mxComponent;
-
ScAreaLinksObj::ScAreaLinksObj()
: CalcUnoApiTest("/sc/qa/extras/testdocuments")
{
@@ -57,10 +51,6 @@ ScAreaLinksObj::ScAreaLinksObj()
uno::Reference< uno::XInterface > ScAreaLinksObj::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());
@@ -72,19 +62,13 @@ uno::Reference< uno::XInterface > ScAreaLinksObj::init()
void ScAreaLinksObj::setUp()
{
- nTest++;
- CPPUNIT_ASSERT(nTest <= NUMBER_OF_TESTS);
CalcUnoApiTest::setUp();
+ mxComponent = loadFromDesktop("private:factory/scalc");
}
void ScAreaLinksObj::tearDown()
{
- if (nTest == NUMBER_OF_TESTS)
- {
- closeDocument(mxComponent);
- mxComponent.clear();
- }
-
+ closeDocument(mxComponent);
CalcUnoApiTest::tearDown();
}
commit 06d3f998658c677a42934369a72b18d70165552b
Author: Jens Carl <j.carl43 at gmx.de>
Date: Fri Jan 26 23:14:08 2018 +0000
Remove shared mxComponent in scarealinkobj
Change-Id: I5bcebbf203b86b7a3875643e66ddd0a783f55986
Reviewed-on: https://gerrit.libreoffice.org/48728
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Jens Carl <j.carl43 at gmx.de>
diff --git a/sc/qa/extras/scarealinkobj.cxx b/sc/qa/extras/scarealinkobj.cxx
index c84d0964dbb9..c0c8c6c9b188 100644
--- a/sc/qa/extras/scarealinkobj.cxx
+++ b/sc/qa/extras/scarealinkobj.cxx
@@ -27,8 +27,6 @@ using namespace css::uno;
namespace sc_apitest {
-#define NUMBER_OF_TESTS 9
-
class ScAreaLinkObj : public CalcUnoApiTest, public apitest::CellAreaLink, public apitest::XAreaLink
{
public:
@@ -56,14 +54,10 @@ public:
CPPUNIT_TEST_SUITE_END();
private:
- static sal_Int32 nTest;
- static uno::Reference< lang::XComponent > mxComponent;
+ uno::Reference< lang::XComponent > mxComponent;
};
-sal_Int32 ScAreaLinkObj::nTest = 0;
-uno::Reference< lang::XComponent > ScAreaLinkObj::mxComponent;
-
ScAreaLinkObj::ScAreaLinkObj()
: CalcUnoApiTest("/sc/qa/extras/testdocuments")
{
@@ -71,10 +65,6 @@ ScAreaLinkObj::ScAreaLinkObj()
uno::Reference< uno::XInterface > ScAreaLinkObj::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());
@@ -90,19 +80,13 @@ uno::Reference< uno::XInterface > ScAreaLinkObj::init()
void ScAreaLinkObj::setUp()
{
- nTest++;
- CPPUNIT_ASSERT(nTest <= NUMBER_OF_TESTS);
CalcUnoApiTest::setUp();
+ mxComponent = loadFromDesktop("private:factory/scalc");
}
void ScAreaLinkObj::tearDown()
{
- if (nTest == NUMBER_OF_TESTS)
- {
- closeDocument(mxComponent);
- mxComponent.clear();
- }
-
+ closeDocument(mxComponent);
CalcUnoApiTest::tearDown();
}
More information about the Libreoffice-commits
mailing list