Kaydet (Commit) 43b19dc7 authored tarafından Jens Carl's avatar Jens Carl

Remove shared mxComponent (test document) in scsubtotalfieldobj

Change-Id: If47716c6dbc353059c42a2bcd09f7c11ed53796f
Reviewed-on: https://gerrit.libreoffice.org/48937Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarJens Carl <j.carl43@gmx.de>
üst a8c10835
......@@ -31,8 +31,6 @@ using namespace com::sun::star;
namespace sc_apitest {
#define NUMBER_OF_TESTS 2
class ScSubTotalFieldObj : public CalcUnoApiTest, public apitest::XSubTotalField
{
public:
......@@ -51,14 +49,10 @@ public:
CPPUNIT_TEST_SUITE_END();
private:
static sal_Int32 nTest;
static uno::Reference< lang::XComponent > mxComponent;
uno::Reference< lang::XComponent > mxComponent;
};
sal_Int32 ScSubTotalFieldObj::nTest = 0;
uno::Reference< lang::XComponent > ScSubTotalFieldObj::mxComponent;
ScSubTotalFieldObj::ScSubTotalFieldObj()
: CalcUnoApiTest("/sc/qa/extras/testdocuments")
{
......@@ -66,10 +60,6 @@ ScSubTotalFieldObj::ScSubTotalFieldObj()
uno::Reference< uno::XInterface > ScSubTotalFieldObj::init()
{
// create a calc document
if (!mxComponent.is())
mxComponent = loadFromDesktop("private:factory/scalc");
uno::Reference< sheet::XSpreadsheetDocument > xDoc(mxComponent, uno::UNO_QUERY_THROW);
CPPUNIT_ASSERT_MESSAGE("no calc document", xDoc.is());
......@@ -94,19 +84,15 @@ uno::Reference< uno::XInterface > ScSubTotalFieldObj::init()
void ScSubTotalFieldObj::setUp()
{
nTest++;
CPPUNIT_ASSERT(nTest <= NUMBER_OF_TESTS);
CalcUnoApiTest::setUp();
// create a calc document
mxComponent = loadFromDesktop("private:factory/scalc");
}
void ScSubTotalFieldObj::tearDown()
{
if (nTest == NUMBER_OF_TESTS)
{
closeDocument(mxComponent);
mxComponent.clear();
}
closeDocument(mxComponent);
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