12#include <com/sun/star/table/XCell.hpp>
13#include <com/sun/star/table/CellContentType.hpp>
15#include <com/sun/star/uno/Reference.hxx>
17#include <cppunit/TestAssert.h>
26 uno::Reference<table::XCell> xCell(
init(), UNO_QUERY_THROW);
27 const sal_Int32 nCorrectFormula = xCell->getError();
28 xCell->setFormula(
"=sqrt(-2)");
29 const sal_Int32 nIncorrectFormula = xCell->getError();
31 CPPUNIT_ASSERT_EQUAL_MESSAGE(
"Successfully able to get Error", sal_Int32(0), nCorrectFormula);
32 CPPUNIT_ASSERT_MESSAGE(
"Successfully able to get Error", (nIncorrectFormula != 0));
37 uno::Reference<table::XCell> xCell(
init(), UNO_QUERY_THROW);
40 if (xCell->getType() == table::CellContentType_EMPTY)
42 else if (xCell->getType() == table::CellContentType_VALUE)
44 else if (xCell->getType() == table::CellContentType_TEXT)
46 else if (xCell->getType() == table::CellContentType_FORMULA)
51 CPPUNIT_ASSERT_MESSAGE(
"Successfully able to get Type", aResult);
56 uno::Reference<table::XCell> xCell(
init(), UNO_QUERY_THROW);
57 OUString aFormula =
"=2+2";
59 xCell->setFormula(aFormula);
61 OUString aFormula2 = xCell->getFormula();
63 CPPUNIT_ASSERT_EQUAL_MESSAGE(
"Successfully able to set and get Formula", aFormula, aFormula2);
68 uno::Reference<table::XCell> xCell(
init(), UNO_QUERY_THROW);
69 double nInValue = 222.555;
71 xCell->setValue(nInValue);
73 double nCellValue = xCell->getValue();
75 CPPUNIT_ASSERT_EQUAL_MESSAGE(
"Successfully able to set and get Value", nInValue, nCellValue);
virtual css::uno::Reference< css::uno::XInterface > init()=0