12#include <com/sun/star/table/CellAddress.hpp>
14#include <cppunit/TestAssert.h>
15#include <rtl/ustring.hxx>
18using namespace css::uno;
24 uno::Reference< sheet::XSheetAnnotation > aSheetAnnotation (
init(), UNO_QUERY_THROW);
25 table::CellAddress aResultCellAddress = aSheetAnnotation->getPosition();
28 table::CellAddress aExpectedCellAddress;
29 aExpectedCellAddress.Sheet = 0;
30 aExpectedCellAddress.Row = 1;
31 aExpectedCellAddress.Column = 2;
33 CPPUNIT_ASSERT_EQUAL_MESSAGE(
"Wrong SHEET reference position", aExpectedCellAddress.Sheet, aResultCellAddress.Sheet);
34 CPPUNIT_ASSERT_EQUAL_MESSAGE(
"Wrong COLUMN reference position", aExpectedCellAddress.Column, aResultCellAddress.Column);
35 CPPUNIT_ASSERT_EQUAL_MESSAGE(
"Wrong ROW reference position", aExpectedCellAddress.Row, aResultCellAddress.Row);
40 uno::Reference< sheet::XSheetAnnotation > aSheetAnnotation (
init(), UNO_QUERY_THROW);
41 OUString aAuthor = aSheetAnnotation->getAuthor();
43 CPPUNIT_ASSERT_EQUAL_MESSAGE(
"Wrong author", OUString(
"LG"), aAuthor);
47 uno::Reference< sheet::XSheetAnnotation > aSheetAnnotation (
init(), UNO_QUERY_THROW);
48 OUString aDate = aSheetAnnotation->getDate();
50 CPPUNIT_ASSERT_EQUAL_MESSAGE(
"Wrong date", OUString(
"01/17/2013"), aDate);
54 uno::Reference< sheet::XSheetAnnotation > aSheetAnnotation (
init(), UNO_QUERY_THROW);
55 bool isVisible = aSheetAnnotation->getIsVisible();
57 CPPUNIT_ASSERT_MESSAGE(
"Wrong visible state", isVisible);
61 uno::Reference< sheet::XSheetAnnotation > aSheetAnnotation (
init(), UNO_QUERY_THROW);
62 aSheetAnnotation->setIsVisible(
false);
63 bool isVisible = aSheetAnnotation->getIsVisible();
65 CPPUNIT_ASSERT_MESSAGE(
"Visible state not changed", !isVisible);
virtual css::uno::Reference< css::uno::XInterface > init()=0