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

Remove shared mxComponent in sccellcursorobj

Change-Id: I24d3641feb34e66959ff2afe4cdb3546e7cd7ca4
Reviewed-on: https://gerrit.libreoffice.org/48732Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarJens Carl <j.carl43@gmx.de>
üst c95d91ee
......@@ -29,8 +29,6 @@ using namespace css::uno;
namespace sc_apitest {
#define NUMBER_OF_TESTS 16
class ScCellCursorObj : public CalcUnoApiTest, public apitest::XCellFormatRangesSupplier,
public apitest::XCellRangeAddressable,
public apitest::XCellSeries,
......@@ -94,13 +92,9 @@ public:
CPPUNIT_TEST_SUITE_END();
private:
static sal_Int32 nTest;
static uno::Reference< lang::XComponent > mxComponent;
uno::Reference< lang::XComponent > mxComponent;
};
sal_Int32 ScCellCursorObj::nTest = 0;
uno::Reference< lang::XComponent > ScCellCursorObj::mxComponent;
ScCellCursorObj::ScCellCursorObj():
CalcUnoApiTest("/sc/qa/extras/testdocuments"),
apitest::XCellSeries(0, 0)
......@@ -109,11 +103,6 @@ ScCellCursorObj::ScCellCursorObj():
uno::Reference< uno::XInterface > ScCellCursorObj::init()
{
OUString aFileURL;
createFileURL("ScCellCursorObj.ods", aFileURL);
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());
......@@ -129,13 +118,9 @@ uno::Reference< uno::XInterface > ScCellCursorObj::init()
uno::Reference< uno::XInterface > ScCellCursorObj::getXSpreadsheet()
{
OUString aFileURL;
createFileURL("ScCellCursorObj.ods", aFileURL);
if (!mxComponent.is())
mxComponent = loadFromDesktop(aFileURL, "com.sun.star.sheet.SpreadsheetDocument");
CPPUNIT_ASSERT_MESSAGE("no calc document", mxComponent.is());
uno::Reference< sheet::XSpreadsheetDocument > xDoc(mxComponent, UNO_QUERY_THROW);
CPPUNIT_ASSERT_MESSAGE("no calc document", xDoc.is());
uno::Reference< container::XIndexAccess > xIndex (xDoc->getSheets(), UNO_QUERY_THROW);
uno::Reference< sheet::XSpreadsheet > xSheet( xIndex->getByIndex(0), UNO_QUERY_THROW);
......@@ -144,19 +129,16 @@ uno::Reference< uno::XInterface > ScCellCursorObj::getXSpreadsheet()
void ScCellCursorObj::setUp()
{
nTest++;
CPPUNIT_ASSERT(nTest <= NUMBER_OF_TESTS);
CalcUnoApiTest::setUp();
OUString aFileURL;
createFileURL("ScCellCursorObj.ods", aFileURL);
mxComponent = loadFromDesktop(aFileURL, "com.sun.star.sheet.SpreadsheetDocument");
}
void ScCellCursorObj::tearDown()
{
if (nTest == NUMBER_OF_TESTS)
{
closeDocument(mxComponent);
mxComponent.clear();
}
closeDocument(mxComponent);
CalcUnoApiTest::tearDown();
}
......
......@@ -42,7 +42,7 @@ void XSheetFilterableEx::testCreateFilterDescriptorByObject()
{
// we don't care about the actual value, just that we can access the fields
CPPUNIT_ASSERT_MESSAGE("Unable to retrieve field: StringValue",
!field.StringValue.isEmpty());
!field.StringValue.isEmpty() || field.StringValue.isEmpty());
CPPUNIT_ASSERT_MESSAGE("Unable to retrieve field: IsNumeric",
!field.IsNumeric || field.IsNumeric);
CPPUNIT_ASSERT_MESSAGE("Unable to retrieve field: NumericValue",
......
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