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

Jens Carl j.carl43 at gmx.de
Fri Jan 26 20:19:08 UTC 2018


 sc/qa/extras/scannotationshapeobj.cxx |   22 ++++------------------
 1 file changed, 4 insertions(+), 18 deletions(-)

New commits:
commit 876164d2ebb654b525e4dcb49c61cf477d494ef5
Author: Jens Carl <j.carl43 at gmx.de>
Date:   Fri Jan 26 01:21:43 2018 +0000

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

diff --git a/sc/qa/extras/scannotationshapeobj.cxx b/sc/qa/extras/scannotationshapeobj.cxx
index 361c26a90525..dbcc32903920 100644
--- a/sc/qa/extras/scannotationshapeobj.cxx
+++ b/sc/qa/extras/scannotationshapeobj.cxx
@@ -17,8 +17,6 @@
 #include <com/sun/star/sheet/XSpreadsheet.hpp>
 #include <com/sun/star/table/CellAddress.hpp>
 
-#define NUMBER_OF_TESTS 1
-
 using namespace css;
 using namespace css::uno;
 
@@ -42,13 +40,10 @@ public:
     CPPUNIT_TEST_SUITE_END();
 
 private:
-    static sal_Int32 nTest;
-    static uno::Reference<lang::XComponent> mxComponent;
+    uno::Reference<lang::XComponent> mxComponent;
     static uno::Reference<text::XTextContent> mxField;
 };
 
-sal_Int32 ScAnnotationShapeObj::nTest = 0;
-uno::Reference<lang::XComponent> ScAnnotationShapeObj::mxComponent;
 uno::Reference<text::XTextContent> ScAnnotationShapeObj::mxField;
 
 ScAnnotationShapeObj::ScAnnotationShapeObj()
@@ -58,29 +53,20 @@ ScAnnotationShapeObj::ScAnnotationShapeObj()
 
 void ScAnnotationShapeObj::setUp()
 {
-    nTest++;
-    CPPUNIT_ASSERT(nTest <= NUMBER_OF_TESTS);
     CalcUnoApiTest::setUp();
+    mxComponent = loadFromDesktop("private:factory/scalc");
 }
 
 void ScAnnotationShapeObj::tearDown()
 {
-    if (nTest == NUMBER_OF_TESTS)
-    {
-        mxField.clear();
-        closeDocument(mxComponent);
-        mxComponent.clear();
-    }
+    mxField.clear();
+    closeDocument(mxComponent);
 
     CalcUnoApiTest::tearDown();
 }
 
 uno::Reference<uno::XInterface> ScAnnotationShapeObj::init()
 {
-    if (!mxComponent.is())
-        // Load an empty document.
-        mxComponent = loadFromDesktop("private:factory/scalc");
-
     uno::Reference<sheet::XSpreadsheetDocument> xDoc(mxComponent, UNO_QUERY_THROW);
     CPPUNIT_ASSERT_MESSAGE("no calc document", xDoc.is());
 


More information about the Libreoffice-commits mailing list