summaryrefslogtreecommitdiff
path: root/sc/qa/extras/sccellcursorobj.cxx
diff options
context:
space:
mode:
authorJens Carl <j.carl43@gmx.de>2017-11-08 21:15:09 +0000
committerJens Carl <j.carl43@gmx.de>2017-11-09 09:32:21 +0100
commitf1c97e9ff63cb6f120e618b3202260e0f8aefa0e (patch)
tree86f8615a49a91ab7042e8e0b98ab04a8000232f4 /sc/qa/extras/sccellcursorobj.cxx
parentfb72ec9b6222c8a18445c078c0367e7d507720af (diff)
tdf#45904 Move Java _XSheetFilterableEx tests to C++
Convert the Java _XSheetFilterableEx tests to C++ and make changes to the XSubTotalCalculatable::::testApplyRemoveSubTotals(), because XSheetFilterableEx::testCreateFilterDescriptorByObject() has to work with the same sheet. Change-Id: I89c11bc8f10ec8d2ff4b170aeb9df5a00ca98133 Reviewed-on: https://gerrit.libreoffice.org/44512 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jens Carl <j.carl43@gmx.de>
Diffstat (limited to 'sc/qa/extras/sccellcursorobj.cxx')
-rw-r--r--sc/qa/extras/sccellcursorobj.cxx26
1 files changed, 17 insertions, 9 deletions
diff --git a/sc/qa/extras/sccellcursorobj.cxx b/sc/qa/extras/sccellcursorobj.cxx
index f5663714b7be..26dcb3f86bc4 100644
--- a/sc/qa/extras/sccellcursorobj.cxx
+++ b/sc/qa/extras/sccellcursorobj.cxx
@@ -11,6 +11,7 @@
#include <test/sheet/xcellseries.hxx>
#include <test/sheet/xsheetcellrange.hxx>
#include <test/sheet/xsheetfilterable.hxx>
+#include <test/sheet/xsheetfilterableex.hxx>
#include <test/sheet/xsheetoperation.hxx>
#include <test/sheet/xsubtotalcalculatable.hxx>
#include <test/sheet/xusedareacursor.hxx>
@@ -25,11 +26,12 @@ using namespace css::uno;
namespace sc_apitest {
-#define NUMBER_OF_TESTS 12
+#define NUMBER_OF_TESTS 13
class ScCellCursorObj : public CalcUnoApiTest, public apitest::XCellSeries,
public apitest::XSheetCellRange,
public apitest::XSheetFilterable,
+ public apitest::XSheetFilterableEx,
public apitest::XSheetOperation,
public apitest::XSubTotalCalculatable,
public apitest::XUsedAreaCursor,
@@ -60,6 +62,9 @@ public:
CPPUNIT_TEST(testCreateFilterDescriptor);
CPPUNIT_TEST(testFilter);
+ // XSheetFilterableEx
+ CPPUNIT_TEST(testCreateFilterDescriptorByObject);
+
// XSheetOperation
CPPUNIT_TEST(testComputeFunction);
CPPUNIT_TEST(testClearContents);
@@ -91,14 +96,17 @@ uno::Reference< uno::XInterface > ScCellCursorObj::init()
{
OUString aFileURL;
createFileURL("ScCellCursorObj.ods", aFileURL);
- if(!mxComponent.is())
+ if (!mxComponent.is())
mxComponent = loadFromDesktop(aFileURL, "com.sun.star.sheet.SpreadsheetDocument");
- CPPUNIT_ASSERT(mxComponent.is());
+ CPPUNIT_ASSERT_MESSAGE("no calc document", mxComponent.is());
- uno::Reference< sheet::XSpreadsheetDocument > xDoc(mxComponent, UNO_QUERY_THROW);
- uno::Reference< container::XIndexAccess > xIndex (xDoc->getSheets(), UNO_QUERY_THROW);
- uno::Reference< sheet::XSpreadsheet > xSheet( xIndex->getByIndex(0), UNO_QUERY_THROW);
- uno::Reference< table::XCellCursor > xCellCursor( xSheet->createCursor(), UNO_QUERY_THROW);
+ uno::Reference<sheet::XSpreadsheetDocument> xDoc(mxComponent, UNO_QUERY_THROW);
+ uno::Reference<container::XIndexAccess> xIndex (xDoc->getSheets(), UNO_QUERY_THROW);
+ uno::Reference<sheet::XSpreadsheet> xSheet(xIndex->getByIndex(0), UNO_QUERY_THROW);
+
+ uno::Reference<table::XCellRange> xCellRange = xSheet->getCellRangeByName("$A$1:$D$4");
+ uno::Reference<sheet::XSheetCellRange> xSheetCellRange(xCellRange, UNO_QUERY_THROW);
+ uno::Reference<table::XCellCursor> xCellCursor(xSheet->createCursorByRange(xSheetCellRange), UNO_QUERY_THROW);
return xCellCursor;
}
@@ -107,9 +115,9 @@ uno::Reference< uno::XInterface > ScCellCursorObj::getXSpreadsheet()
{
OUString aFileURL;
createFileURL("ScCellCursorObj.ods", aFileURL);
- if(!mxComponent.is())
+ if (!mxComponent.is())
mxComponent = loadFromDesktop(aFileURL, "com.sun.star.sheet.SpreadsheetDocument");
- CPPUNIT_ASSERT(mxComponent.is());
+ CPPUNIT_ASSERT_MESSAGE("no calc document", mxComponent.is());
uno::Reference< sheet::XSpreadsheetDocument > xDoc(mxComponent, UNO_QUERY_THROW);
uno::Reference< container::XIndexAccess > xIndex (xDoc->getSheets(), UNO_QUERY_THROW);