[Libreoffice-commits] core.git: 2 commits - sc/qa
Jens Carl
j.carl43 at gmx.de
Sat Jan 27 17:48:19 UTC 2018
sc/qa/extras/sccellobj.cxx | 24 ++--------------------
sc/qa/extras/sccellrangeobj.cxx | 43 ++++++----------------------------------
2 files changed, 10 insertions(+), 57 deletions(-)
New commits:
commit acdb698fb762fc5769d3e3f3325f04e549c1722c
Author: Jens Carl <j.carl43 at gmx.de>
Date: Sat Jan 27 01:32:19 2018 +0000
Remove shared mxComponent in sccellrangeobj
Change-Id: I6044091da3b883d885642bfda3dce8acc8044420
Reviewed-on: https://gerrit.libreoffice.org/48734
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Jens Carl <j.carl43 at gmx.de>
diff --git a/sc/qa/extras/sccellrangeobj.cxx b/sc/qa/extras/sccellrangeobj.cxx
index 02cdf20e4948..8c9b9423696b 100644
--- a/sc/qa/extras/sccellrangeobj.cxx
+++ b/sc/qa/extras/sccellrangeobj.cxx
@@ -46,8 +46,6 @@ using namespace css::uno;
namespace sc_apitest {
-#define NUMBER_OF_TESTS 29
-
class ScCellRangeObj : public CalcUnoApiTest, public apitest::CellProperties,
public apitest::XCellFormatRangesSupplier,
public apitest::XCellRangeAddressable,
@@ -140,13 +138,9 @@ public:
CPPUNIT_TEST_SUITE_END();
private:
- static sal_Int32 nTest;
- static uno::Reference< lang::XComponent > mxComponent;
+ uno::Reference< lang::XComponent > mxComponent;
};
-sal_Int32 ScCellRangeObj::nTest = 0;
-uno::Reference< lang::XComponent > ScCellRangeObj::mxComponent;
-
ScCellRangeObj::ScCellRangeObj():
CalcUnoApiTest("/sc/qa/extras/testdocuments"),
apitest::XCellSeries(2, 1),
@@ -157,13 +151,6 @@ ScCellRangeObj::ScCellRangeObj():
uno::Reference< uno::XInterface > ScCellRangeObj::init()
{
- OUString aFileURL;
- const OUString aFileBase("xcellrangesquery.ods");
- createFileURL(aFileBase, aFileURL);
- std::cout << OUStringToOString(aFileURL, RTL_TEXTENCODING_UTF8).getStr() << std::endl;
- if (!mxComponent.is())
- mxComponent = loadFromDesktop(aFileURL, "com.sun.star.sheet.SpreadsheetDocument");
-
uno::Reference< sheet::XSpreadsheetDocument> xDoc (mxComponent, UNO_QUERY_THROW);
CPPUNIT_ASSERT_MESSAGE("no calc document!", xDoc.is());
@@ -180,13 +167,6 @@ uno::Reference< uno::XInterface > ScCellRangeObj::init()
uno::Reference< uno::XInterface > ScCellRangeObj::getXSpreadsheet()
{
- OUString aFileURL;
- const OUString aFileBase("xcellrangesquery.ods");
- createFileURL(aFileBase, aFileURL);
- std::cout << OUStringToOString(aFileURL, RTL_TEXTENCODING_UTF8).getStr() << std::endl;
- if (!mxComponent.is())
- mxComponent = loadFromDesktop(aFileURL, "com.sun.star.sheet.SpreadsheetDocument");
-
uno::Reference< sheet::XSpreadsheetDocument> xDoc (mxComponent, UNO_QUERY_THROW);
CPPUNIT_ASSERT_MESSAGE("no calc document!", xDoc.is());
@@ -198,13 +178,6 @@ uno::Reference< uno::XInterface > ScCellRangeObj::getXSpreadsheet()
uno::Reference< uno::XInterface > ScCellRangeObj::getXCellRangeData()
{
- OUString aFileURL;
- const OUString aFileBase("xcellrangesquery.ods");
- createFileURL(aFileBase, aFileURL);
- std::cout << OUStringToOString(aFileURL, RTL_TEXTENCODING_UTF8).getStr() << std::endl;
- if (!mxComponent.is())
- mxComponent = loadFromDesktop(aFileURL, "com.sun.star.sheet.SpreadsheetDocument");
-
uno::Reference< sheet::XSpreadsheetDocument> xDoc (mxComponent, UNO_QUERY_THROW);
CPPUNIT_ASSERT_MESSAGE("no calc document!", xDoc.is());
@@ -238,19 +211,17 @@ void ScCellRangeObj::testSortOOB()
void ScCellRangeObj::setUp()
{
- nTest++;
- CPPUNIT_ASSERT(nTest <= NUMBER_OF_TESTS);
CalcUnoApiTest::setUp();
+
+ OUString aFileURL;
+ const OUString aFileBase("xcellrangesquery.ods");
+ createFileURL(aFileBase, aFileURL);
+ mxComponent = loadFromDesktop(aFileURL, "com.sun.star.sheet.SpreadsheetDocument");
}
void ScCellRangeObj::tearDown()
{
- if (nTest == NUMBER_OF_TESTS)
- {
- closeDocument(mxComponent);
- mxComponent.clear();
- }
-
+ closeDocument(mxComponent);
CalcUnoApiTest::tearDown();
}
commit 241fe1be3b06d0c4c9cbfffd80a62465e485c1bd
Author: Jens Carl <j.carl43 at gmx.de>
Date: Sat Jan 27 01:26:04 2018 +0000
Remove shared mxComponent in sccellobj
Change-Id: I4b1fa30316c05cd0527ba429f8ad863db8be77a3
Reviewed-on: https://gerrit.libreoffice.org/48733
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Jens Carl <j.carl43 at gmx.de>
diff --git a/sc/qa/extras/sccellobj.cxx b/sc/qa/extras/sccellobj.cxx
index bd572af4c4f5..996d8a9f4268 100644
--- a/sc/qa/extras/sccellobj.cxx
+++ b/sc/qa/extras/sccellobj.cxx
@@ -27,8 +27,6 @@ using namespace css::uno;
namespace sc_apitest {
-#define NUMBER_OF_TESTS 3
-
class ScCellObj : public CalcUnoApiTest, public apitest::SheetCell,
public apitest::XCellAddressable,
public apitest::XSheetAnnotationAnchor
@@ -54,15 +52,9 @@ public:
CPPUNIT_TEST_SUITE_END();
private:
-
- static sal_Int32 nTest;
- static uno::Reference< lang::XComponent > mxComponent;
-
+ uno::Reference< lang::XComponent > mxComponent;
};
-sal_Int32 ScCellObj::nTest = 0;
-uno::Reference< lang::XComponent > ScCellObj::mxComponent;
-
ScCellObj::ScCellObj()
: CalcUnoApiTest("/sc/qa/extras/testdocuments")
{
@@ -70,10 +62,6 @@ ScCellObj::ScCellObj()
uno::Reference< uno::XInterface > ScCellObj::init()
{
- // create a calc document
- if (!mxComponent.is())
- mxComponent = loadFromDesktop("private:factory/scalc");
-
uno::Reference< sheet::XSpreadsheetDocument > xSheetDoc(mxComponent, uno::UNO_QUERY_THROW);
CPPUNIT_ASSERT_MESSAGE("no calc document", xSheetDoc.is());
@@ -91,19 +79,13 @@ uno::Reference< uno::XInterface > ScCellObj::init()
void ScCellObj::setUp()
{
- nTest++;
- CPPUNIT_ASSERT(nTest <= NUMBER_OF_TESTS);
CalcUnoApiTest::setUp();
+ mxComponent = loadFromDesktop("private:factory/scalc");
}
void ScCellObj::tearDown()
{
- if (nTest == NUMBER_OF_TESTS)
- {
- closeDocument(mxComponent);
- mxComponent.clear();
- }
-
+ closeDocument(mxComponent);
CalcUnoApiTest::tearDown();
}
More information about the Libreoffice-commits
mailing list