12#include <com/sun/star/sheet/GeneralFunction.hpp>
13#include <com/sun/star/sheet/SubTotalColumn.hpp>
14#include <com/sun/star/sheet/XSubTotalField.hpp>
16#include <com/sun/star/uno/Reference.hxx>
17#include <com/sun/star/uno/Sequence.hxx>
19#include <cppunit/TestAssert.h>
24template<>
inline std::string
25CPPUNIT_NS::assertion_traits<uno::Sequence< sheet::SubTotalColumn > >::toString(
26 const uno::Sequence< sheet::SubTotalColumn >& x)
29 ost <<
"Sequence: Length: " <<
x.getLength() <<
"\n";
30 for (
const auto& rElement : x)
31 ost <<
"Column: " << rElement.Column <<
" Function:\n";
41 uno::Reference< sheet::XSubTotalField > xSTF(
init(), uno::UNO_QUERY_THROW);
43 CPPUNIT_ASSERT_MESSAGE(
"Unable to get GroupColumn", xSTF->getGroupColumn() != 0);
45 xSTF->setGroupColumn(2);
46 CPPUNIT_ASSERT_EQUAL_MESSAGE(
"Unable to set GroupColumn to new value",
47 sal_Int32(2), xSTF->getGroupColumn());
52 uno::Reference< sheet::XSubTotalField > xSTF(
init(), UNO_QUERY_THROW);
54 uno::Sequence< sheet::SubTotalColumn > sDefaultCols = xSTF->getSubTotalColumns();
55 CPPUNIT_ASSERT_MESSAGE(
"Unable to get SubTotalColumns", sDefaultCols.hasElements());
57 uno::Sequence< sheet::SubTotalColumn > sNewCols{ { 5,
58 sheet::GeneralFunction_AVERAGE } };
59 xSTF->setSubTotalColumns(sNewCols);
61 CPPUNIT_ASSERT_MESSAGE(
"Unable to set SubTotalColumns", sDefaultCols != xSTF->getSubTotalColumns());
void testGetSetTotalColumns()
void testGetSetGroupColumn()
virtual css::uno::Reference< css::uno::XInterface > init()=0