Kaydet (Commit) 876164d2 authored tarafından Jens Carl's avatar Jens Carl

Remove shared mxComponent in scannotationshapeobj

Change-Id: I5917ab813ab3583d5fc9bad81db7e050d1a523e0
Reviewed-on: https://gerrit.libreoffice.org/48648Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarJens Carl <j.carl43@gmx.de>
üst b5f8b046
...@@ -17,8 +17,6 @@ ...@@ -17,8 +17,6 @@
#include <com/sun/star/sheet/XSpreadsheet.hpp> #include <com/sun/star/sheet/XSpreadsheet.hpp>
#include <com/sun/star/table/CellAddress.hpp> #include <com/sun/star/table/CellAddress.hpp>
#define NUMBER_OF_TESTS 1
using namespace css; using namespace css;
using namespace css::uno; using namespace css::uno;
...@@ -42,13 +40,10 @@ public: ...@@ -42,13 +40,10 @@ public:
CPPUNIT_TEST_SUITE_END(); CPPUNIT_TEST_SUITE_END();
private: private:
static sal_Int32 nTest; uno::Reference<lang::XComponent> mxComponent;
static uno::Reference<lang::XComponent> mxComponent;
static uno::Reference<text::XTextContent> mxField; static uno::Reference<text::XTextContent> mxField;
}; };
sal_Int32 ScAnnotationShapeObj::nTest = 0;
uno::Reference<lang::XComponent> ScAnnotationShapeObj::mxComponent;
uno::Reference<text::XTextContent> ScAnnotationShapeObj::mxField; uno::Reference<text::XTextContent> ScAnnotationShapeObj::mxField;
ScAnnotationShapeObj::ScAnnotationShapeObj() ScAnnotationShapeObj::ScAnnotationShapeObj()
...@@ -58,29 +53,20 @@ ScAnnotationShapeObj::ScAnnotationShapeObj() ...@@ -58,29 +53,20 @@ ScAnnotationShapeObj::ScAnnotationShapeObj()
void ScAnnotationShapeObj::setUp() void ScAnnotationShapeObj::setUp()
{ {
nTest++;
CPPUNIT_ASSERT(nTest <= NUMBER_OF_TESTS);
CalcUnoApiTest::setUp(); CalcUnoApiTest::setUp();
mxComponent = loadFromDesktop("private:factory/scalc");
} }
void ScAnnotationShapeObj::tearDown() void ScAnnotationShapeObj::tearDown()
{ {
if (nTest == NUMBER_OF_TESTS) mxField.clear();
{ closeDocument(mxComponent);
mxField.clear();
closeDocument(mxComponent);
mxComponent.clear();
}
CalcUnoApiTest::tearDown(); CalcUnoApiTest::tearDown();
} }
uno::Reference<uno::XInterface> ScAnnotationShapeObj::init() 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); uno::Reference<sheet::XSpreadsheetDocument> xDoc(mxComponent, UNO_QUERY_THROW);
CPPUNIT_ASSERT_MESSAGE("no calc document", xDoc.is()); CPPUNIT_ASSERT_MESSAGE("no calc document", xDoc.is());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment