13#include <com/sun/star/sheet/GeneralFunction.hpp>
14#include <com/sun/star/sheet/XConsolidationDescriptor.hpp>
15#include <com/sun/star/table/CellAddress.hpp>
16#include <com/sun/star/table/CellRangeAddress.hpp>
17#include <com/sun/star/uno/Reference.hxx>
18#include <com/sun/star/uno/Sequence.hxx>
20#include <cppunit/TestAssert.h>
23using namespace css::uno;
29 uno::Reference<sheet::XConsolidationDescriptor> xConsolidationDescriptor(
init(),
32 CPPUNIT_ASSERT_EQUAL_MESSAGE(
"Unable to get function", sheet::GeneralFunction_SUM,
33 xConsolidationDescriptor->getFunction());
38 uno::Reference<sheet::XConsolidationDescriptor> xConsolidationDescriptor(
init(),
41 xConsolidationDescriptor->setFunction(sheet::GeneralFunction_COUNT);
42 CPPUNIT_ASSERT_EQUAL_MESSAGE(
"Unable to set function", sheet::GeneralFunction_COUNT,
43 xConsolidationDescriptor->getFunction());
48 uno::Reference<sheet::XConsolidationDescriptor> xConsolidationDescriptor(
init(),
51 uno::Sequence<table::CellRangeAddress> aSources = xConsolidationDescriptor->getSources();
52 CPPUNIT_ASSERT_MESSAGE(
"Unable to get sources", !aSources.hasElements());
57 uno::Reference<sheet::XConsolidationDescriptor> xConsolidationDescriptor(
init(),
60 uno::Sequence<table::CellRangeAddress> aSources{ table::CellRangeAddress(0, 1, 1, 5, 5) };
61 xConsolidationDescriptor->setSources(aSources);
62 CPPUNIT_ASSERT_EQUAL_MESSAGE(
"Unable to set sources", table::CellRangeAddress(0, 1, 1, 5, 5),
63 xConsolidationDescriptor->getSources()[0]);
68 uno::Reference<sheet::XConsolidationDescriptor> xConsolidationDescriptor(
init(),
71 CPPUNIT_ASSERT_EQUAL_MESSAGE(
"Unable to get start output position", table::CellAddress(0, 0, 0),
72 xConsolidationDescriptor->getStartOutputPosition());
77 uno::Reference<sheet::XConsolidationDescriptor> xConsolidationDescriptor(
init(),
80 xConsolidationDescriptor->setStartOutputPosition(table::CellAddress(0, 1, 2));
81 CPPUNIT_ASSERT_EQUAL_MESSAGE(
"Unable to set start output position", table::CellAddress(0, 1, 2),
82 xConsolidationDescriptor->getStartOutputPosition());
87 uno::Reference<sheet::XConsolidationDescriptor> xConsolidationDescriptor(
init(),
90 CPPUNIT_ASSERT_MESSAGE(
"Unable to get use column headers",
91 !xConsolidationDescriptor->getUseColumnHeaders());
96 uno::Reference<sheet::XConsolidationDescriptor> xConsolidationDescriptor(
init(),
99 xConsolidationDescriptor->setUseColumnHeaders(
true);
100 CPPUNIT_ASSERT_MESSAGE(
"Unable to set use column headers",
101 xConsolidationDescriptor->getUseColumnHeaders());
106 uno::Reference<sheet::XConsolidationDescriptor> xConsolidationDescriptor(
init(),
109 CPPUNIT_ASSERT_MESSAGE(
"Unable to get use row headers",
110 !xConsolidationDescriptor->getUseRowHeaders());
115 uno::Reference<sheet::XConsolidationDescriptor> xConsolidationDescriptor(
init(),
118 xConsolidationDescriptor->setUseRowHeaders(
true);
119 CPPUNIT_ASSERT_MESSAGE(
"Unable to set use row headers",
120 xConsolidationDescriptor->getUseRowHeaders());
125 uno::Reference<sheet::XConsolidationDescriptor> xConsolidationDescriptor(
init(),
128 CPPUNIT_ASSERT_MESSAGE(
"Unable to get use insert links",
129 !xConsolidationDescriptor->getInsertLinks());
134 uno::Reference<sheet::XConsolidationDescriptor> xConsolidationDescriptor(
init(),
137 xConsolidationDescriptor->setInsertLinks(
true);
138 CPPUNIT_ASSERT_MESSAGE(
"Unable to set use insert links",
139 xConsolidationDescriptor->getInsertLinks());
void testGetUseRowHeaders()
void testSetUseRowHeaders()
void testSetInsertLinks()
void testGetInsertLinks()
void testGetStartOutputPosition()
virtual css::uno::Reference< css::uno::XInterface > init()=0
void testSetUseColumnHeaders()
void testSetStartOutputPosition()
void testGetUseColumnHeaders()