diff options
author | Jens Carl <j.carl43@gmx.de> | 2018-01-26 01:09:43 +0000 |
---|---|---|
committer | Jens Carl <j.carl43@gmx.de> | 2018-01-26 20:56:21 +0100 |
commit | c48dd8ee185b24322ce497ee74896c7288db008e (patch) | |
tree | 77a51a538247de1456136997590e1303d185cad2 /sc | |
parent | f8bcf01803f9a14ea326b6853eccd37eb3d7cfb9 (diff) |
Remove shared mxComponent in scannotationobj
Change-Id: I3c19399dcf590e7980592e2444553e5cccc0a0a8
Reviewed-on: https://gerrit.libreoffice.org/48646
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Jens Carl <j.carl43@gmx.de>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/qa/extras/scannotationobj.cxx | 29 |
1 files changed, 7 insertions, 22 deletions
diff --git a/sc/qa/extras/scannotationobj.cxx b/sc/qa/extras/scannotationobj.cxx index fd2bcfd4430d..18beb9dabb48 100644 --- a/sc/qa/extras/scannotationobj.cxx +++ b/sc/qa/extras/scannotationobj.cxx @@ -26,8 +26,6 @@ using namespace css::uno; namespace sc_apitest { -#define NUMBER_OF_TESTS 6 - class ScAnnontationObj : public CalcUnoApiTest, public apitest::XSheetAnnotation, public apitest::XSheetAnnotationShapeSupplier { public: @@ -54,12 +52,9 @@ public: CPPUNIT_TEST_SUITE_END(); private: - static sal_Int32 nTest; - static uno::Reference< lang::XComponent > mxComponent; + uno::Reference< lang::XComponent > mxComponent; }; -sal_Int32 ScAnnontationObj::nTest = 0; -uno::Reference< lang::XComponent > ScAnnontationObj::mxComponent; ScAnnontationObj::ScAnnontationObj() : CalcUnoApiTest("/sc/qa/extras/testdocuments") @@ -87,14 +82,6 @@ uno::Reference< sheet::XSheetAnnotation> ScAnnontationObj::getAnnotation(table:: uno::Reference< uno::XInterface > ScAnnontationObj::init() { - - // get the test file - OUString aFileURL; - createFileURL("ScAnnotationObj.ods", aFileURL); - if(!mxComponent.is()) - mxComponent = loadFromDesktop(aFileURL); - CPPUNIT_ASSERT_MESSAGE("Component not loaded",mxComponent.is()); - // tested annotation is in sheet 0 cell C2 table::CellAddress aCellAddress; aCellAddress.Sheet = 0; @@ -106,19 +93,17 @@ uno::Reference< uno::XInterface > ScAnnontationObj::init() void ScAnnontationObj::setUp() { - nTest++; - CPPUNIT_ASSERT(nTest <= NUMBER_OF_TESTS); CalcUnoApiTest::setUp(); + + // get the test file + OUString aFileURL; + createFileURL("ScAnnotationObj.ods", aFileURL); + mxComponent = loadFromDesktop(aFileURL); } void ScAnnontationObj::tearDown() { - if (nTest == NUMBER_OF_TESTS) - { - closeDocument(mxComponent); - mxComponent.clear(); - } - + closeDocument(mxComponent); CalcUnoApiTest::tearDown(); } |