[Libreoffice-commits] core.git: sc/qa
Jens Carl
j.carl43 at gmx.de
Wed Jan 31 01:57:50 UTC 2018
sc/qa/extras/sctablesheetobj.cxx | 34 ++++------------------------------
1 file changed, 4 insertions(+), 30 deletions(-)
New commits:
commit 0d4ab5f616919b1a89ca2e6df53726af2020e3da
Author: Jens Carl <j.carl43 at gmx.de>
Date: Tue Jan 30 22:35:00 2018 +0000
Remove shared mxComponent (test document) in sctablesheetobj
Change-Id: I4c381b7f7520bf7d3103dfea22e3643b2eae01b1
Reviewed-on: https://gerrit.libreoffice.org/48940
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Jens Carl <j.carl43 at gmx.de>
diff --git a/sc/qa/extras/sctablesheetobj.cxx b/sc/qa/extras/sctablesheetobj.cxx
index ad859a6a4153..30a2d365dedb 100644
--- a/sc/qa/extras/sctablesheetobj.cxx
+++ b/sc/qa/extras/sctablesheetobj.cxx
@@ -42,8 +42,6 @@ using namespace css::uno;
namespace sc_apitest
{
-#define NUMBER_OF_TESTS 35
-
class ScTableSheetObj : public CalcUnoApiTest, public apitest::Scenario,
public apitest::XCellFormatRangesSupplier,
public apitest::XCellRangeAddressable,
@@ -170,13 +168,9 @@ public:
private:
OUString maFileURL;
- static sal_Int32 nTest;
- static uno::Reference< lang::XComponent > mxComponent;
+ uno::Reference< lang::XComponent > mxComponent;
};
-sal_Int32 ScTableSheetObj::nTest = 0;
-uno::Reference< lang::XComponent > ScTableSheetObj::mxComponent;
-
ScTableSheetObj::ScTableSheetObj():
CalcUnoApiTest("/sc/qa/extras/testdocuments"),
apitest::XCellSeries(1, 0),
@@ -187,11 +181,6 @@ ScTableSheetObj::ScTableSheetObj():
uno::Reference< uno::XInterface > ScTableSheetObj::init()
{
- createFileURL("ScTableSheetObj.ods", maFileURL);
- if (!mxComponent.is())
- mxComponent = loadFromDesktop(maFileURL, "com.sun.star.sheet.SpreadsheetDocument");
- CPPUNIT_ASSERT_MESSAGE("no component loaded", mxComponent.is());
-
uno::Reference< sheet::XSpreadsheetDocument > xDoc(mxComponent, UNO_QUERY_THROW);
CPPUNIT_ASSERT_MESSAGE("no calc document", xDoc.is());
@@ -219,11 +208,6 @@ uno::Reference< uno::XInterface > ScTableSheetObj::init()
uno::Reference<uno::XInterface> ScTableSheetObj::getScenarioSpreadsheet()
{
- createFileURL("ScTableSheetObj.ods", maFileURL);
- if (!mxComponent.is())
- mxComponent = loadFromDesktop(maFileURL, "com.sun.star.sheet.SpreadsheetDocument");
- CPPUNIT_ASSERT_MESSAGE("no component loaded", mxComponent.is());
-
uno::Reference<sheet::XSpreadsheetDocument> xDoc(mxComponent, UNO_QUERY_THROW);
CPPUNIT_ASSERT_MESSAGE("no calc document", xDoc.is());
@@ -252,11 +236,6 @@ uno::Reference<uno::XInterface> ScTableSheetObj::getScenarioSpreadsheet()
uno::Reference< uno::XInterface > ScTableSheetObj::getXSpreadsheet()
{
- createFileURL("ScTableSheetObj.ods", maFileURL);
- if (!mxComponent.is())
- mxComponent = loadFromDesktop(maFileURL, "com.sun.star.sheet.SpreadsheetDocument");
- CPPUNIT_ASSERT_MESSAGE("no component loaded", mxComponent.is());
-
uno::Reference< sheet::XSpreadsheetDocument > xDoc(mxComponent, UNO_QUERY_THROW);
CPPUNIT_ASSERT_MESSAGE("no calc document", xDoc.is());
@@ -288,19 +267,14 @@ OUString ScTableSheetObj::getFileURL()
void ScTableSheetObj::setUp()
{
- nTest++;
- CPPUNIT_ASSERT(nTest <= NUMBER_OF_TESTS);
CalcUnoApiTest::setUp();
+ createFileURL("ScTableSheetObj.ods", maFileURL);
+ mxComponent = loadFromDesktop(maFileURL, "com.sun.star.sheet.SpreadsheetDocument");
}
void ScTableSheetObj::tearDown()
{
- if (nTest == NUMBER_OF_TESTS)
- {
- closeDocument(mxComponent);
- mxComponent.clear();
- }
-
+ closeDocument(mxComponent);
CalcUnoApiTest::tearDown();
}
More information about the Libreoffice-commits
mailing list