Kaydet (Commit) 2831ae4d authored tarafından Jens Carl's avatar Jens Carl

Remove shared mxComponent in scfunctionlistobj

Change-Id: I7fe5778afb397d62d9a7530fc094dd97011fbca7
Reviewed-on: https://gerrit.libreoffice.org/48882Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarJens Carl <j.carl43@gmx.de>
üst a52970b5
...@@ -22,8 +22,6 @@ using namespace com::sun::star; ...@@ -22,8 +22,6 @@ using namespace com::sun::star;
namespace sc_apitest namespace sc_apitest
{ {
#define NUMBER_OF_TESTS 1
class ScFunctionListObj : public CalcUnoApiTest, public apitest::XFunctionDescriptions class ScFunctionListObj : public CalcUnoApiTest, public apitest::XFunctionDescriptions
{ {
public: public:
...@@ -41,13 +39,9 @@ public: ...@@ -41,13 +39,9 @@ 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;
}; };
sal_Int32 ScFunctionListObj::nTest = 0;
uno::Reference<lang::XComponent> ScFunctionListObj::mxComponent;
ScFunctionListObj::ScFunctionListObj() ScFunctionListObj::ScFunctionListObj()
: CalcUnoApiTest("/sc/qa/extras/testdocuments") : CalcUnoApiTest("/sc/qa/extras/testdocuments")
{ {
...@@ -55,10 +49,6 @@ ScFunctionListObj::ScFunctionListObj() ...@@ -55,10 +49,6 @@ ScFunctionListObj::ScFunctionListObj()
uno::Reference<uno::XInterface> ScFunctionListObj::init() uno::Reference<uno::XInterface> ScFunctionListObj::init()
{ {
// create a calc document
if (!mxComponent.is())
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());
...@@ -68,19 +58,14 @@ uno::Reference<uno::XInterface> ScFunctionListObj::init() ...@@ -68,19 +58,14 @@ uno::Reference<uno::XInterface> ScFunctionListObj::init()
void ScFunctionListObj::setUp() void ScFunctionListObj::setUp()
{ {
nTest++;
CPPUNIT_ASSERT(nTest <= NUMBER_OF_TESTS);
CalcUnoApiTest::setUp(); CalcUnoApiTest::setUp();
// create a calc document
mxComponent = loadFromDesktop("private:factory/scalc");
} }
void ScFunctionListObj::tearDown() void ScFunctionListObj::tearDown()
{ {
if (nTest == NUMBER_OF_TESTS)
{
closeDocument(mxComponent); closeDocument(mxComponent);
mxComponent.clear();
}
CalcUnoApiTest::tearDown(); CalcUnoApiTest::tearDown();
} }
......
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