summaryrefslogtreecommitdiff
path: root/sc/qa
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-02-17 01:59:32 +0100
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-02-17 02:00:25 +0100
commit7b91c6d1c0686b06de4d2e87b02df10aa9afbf4c (patch)
tree0e963d3e2047895fb49084f7ed86fe9e7118c871 /sc/qa
parent4e1e72dc346e732ff5693e5428e39710ca3b78a5 (diff)
add test for ScCellRangeObj::setDataArray and getDataArray
Diffstat (limited to 'sc/qa')
-rw-r--r--sc/qa/extras/sccellrangeobj.cxx28
-rw-r--r--sc/qa/extras/testdocuments/xcellrangesquery.odsbin8881 -> 9558 bytes
2 files changed, 26 insertions, 2 deletions
diff --git a/sc/qa/extras/sccellrangeobj.cxx b/sc/qa/extras/sccellrangeobj.cxx
index 050724d2942d..2152a2d0926d 100644
--- a/sc/qa/extras/sccellrangeobj.cxx
+++ b/sc/qa/extras/sccellrangeobj.cxx
@@ -31,6 +31,7 @@
#include <test/sheet/cellproperties.hxx>
#include <test/util/xreplaceable.hxx>
#include <test/util/xsearchable.hxx>
+#include <test/sheet/xcellrangedata.hxx>
#include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
#include <com/sun/star/sheet/XSpreadsheet.hpp>
@@ -38,10 +39,10 @@
namespace sc_apitest {
-#define NUMBER_OF_TESTS 12
+#define NUMBER_OF_TESTS 14
class ScCellRangeObj : public UnoApiTest, apitest::XCellRangesQuery, apitest::CellProperties,
- apitest::XSearchable, apitest::XReplaceable
+ apitest::XSearchable, apitest::XReplaceable, apitest::XCellRangeData
{
public:
ScCellRangeObj();
@@ -49,6 +50,7 @@ public:
virtual void setUp();
virtual void tearDown();
virtual uno::Reference< uno::XInterface > init();
+ virtual uno::Reference< uno::XInterface > getXCellRangeData();
CPPUNIT_TEST_SUITE(ScCellRangeObj);
CPPUNIT_TEST(testQueryColumnDifference);
@@ -64,6 +66,8 @@ public:
CPPUNIT_TEST(testFindFirst);
CPPUNIT_TEST(testReplaceAll);
CPPUNIT_TEST(testCreateReplaceDescriptor);
+ CPPUNIT_TEST(testGetDataArray);
+ CPPUNIT_TEST(testSetDataArray);
CPPUNIT_TEST_SUITE_END();
private:
@@ -101,6 +105,26 @@ uno::Reference< uno::XInterface > ScCellRangeObj::init()
return xReturn;
}
+uno::Reference< uno::XInterface > ScCellRangeObj::getXCellRangeData()
+{
+ rtl::OUString aFileURL;
+ const rtl::OUString aFileBase(RTL_CONSTASCII_USTRINGPARAM("xcellrangesquery.ods"));
+ createFileURL(aFileBase, aFileURL);
+ std::cout << rtl::OUStringToOString(aFileURL, RTL_TEXTENCODING_UTF8).getStr() << std::endl;
+ if( !mxComponent.is())
+ mxComponent = loadFromDesktop(aFileURL);
+ 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(1), UNO_QUERY_THROW);
+
+ CPPUNIT_ASSERT_MESSAGE("Could not create interface of type XSpreadsheet", xSheet.is());
+
+ uno::Reference<table::XCellRange> xReturn(xSheet->getCellRangeByPosition(0,0,3,3), UNO_QUERY_THROW);
+
+ CPPUNIT_ASSERT_MESSAGE("Could not create object of type XCellRangesQuery", xReturn.is());
+ return xReturn;
+}
+
void ScCellRangeObj::setUp()
{
nTest++;
diff --git a/sc/qa/extras/testdocuments/xcellrangesquery.ods b/sc/qa/extras/testdocuments/xcellrangesquery.ods
index 562229c4070f..ec7335fb09d2 100644
--- a/sc/qa/extras/testdocuments/xcellrangesquery.ods
+++ b/sc/qa/extras/testdocuments/xcellrangesquery.ods
Binary files differ