12#include <com/sun/star/sheet/XCellRangesQuery.hpp>
13#include <com/sun/star/sheet/XSheetCellRanges.hpp>
14#include <com/sun/star/table/CellAddress.hpp>
15#include <com/sun/star/sheet/CellFlags.hpp>
17#include <cppunit/TestAssert.h>
27 uno::Reference<sheet::XCellRangesQuery> xCellRangesQuery(
init(),UNO_QUERY_THROW);
28 uno::Reference<sheet::XSheetCellRanges> xRanges = xCellRangesQuery->queryColumnDifferences(table::CellAddress(0, 1, 1));
29 OUString aResult = xRanges->getRangeAddressesAsString();
30 std::cout <<
"testQueryColumnDifference: Result: " << aResult << std::endl;
31 CPPUNIT_ASSERT_EQUAL_MESSAGE(
"testQueryColumnDifference", OUString(
"Sheet1.B1:C1,Sheet1.B3:C5" ), aResult);
36 uno::Reference<sheet::XCellRangesQuery> xCellRangesQuery(
init(),UNO_QUERY_THROW);
37 uno::Reference<sheet::XSheetCellRanges> xRanges = xCellRangesQuery->queryContentCells(sheet::CellFlags::VALUE);
38 OUString aResult = xRanges->getRangeAddressesAsString();
39 std::cout <<
"testQueryContentDifference: Result: " << aResult << std::endl;
40 CPPUNIT_ASSERT_EQUAL_MESSAGE(
"testQueryContentDifference", OUString(
"Sheet1.B3,Sheet1.C2" ), aResult);
45 uno::Reference<sheet::XCellRangesQuery> xCellRangesQuery(
init(),UNO_QUERY_THROW);
46 uno::Reference<sheet::XSheetCellRanges> xRanges = xCellRangesQuery->queryEmptyCells();
47 OUString aResult = xRanges->getRangeAddressesAsString();
48 std::cout <<
"testQueryEmptyCells: Result: " << aResult << std::endl;
49 CPPUNIT_ASSERT_EQUAL_MESSAGE(
"testQueryEmptyCells", OUString(
"Sheet1.A1:A5,Sheet1.B1:C1,Sheet1.B5,Sheet1.C3:C5,Sheet1.D1:E5" ), aResult);
54 uno::Reference<sheet::XCellRangesQuery> xCellRangesQuery(
init(),UNO_QUERY_THROW);
55 uno::Reference<sheet::XSheetCellRanges> xRanges = xCellRangesQuery->queryFormulaCells(sheet::CellFlags::FORMULA);
56 OUString aResult = xRanges->getRangeAddressesAsString();
57 std::cout <<
"testQueryFormulaCells: Result: " << aResult << std::endl;
58 CPPUNIT_ASSERT_EQUAL_MESSAGE(
"testQueryFormulaCells", OUString(
"Sheet1.B2" ), aResult);
63 uno::Reference<sheet::XCellRangesQuery> xCellRangesQuery(
init(),UNO_QUERY_THROW);
64 uno::Reference<sheet::XSheetCellRanges> xRanges = xCellRangesQuery->queryIntersection(table::CellRangeAddress(0,3,3,7,7));
65 OUString aResult = xRanges->getRangeAddressesAsString();
66 std::cout <<
"testQueryIntersection: Result: " << aResult << std::endl;
67 CPPUNIT_ASSERT_EQUAL_MESSAGE(
"testQueryIntersection", OUString(
"Sheet1.D4:E5" ), aResult);
72 uno::Reference<sheet::XCellRangesQuery> xCellRangesQuery(
init(),UNO_QUERY_THROW);
73 uno::Reference<sheet::XSheetCellRanges> xRanges = xCellRangesQuery->queryRowDifferences(table::CellAddress(0,1,1));
74 OUString aResult = xRanges->getRangeAddressesAsString();
75 std::cout <<
"testQueryRowDifference: Result: " << aResult << std::endl;
76 CPPUNIT_ASSERT_EQUAL_MESSAGE(
"testQueryRowDifference", OUString(
"Sheet1.A2:A4,Sheet1.C2:E4" ), aResult);
81 uno::Reference<sheet::XCellRangesQuery> xCellRangesQuery(
init(),UNO_QUERY_THROW);
82 uno::Reference<sheet::XSheetCellRanges> xRanges = xCellRangesQuery->queryVisibleCells();
83 OUString aResult = xRanges->getRangeAddressesAsString();
84 std::cout <<
"testQueryVisibleCells: Result: " << aResult << std::endl;
85 CPPUNIT_ASSERT_EQUAL_MESSAGE(
"testQueryVisibleCells", OUString(
"Sheet1.A1:E5" ), aResult);
void testQueryContentDifference()
void testQueryRowDifference()
void testQueryEmptyCells()
void testQueryVisibleCells()
virtual css::uno::Reference< css::uno::XInterface > init()=0
void testQueryFormulaCells()
void testQueryIntersection()
void testQueryColumnDifference()