diff options
author | Jens Carl <j.carl43@gmx.de> | 2017-11-02 08:14:14 +0000 |
---|---|---|
committer | Jens Carl <j.carl43@gmx.de> | 2017-11-03 04:10:14 +0100 |
commit | bda85f9563b03bb36c7d72dc1178661b3bf23df0 (patch) | |
tree | 4b5a926bcccfc276e88eec808af5064c78b794fe /sc | |
parent | 44e9640748791f602edb22cbc499200283466e1e (diff) |
tdf#45904 Move Java _XSheetCellRanges tests to C++
Change-Id: I6f6dcbc5368ce034c25553edf8b88c6669074243
Reviewed-on: https://gerrit.libreoffice.org/44194
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Jens Carl <j.carl43@gmx.de>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/qa/extras/sccellrangesobj.cxx | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/sc/qa/extras/sccellrangesobj.cxx b/sc/qa/extras/sccellrangesobj.cxx index 9e8d287e125d..aaa1fa786c7d 100644 --- a/sc/qa/extras/sccellrangesobj.cxx +++ b/sc/qa/extras/sccellrangesobj.cxx @@ -9,6 +9,7 @@ #include <test/calc_unoapi_test.hxx> #include <test/sheet/xsheetoperation.hxx> +#include <test/sheet/xsheetcellranges.hxx> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/container/XIndexAccess.hpp> @@ -25,9 +26,11 @@ using namespace css::uno; namespace sc_apitest { -#define NUMBER_OF_TESTS 2 +#define NUMBER_OF_TESTS 5 -class ScCellRangesObj : public CalcUnoApiTest, public apitest::XSheetOperation +class ScCellRangesObj : public CalcUnoApiTest, + public apitest::XSheetCellRanges, + public apitest::XSheetOperation { public: ScCellRangesObj(); @@ -39,6 +42,11 @@ public: CPPUNIT_TEST_SUITE(ScCellRangesObj); + // XSheetCellRanges + CPPUNIT_TEST(testGetCells); + CPPUNIT_TEST(testGetRangeAddresses); + CPPUNIT_TEST(testGetRangeAddressesAsString); + // XSheetOperation CPPUNIT_TEST(testComputeFunction); CPPUNIT_TEST(testClearContents); @@ -72,9 +80,7 @@ uno::Reference< uno::XInterface > ScCellRangesObj::init() uno::Reference< lang::XMultiServiceFactory > xMSF(xDoc, uno::UNO_QUERY_THROW); uno::Reference< container::XNameContainer > xRanges(xMSF->createInstance("com.sun.star.sheet.SheetCellRanges"), uno::UNO_QUERY_THROW); - //uno::Reference< container::XNameContainer > xRanges(xSheet, uno::UNO_QUERY_THROW); uno::Any xCellRange; - xCellRange <<= xSheet->getCellRangeByName("C1:D4"); xRanges->insertByName("Range1", xCellRange); xCellRange <<= xSheet->getCellRangeByName("E2:F5"); @@ -84,6 +90,13 @@ uno::Reference< uno::XInterface > ScCellRangesObj::init() xCellRange <<= xSheet->getCellRangeByName("I7:J8"); xRanges->insertByName("Range4", xCellRange); + for ( int i = 0; i < 10; i++ ) + { + for ( int j = 5; j < 10; j++ ) + { + xSheet->getCellByPosition(i, j)->setValue(i + j); + } + } return xRanges; } |