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

Remove shared mxComponent in sccellrangeobj

Change-Id: I6044091da3b883d885642bfda3dce8acc8044420
Reviewed-on: https://gerrit.libreoffice.org/48734Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarJens Carl <j.carl43@gmx.de>
üst 241fe1be
......@@ -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();
}
......
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