12#include <com/sun/star/sheet/CellFlags.hpp>
13#include <com/sun/star/sheet/GeneralFunction.hpp>
14#include <com/sun/star/sheet/XSheetOperation.hpp>
15#include <com/sun/star/uno/Reference.hxx>
17#include <cppunit/TestAssert.h>
20using namespace css::uno;
26 uno::Reference<sheet::XSheetOperation> xSheetOperation(
init(), UNO_QUERY_THROW);
28 xSheetOperation->clearContents(sheet::CellFlags::VALUE | sheet::CellFlags::FORMULA);
30 double sum = xSheetOperation->computeFunction(sheet::GeneralFunction_SUM);
31 CPPUNIT_ASSERT_EQUAL_MESSAGE(
"Unable to clean contents", 0.0, sum);
36 uno::Reference<sheet::XSheetOperation> xSheetOperation(
init(), UNO_QUERY_THROW);
38 double count = xSheetOperation->computeFunction(sheet::GeneralFunction_COUNT);
39 CPPUNIT_ASSERT_MESSAGE(
"Unable to compute function",
count >= 0.0);
virtual css::uno::Reference< css::uno::XInterface > init()=0
void testComputeFunction()