Remove shared mxComponent (test document) in scsubtotalfieldobj
Change-Id: If47716c6dbc353059c42a2bcd09f7c11ed53796f Reviewed-on: https://gerrit.libreoffice.org/48937 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jens Carl <j.carl43@gmx.de>
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user