Remove shared mxComponent in sccellcursorobj
Change-Id: I24d3641feb34e66959ff2afe4cdb3546e7cd7ca4 Reviewed-on: https://gerrit.libreoffice.org/48732 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jens Carl <j.carl43@gmx.de>
This commit is contained in:
parent
c95d91ee35
commit
f0850acf53
@ -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",
|
||||
|
Loading…
x
Reference in New Issue
Block a user