diff options
author | Jens Carl <j.carl43@gmx.de> | 2018-01-26 01:21:43 +0000 |
---|---|---|
committer | Jens Carl <j.carl43@gmx.de> | 2018-01-26 21:18:43 +0100 |
commit | 876164d2ebb654b525e4dcb49c61cf477d494ef5 (patch) | |
tree | afe8335c4a7745d2dc03d588806a5dcf99dc2c12 /sc/qa | |
parent | b5f8b046008a27f1da58b934dbe61c0decf36612 (diff) |
Remove shared mxComponent in scannotationshapeobj
Change-Id: I5917ab813ab3583d5fc9bad81db7e050d1a523e0
Reviewed-on: https://gerrit.libreoffice.org/48648
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Jens Carl <j.carl43@gmx.de>
Diffstat (limited to 'sc/qa')
-rw-r--r-- | sc/qa/extras/scannotationshapeobj.cxx | 22 |
1 files changed, 4 insertions, 18 deletions
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()); |