summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/test/sheet/xcellrangeformula.hxx34
-rw-r--r--qadevOOo/Jar_OOoRunner.mk1
-rw-r--r--qadevOOo/objdsc/sc/com.sun.star.comp.office.ScCellCursorObj.csv2
-rw-r--r--qadevOOo/objdsc/sc/com.sun.star.comp.office.ScCellRangeObj.csv2
-rw-r--r--qadevOOo/objdsc/sc/com.sun.star.comp.office.ScTableSheetObj.csv2
-rw-r--r--qadevOOo/tests/java/ifc/sheet/_XCellRangeFormula.java62
-rw-r--r--sc/qa/extras/sccellcursorobj.cxx11
-rw-r--r--sc/qa/extras/sccellrangeobj.cxx37
-rw-r--r--sc/qa/extras/sctablesheetobj.cxx7
-rw-r--r--test/Library_subsequenttest.mk1
-rw-r--r--test/source/sheet/xcellrangeformula.cxx41
11 files changed, 112 insertions, 88 deletions
diff --git a/include/test/sheet/xcellrangeformula.hxx b/include/test/sheet/xcellrangeformula.hxx
new file mode 100644
index 000000000000..9fcc432c8358
--- /dev/null
+++ b/include/test/sheet/xcellrangeformula.hxx
@@ -0,0 +1,34 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef INCLUDED_TEST_SHEET_XCELLRANGEFORMULA_HXX
+#define INCLUDED_TEST_SHEET_XCELLRANGEFORMULA_HXX
+
+#include <com/sun/star/uno/XInterface.hpp>
+#include <com/sun/star/uno/Reference.hxx>
+
+#include <test/testdllapi.hxx>
+
+namespace apitest
+{
+class OOO_DLLPUBLIC_TEST XCellRangeFormula
+{
+public:
+ virtual css::uno::Reference<css::uno::XInterface> init() = 0;
+
+ void testGetSetFormulaArray();
+
+protected:
+ ~XCellRangeFormula() {}
+};
+} // namespace apitest
+
+#endif // INCLUDED_TEST_SHEET_XCELLRANGEFORMULA_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/qadevOOo/Jar_OOoRunner.mk b/qadevOOo/Jar_OOoRunner.mk
index ec99ac93dde8..9e076552c42e 100644
--- a/qadevOOo/Jar_OOoRunner.mk
+++ b/qadevOOo/Jar_OOoRunner.mk
@@ -567,7 +567,6 @@ $(eval $(call gb_Jar_add_sourcefiles,OOoRunner,\
qadevOOo/tests/java/ifc/sheet/_SpreadsheetDocument \
qadevOOo/tests/java/ifc/sheet/_TableAutoFormatField \
qadevOOo/tests/java/ifc/sheet/_XCellRangeData \
- qadevOOo/tests/java/ifc/sheet/_XCellRangeFormula \
qadevOOo/tests/java/ifc/sheet/_XCellRangeMovement \
qadevOOo/tests/java/ifc/sheet/_XCellRangeReferrer \
qadevOOo/tests/java/ifc/sheet/_XCellRangesQuery \
diff --git a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScCellCursorObj.csv b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScCellCursorObj.csv
index f5563cfe7758..cf6417dcdf44 100644
--- a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScCellCursorObj.csv
+++ b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScCellCursorObj.csv
@@ -116,8 +116,6 @@
"ScCellCursorObj";"com::sun::star::style::CharacterPropertiesComplex";"CharLocaleComplex"
"ScCellCursorObj";"com::sun::star::sheet::XFormulaQuery";"queryDependents()"
"ScCellCursorObj";"com::sun::star::sheet::XFormulaQuery";"queryPrecedents()"
-"ScCellCursorObj";"com::sun::star::sheet::XCellRangeFormula#optional";"getFormulaArray()"
-"ScCellCursorObj";"com::sun::star::sheet::XCellRangeFormula#optional";"setFormulaArray()"
"ScCellCursorObj";"com::sun::star::util::XIndent";"decrementIndent()"
"ScCellCursorObj";"com::sun::star::util::XIndent";"incrementIndent()"
"ScCellCursorObj";"com::sun::star::table::XAutoFormattable";"autoFormat()"
diff --git a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScCellRangeObj.csv b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScCellRangeObj.csv
index fb6d2e76829d..3ca844258495 100644
--- a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScCellRangeObj.csv
+++ b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScCellRangeObj.csv
@@ -111,8 +111,6 @@
"ScCellRangeObj";"com::sun::star::style::CharacterPropertiesComplex";"CharLocaleComplex"
"ScCellRangeObj";"com::sun::star::sheet::XFormulaQuery";"queryDependents()"
"ScCellRangeObj";"com::sun::star::sheet::XFormulaQuery";"queryPrecedents()"
-"ScCellRangeObj";"com::sun::star::sheet::XCellRangeFormula#optional";"getFormulaArray()"
-"ScCellRangeObj";"com::sun::star::sheet::XCellRangeFormula#optional";"setFormulaArray()"
"ScCellRangeObj";"com::sun::star::util::XIndent";"decrementIndent()"
"ScCellRangeObj";"com::sun::star::util::XIndent";"incrementIndent()"
"ScCellRangeObj";"com::sun::star::table::XAutoFormattable";"autoFormat()"
diff --git a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScTableSheetObj.csv b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScTableSheetObj.csv
index b6ac12b4e1e9..62789eeed452 100644
--- a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScTableSheetObj.csv
+++ b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScTableSheetObj.csv
@@ -114,8 +114,6 @@
"ScTableSheetObj";"com::sun::star::util::XProtectable";"isProtected()"
"ScTableSheetObj";"com::sun::star::sheet::XFormulaQuery";"queryDependents()"
"ScTableSheetObj";"com::sun::star::sheet::XFormulaQuery";"queryPrecedents()"
-"ScTableSheetObj";"com::sun::star::sheet::XCellRangeFormula#optional";"getFormulaArray()"
-"ScTableSheetObj";"com::sun::star::sheet::XCellRangeFormula#optional";"setFormulaArray()"
"ScTableSheetObj";"com::sun::star::util::XIndent";"decrementIndent()"
"ScTableSheetObj";"com::sun::star::util::XIndent";"incrementIndent()"
"ScTableSheetObj";"com::sun::star::table::XAutoFormattable";"autoFormat()"
diff --git a/qadevOOo/tests/java/ifc/sheet/_XCellRangeFormula.java b/qadevOOo/tests/java/ifc/sheet/_XCellRangeFormula.java
deleted file mode 100644
index 1b3c588d890e..000000000000
--- a/qadevOOo/tests/java/ifc/sheet/_XCellRangeFormula.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-package ifc.sheet;
-
-import com.sun.star.sheet.XCellRangeFormula;
-
-public class _XCellRangeFormula extends lib.MultiMethodTest {
-
- public XCellRangeFormula oObj = null;
-
- public String[][] orgValue = null;
-
- public void _getFormulaArray() {
- Object noArray = tEnv.getObjRelation("noArray");
- if (noArray != null) {
- log.println("Component " + noArray.toString() +
- " doesn't really support this Interface");
- log.println("It doesn't make sense to get an FormulaArray from"
- + " the whole sheet");
- tRes.tested("getFormulaArray()", true);
- return;
- }
- orgValue = oObj.getFormulaArray();
- String[][] newValue = oObj.getFormulaArray();
- newValue[0][0] = "inserted";
- oObj.setFormulaArray(newValue);
- boolean res = oObj.getFormulaArray()[0][0].equals(newValue[0][0]);
- tRes.tested("getFormulaArray()",res);
- }
-
- public void _setFormulaArray() {
- requiredMethod("getFormulaArray()");
- Object noArray = tEnv.getObjRelation("noArray");
- if (noArray != null) {
- log.println("Component " + noArray.toString() +
- " doesn't really support this Interface");
- log.println("It doesn't make sense to set an FormulaArray over"
- + " the whole sheet");
- tRes.tested("setFormulaArray()", true);
- return;
- }
- oObj.setFormulaArray(orgValue);
- boolean res = oObj.getFormulaArray()[0][0].equals(orgValue[0][0]);
- tRes.tested("setFormulaArray()",res);
- }
-}
diff --git a/sc/qa/extras/sccellcursorobj.cxx b/sc/qa/extras/sccellcursorobj.cxx
index 4cab6702901e..8e3b0ca43b08 100644
--- a/sc/qa/extras/sccellcursorobj.cxx
+++ b/sc/qa/extras/sccellcursorobj.cxx
@@ -12,6 +12,7 @@
#include <test/sheet/xarrayformularange.hxx>
#include <test/sheet/xcellformatrangessupplier.hxx>
#include <test/sheet/xcellrangeaddressable.hxx>
+#include <test/sheet/xcellrangeformula.hxx>
#include <test/sheet/xcellseries.hxx>
#include <test/sheet/xmultipleoperation.hxx>
#include <test/sheet/xsheetcellrange.hxx>
@@ -35,6 +36,7 @@ class ScCellCursorObj : public CalcUnoApiTest, public apitest::SheetCellRange,
public apitest::XArrayFormulaRange,
public apitest::XCellFormatRangesSupplier,
public apitest::XCellRangeAddressable,
+ public apitest::XCellRangeFormula,
public apitest::XCellSeries,
public apitest::XMultipleOperation,
public apitest::XSheetCellRange,
@@ -61,19 +63,22 @@ public:
// XArrayFormulaRange
CPPUNIT_TEST(testGetSetArrayFormula);
- // XMultipleOperation
- CPPUNIT_TEST(testSetTableOperation);
-
// XCellFormatRangesSupplier
CPPUNIT_TEST(testGetCellFormatRanges);
// XCellRangeAddressable
CPPUNIT_TEST(testGetRangeAddress);
+ // XCellRangeFormula
+ CPPUNIT_TEST(testGetSetFormulaArray);
+
// XCellSeries
CPPUNIT_TEST(testFillAuto);
CPPUNIT_TEST(testFillSeries);
+ // XMultipleOperation
+ CPPUNIT_TEST(testSetTableOperation);
+
// XSheetCellRange
CPPUNIT_TEST(testGetSpreadsheet);
diff --git a/sc/qa/extras/sccellrangeobj.cxx b/sc/qa/extras/sccellrangeobj.cxx
index 6267eb47faba..80ae6f8b664b 100644
--- a/sc/qa/extras/sccellrangeobj.cxx
+++ b/sc/qa/extras/sccellrangeobj.cxx
@@ -14,6 +14,7 @@
#include <test/sheet/xcellformatrangessupplier.hxx>
#include <test/sheet/xcellrangeaddressable.hxx>
#include <test/sheet/xcellrangedata.hxx>
+#include <test/sheet/xcellrangeformula.hxx>
#include <test/sheet/xcellrangesquery.hxx>
#include <test/sheet/xcellseries.hxx>
#include <test/sheet/xmultipleoperation.hxx>
@@ -54,6 +55,7 @@ class ScCellRangeObj : public CalcUnoApiTest, public apitest::CellProperties,
public apitest::XCellFormatRangesSupplier,
public apitest::XCellRangeAddressable,
public apitest::XCellRangeData,
+ public apitest::XCellRangeFormula,
public apitest::XCellRangesQuery,
public apitest::XCellSeries,
public apitest::XMultipleOperation,
@@ -91,10 +93,6 @@ public:
// XCellFormatRangesSupplier
CPPUNIT_TEST(testGetCellFormatRanges);
- // XCellSeries
- CPPUNIT_TEST(testFillAuto);
- CPPUNIT_TEST(testFillSeries);
-
// XCellRangeAddressable
CPPUNIT_TEST(testGetRangeAddress);
@@ -102,6 +100,9 @@ public:
CPPUNIT_TEST(testGetDataArray);
CPPUNIT_TEST(testSetDataArray);
+ // XCellRangeFormula
+ CPPUNIT_TEST(testGetSetFormulaArray);
+
// XCellRangesQuery
CPPUNIT_TEST(testQueryColumnDifference);
CPPUNIT_TEST(testQueryContentDifference);
@@ -111,22 +112,27 @@ public:
CPPUNIT_TEST(testQueryRowDifference);
CPPUNIT_TEST(testQueryVisibleCells);
- // XSearchable
- CPPUNIT_TEST(testFindAll);
- CPPUNIT_TEST(testFindFirst);
+ // XCellSeries
+ CPPUNIT_TEST(testFillAuto);
+ CPPUNIT_TEST(testFillSeries);
// XMultipleOperation
CPPUNIT_TEST(testSetTableOperation);
- // XSheetCellRange
- CPPUNIT_TEST(testGetSpreadsheet);
-
// XReplaceable
CPPUNIT_TEST(testReplaceAll);
CPPUNIT_TEST(testCreateReplaceDescriptor);
- // XUniqueCellFormatRangesSupplier
- CPPUNIT_TEST(testGetUniqueCellFormatRanges);
+ // XSearchable
+ CPPUNIT_TEST(testFindAll);
+ CPPUNIT_TEST(testFindFirst);
+
+ // XSheetCellRange
+ CPPUNIT_TEST(testGetSpreadsheet);
+
+ // XSheetFilterable
+ CPPUNIT_TEST(testCreateFilterDescriptor);
+ CPPUNIT_TEST(testFilter);
// XSheetFilterableEx
CPPUNIT_TEST(testCreateFilterDescriptorByObject);
@@ -139,11 +145,10 @@ public:
CPPUNIT_TEST(testCreateSubTotalDescriptor);
CPPUNIT_TEST(testApplyRemoveSubTotals);
- CPPUNIT_TEST(testSortOOB);
+ // XUniqueCellFormatRangesSupplier
+ CPPUNIT_TEST(testGetUniqueCellFormatRanges);
- // XSheetFilterable (has to be last tests; otherwise it'll crash)
- CPPUNIT_TEST(testCreateFilterDescriptor);
- CPPUNIT_TEST(testFilter);
+ CPPUNIT_TEST(testSortOOB);
CPPUNIT_TEST_SUITE_END();
diff --git a/sc/qa/extras/sctablesheetobj.cxx b/sc/qa/extras/sctablesheetobj.cxx
index 3ea088d48249..8e712f26422a 100644
--- a/sc/qa/extras/sctablesheetobj.cxx
+++ b/sc/qa/extras/sctablesheetobj.cxx
@@ -14,6 +14,7 @@
#include <test/sheet/xarrayformularange.hxx>
#include <test/sheet/xcellformatrangessupplier.hxx>
#include <test/sheet/xcellrangeaddressable.hxx>
+#include <test/sheet/xcellrangeformula.hxx>
#include <test/sheet/xcellseries.hxx>
#include <test/sheet/xdatapilottablessupplier.hxx>
#include <test/sheet/xmultipleoperation.hxx>
@@ -51,6 +52,7 @@ class ScTableSheetObj : public CalcUnoApiTest, public apitest::Scenario,
public apitest::XArrayFormulaRange,
public apitest::XCellFormatRangesSupplier,
public apitest::XCellRangeAddressable,
+ public apitest::XCellRangeFormula,
public apitest::XCellSeries,
public apitest::XDataPilotTablesSupplier,
public apitest::XMultipleOperation,
@@ -106,6 +108,11 @@ public:
// XCellRangeAddressable
CPPUNIT_TEST(testGetRangeAddress);
+ // XCellRangeFormula
+#if 0 // disable, because it makes no sense to set an FormulaArray over the whole sheet
+ CPPUNIT_TEST(testGetSetFormulaArray);
+#endif
+
// XCellSeries
CPPUNIT_TEST(testFillAuto);
CPPUNIT_TEST(testFillSeries);
diff --git a/test/Library_subsequenttest.mk b/test/Library_subsequenttest.mk
index a9db9f947b01..fe8729b40c9f 100644
--- a/test/Library_subsequenttest.mk
+++ b/test/Library_subsequenttest.mk
@@ -77,6 +77,7 @@ $(eval $(call gb_Library_add_exception_objects,subsequenttest,\
test/source/sheet/xcelladdressable \
test/source/sheet/xcellformatrangessupplier \
test/source/sheet/xcellrangeaddressable \
+ test/source/sheet/xcellrangeformula \
test/source/sheet/xcellrangedata \
test/source/sheet/xcellrangereferrer \
test/source/sheet/xcellrangesquery \
diff --git a/test/source/sheet/xcellrangeformula.cxx b/test/source/sheet/xcellrangeformula.cxx
new file mode 100644
index 000000000000..14b89b0d0ad5
--- /dev/null
+++ b/test/source/sheet/xcellrangeformula.cxx
@@ -0,0 +1,41 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include <test/sheet/xcellrangeformula.hxx>
+
+#include <com/sun/star/sheet/XCellRangeFormula.hpp>
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/uno/Sequence.hxx>
+
+#include <cppunit/extensions/HelperMacros.h>
+
+using namespace com::sun::star;
+using namespace com::sun::star::uno;
+
+namespace apitest
+{
+void XCellRangeFormula::testGetSetFormulaArray()
+{
+ uno::Reference<sheet::XCellRangeFormula> xCRF(init(), UNO_QUERY_THROW);
+
+ uno::Sequence<uno::Sequence<OUString>> aFormulaArrayOrginal = xCRF->getFormulaArray();
+ uno::Sequence<uno::Sequence<OUString>> aFormulaArrayNew = xCRF->getFormulaArray();
+ aFormulaArrayNew[0][0] = "NewValue";
+
+ xCRF->setFormulaArray(aFormulaArrayNew);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to get new FormulaArray", OUString("NewValue"),
+ xCRF->getFormulaArray()[0][0]);
+
+ xCRF->setFormulaArray(aFormulaArrayOrginal);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to set new FormulaArray", aFormulaArrayOrginal[0][0],
+ xCRF->getFormulaArray()[0][0]);
+}
+} // namespace apitest
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */