[Libreoffice-commits] core.git: sc/qa
Jens Carl
j.carl43 at gmx.de
Tue Jan 30 17:26:39 UTC 2018
sc/qa/extras/scdocumentconfigurationobj.cxx | 23 ++++-------------------
1 file changed, 4 insertions(+), 19 deletions(-)
New commits:
commit f783c02e9f55da8fa06725aef55342ec1ae7a56b
Author: Jens Carl <j.carl43 at gmx.de>
Date: Tue Jan 30 07:30:02 2018 +0000
Remove shared mxComponent in scdocumentconfigurationobj
Change-Id: I74004064d65307e3d4ddcd02a22f8e297aac7bb4
Reviewed-on: https://gerrit.libreoffice.org/48878
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Jens Carl <j.carl43 at gmx.de>
diff --git a/sc/qa/extras/scdocumentconfigurationobj.cxx b/sc/qa/extras/scdocumentconfigurationobj.cxx
index e2acbfca7c47..fd3527f6c3a7 100644
--- a/sc/qa/extras/scdocumentconfigurationobj.cxx
+++ b/sc/qa/extras/scdocumentconfigurationobj.cxx
@@ -23,8 +23,6 @@ using namespace com::sun::star;
namespace sc_apitest
{
-#define NUMBER_OF_TESTS 1
-
class ScDocumentConfigurationObj : public CalcUnoApiTest, public apitest::DocumentSettings
{
public:
@@ -43,13 +41,9 @@ public:
CPPUNIT_TEST_SUITE_END();
private:
- static sal_Int32 nTest;
- static uno::Reference<lang::XComponent> mxComponent;
+ uno::Reference<lang::XComponent> mxComponent;
};
-sal_Int32 ScDocumentConfigurationObj::nTest = 0;
-uno::Reference<lang::XComponent> ScDocumentConfigurationObj::mxComponent;
-
ScDocumentConfigurationObj::ScDocumentConfigurationObj()
: CalcUnoApiTest("/sc/qa/extras/testdocuments")
{
@@ -57,10 +51,6 @@ ScDocumentConfigurationObj::ScDocumentConfigurationObj()
uno::Reference<uno::XInterface> ScDocumentConfigurationObj::init()
{
- // create a calc document
- if (!mxComponent.is())
- mxComponent = loadFromDesktop("private:factory/scalc");
-
uno::Reference<sheet::XSpreadsheetDocument> xDoc(mxComponent, UNO_QUERY_THROW);
CPPUNIT_ASSERT_MESSAGE("no calc document", xDoc.is());
@@ -70,19 +60,14 @@ uno::Reference<uno::XInterface> ScDocumentConfigurationObj::init()
void ScDocumentConfigurationObj::setUp()
{
- nTest++;
- CPPUNIT_ASSERT(nTest <= NUMBER_OF_TESTS);
CalcUnoApiTest::setUp();
+ // create a calc document
+ mxComponent = loadFromDesktop("private:factory/scalc");
}
void ScDocumentConfigurationObj::tearDown()
{
- if (nTest == NUMBER_OF_TESTS)
- {
- closeDocument(mxComponent);
- mxComponent.clear();
- }
-
+ closeDocument(mxComponent);
CalcUnoApiTest::tearDown();
}
More information about the Libreoffice-commits
mailing list