12#include <com/sun/star/sheet/ConditionOperator.hpp>
13#include <com/sun/star/sheet/XSheetCondition.hpp>
15#include <com/sun/star/uno/Reference.hxx>
17#include <cppunit/TestAssert.h>
26 uno::Reference<sheet::XSheetCondition> xSheetCondition(
init(), UNO_QUERY_THROW);
28 CPPUNIT_ASSERT_NO_THROW_MESSAGE(
"Unable to get Formula1",
29 aFormula1 = xSheetCondition->getFormula1());
31 xSheetCondition->setFormula1(
"$Sheet1.$C$");
32 CPPUNIT_ASSERT_MESSAGE(
"Unable to set Formula1", aFormula1 != xSheetCondition->getFormula1());
37 uno::Reference<sheet::XSheetCondition> xSheetCondition(
init(), UNO_QUERY_THROW);
39 CPPUNIT_ASSERT_NO_THROW_MESSAGE(
"Unable to get Formula2",
40 aFormula2 = xSheetCondition->getFormula2());
42 xSheetCondition->setFormula2(
"$Sheet1.$A$");
43 CPPUNIT_ASSERT_MESSAGE(
"Unable to set Formula2", aFormula2 != xSheetCondition->getFormula2());
48 uno::Reference<sheet::XSheetCondition> xSheetCondition(
init(), UNO_QUERY_THROW);
49 sheet::ConditionOperator aOperator;
50 CPPUNIT_ASSERT_NO_THROW_MESSAGE(
"Unable to get Operator",
51 aOperator = xSheetCondition->getOperator());
53 xSheetCondition->setOperator(sheet::ConditionOperator_BETWEEN);
54 sheet::ConditionOperator aOperatorNew = xSheetCondition->getOperator();
55 CPPUNIT_ASSERT_MESSAGE(
"Unable to set Operator", aOperator != aOperatorNew);
60 uno::Reference<sheet::XSheetCondition> xSheetCondition(
init(), UNO_QUERY_THROW);
61 table::CellAddress aSourcePosition(0, 0, 0);
62 CPPUNIT_ASSERT_NO_THROW_MESSAGE(
"Unable to get SourcePosition",
63 aSourcePosition = xSheetCondition->getSourcePosition());
65 xSheetCondition->setSourcePosition(table::CellAddress(0, 1, 1));
66 table::CellAddress aSourcePositionNew = xSheetCondition->getSourcePosition();
67 CPPUNIT_ASSERT_MESSAGE(
"Unable to set SourcePosition",
68 aSourcePosition.Row != aSourcePositionNew.Row);
void testGetSetFormula1()
virtual css::uno::Reference< css::uno::XInterface > init()=0
void testGetSetSourcePosition()
void testGetSetOperator()
void testGetSetFormula2()