From 7b91c6d1c0686b06de4d2e87b02df10aa9afbf4c Mon Sep 17 00:00:00 2001 From: Markus Mohrhard Date: Fri, 17 Feb 2012 01:59:32 +0100 Subject: [PATCH] add test for ScCellRangeObj::setDataArray and getDataArray --- sc/qa/extras/sccellrangeobj.cxx | 28 ++++++++++++++++-- .../extras/testdocuments/xcellrangesquery.ods | Bin 8881 -> 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 #include #include +#include #include #include @@ -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 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 562229c4070f0fcc43ee72cfa0abc98e98a08574..ec7335fb09d21dee704cd349a9b7bbc656ba0aeb 100644 GIT binary patch delta 6183 zcmc&&hg(z25)VO&fC$nOp!(4Ml~}5u^o(^d=x6D7^|I zqI8IKMCuFI>$~^9_XphlzH`o;+28KW?CdwQvz6-O+T?~h_!p=_AYu?`58p`n3Ay2= z^KZu#f3rV62;^Vs$^~W+6BH2>6qPa+5tS7em4%AQ3*Uvw-nD}}Acw#Z0x_tbs04BY zEQAL|vfx8yBsq1RJ$w+h=F*b3l2A5XXZr^Z29A!-Fb7+&2c9ktFu1TiOiEN##7iXH$j-Ej|W_VLk!u6uXW*EFC^pwGhk`t zIVD07Jd0NLE5w`faW#F$Gjgk@yo?xI)AD>CRFWuM#cX`Iw#0eY1(UCHeYot3fwCL$ zCsjAkPS*dJX{ZRxO#fmiscar$5I%-k<( zukcnCqb3NivL(=4IY^W#gkkBgv4`~_ZRY zwyiGZ?ctXsP4A@2`o2Y5&JJEHqlwt8orrJpNt&=W(Q+b-1izyWy2@F~x}&)^7aU9<#>1>F$58`$|R;aKs8Mwd!G)qG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