[Libreoffice-commits] core.git: sc/qa
Jens Carl
j.carl43 at gmx.de
Wed Jan 31 00:23:57 UTC 2018
sc/qa/extras/sctableconditionalformatobj.cxx | 23 ++++-------------------
1 file changed, 4 insertions(+), 19 deletions(-)
New commits:
commit d88e9c4be7110c9cbafb98dffa7a3b7c4126459e
Author: Jens Carl <j.carl43 at gmx.de>
Date: Tue Jan 30 21:56:31 2018 +0000
Remove shared mxComponent (test document) in sctableconditionalformatobj
Change-Id: I9a255067cce2ae013d1054fbad7efa10bce4378b
Reviewed-on: https://gerrit.libreoffice.org/48939
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Jens Carl <j.carl43 at gmx.de>
diff --git a/sc/qa/extras/sctableconditionalformatobj.cxx b/sc/qa/extras/sctableconditionalformatobj.cxx
index b1ba62f93c53..0d83f94ff33f 100644
--- a/sc/qa/extras/sctableconditionalformatobj.cxx
+++ b/sc/qa/extras/sctableconditionalformatobj.cxx
@@ -34,8 +34,6 @@ using namespace com::sun::star;
namespace sc_apitest
{
-#define NUMBER_OF_TESTS 3
-
class ScTableConditionalFormatObj : public CalcUnoApiTest, public apitest::XSheetConditionalEntries
{
public:
@@ -56,13 +54,9 @@ public:
CPPUNIT_TEST_SUITE_END();
private:
- static sal_Int32 nTest;
- static uno::Reference<lang::XComponent> mxComponent;
+ uno::Reference<lang::XComponent> mxComponent;
};
-sal_Int32 ScTableConditionalFormatObj::nTest = 0;
-uno::Reference<lang::XComponent> ScTableConditionalFormatObj::mxComponent;
-
ScTableConditionalFormatObj::ScTableConditionalFormatObj()
: CalcUnoApiTest("/sc/qa/extras/testdocuments")
{
@@ -70,10 +64,6 @@ ScTableConditionalFormatObj::ScTableConditionalFormatObj()
uno::Reference<uno::XInterface> ScTableConditionalFormatObj::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());
@@ -114,19 +104,14 @@ uno::Sequence<beans::PropertyValue> ScTableConditionalFormatObj::createCondition
void ScTableConditionalFormatObj::setUp()
{
- nTest++;
- CPPUNIT_ASSERT(nTest <= NUMBER_OF_TESTS);
CalcUnoApiTest::setUp();
+ // create a calc document
+ mxComponent = loadFromDesktop("private:factory/scalc");
}
void ScTableConditionalFormatObj::tearDown()
{
- if (nTest == NUMBER_OF_TESTS)
- {
- closeDocument(mxComponent);
- mxComponent.clear();
- }
-
+ closeDocument(mxComponent);
CalcUnoApiTest::tearDown();
}
More information about the Libreoffice-commits
mailing list