[Libreoffice-commits] core.git: sc/qa

Jens Carl j.carl43 at gmx.de
Tue Jan 30 17:38:36 UTC 2018


 sc/qa/extras/scimportdescriptorbaseobj.cxx |   27 ++++-----------------------
 1 file changed, 4 insertions(+), 23 deletions(-)

New commits:
commit 16846fd2b4343ee04b9098df9d0c60b0aed2c361
Author: Jens Carl <j.carl43 at gmx.de>
Date:   Tue Jan 30 07:52:38 2018 +0000

    Remove shared mxComponent in scimportdescriptorbaseobj
    
    Change-Id: I11e80ca9e985650db783a8bee6b0334ec5be0d4c
    Reviewed-on: https://gerrit.libreoffice.org/48885
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Jens Carl <j.carl43 at gmx.de>

diff --git a/sc/qa/extras/scimportdescriptorbaseobj.cxx b/sc/qa/extras/scimportdescriptorbaseobj.cxx
index e4957e95f131..fbb8b623d7c3 100644
--- a/sc/qa/extras/scimportdescriptorbaseobj.cxx
+++ b/sc/qa/extras/scimportdescriptorbaseobj.cxx
@@ -26,8 +26,6 @@ using namespace com::sun::star;
 
 namespace sc_apitest
 {
-#define NUMBER_OF_TESTS 1
-
 class ScImportDescriptorBaseObj : public CalcUnoApiTest, public apitest::DatabaseImportDescriptor
 {
 public:
@@ -47,13 +45,9 @@ public:
     CPPUNIT_TEST_SUITE_END();
 
 private:
-    static sal_Int32 nTest;
-    static uno::Reference<lang::XComponent> mxComponent;
+    uno::Reference<lang::XComponent> mxComponent;
 };
 
-sal_Int32 ScImportDescriptorBaseObj::nTest = 0;
-uno::Reference<lang::XComponent> ScImportDescriptorBaseObj::mxComponent;
-
 ScImportDescriptorBaseObj::ScImportDescriptorBaseObj()
     : CalcUnoApiTest("/sc/qa/extras/testdocuments")
 {
@@ -61,10 +55,6 @@ ScImportDescriptorBaseObj::ScImportDescriptorBaseObj()
 
 uno::Reference<uno::XInterface> ScImportDescriptorBaseObj::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,10 +67,6 @@ uno::Reference<uno::XInterface> ScImportDescriptorBaseObj::init()
 
 uno::Reference<uno::XInterface> ScImportDescriptorBaseObj::getXImportable()
 {
-    // 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());
 
@@ -94,19 +80,14 @@ uno::Reference<uno::XInterface> ScImportDescriptorBaseObj::getXImportable()
 
 void ScImportDescriptorBaseObj::setUp()
 {
-    nTest++;
-    CPPUNIT_ASSERT(nTest <= NUMBER_OF_TESTS);
     CalcUnoApiTest::setUp();
+    // create a calc document
+    mxComponent = loadFromDesktop("private:factory/scalc");
 }
 
 void ScImportDescriptorBaseObj::tearDown()
 {
-    if (nTest == NUMBER_OF_TESTS)
-    {
-        closeDocument(mxComponent);
-        mxComponent.clear();
-    }
-
+    closeDocument(mxComponent);
     CalcUnoApiTest::tearDown();
 }
 


More information about the Libreoffice-commits mailing list