13#include <com/sun/star/sheet/XSheetAnnotation.hpp>
14#include <com/sun/star/sheet/XSheetAnnotationAnchor.hpp>
15#include <com/sun/star/table/CellAddress.hpp>
16#include <com/sun/star/uno/Reference.hxx>
18#include <cppunit/TestAssert.h>
21using namespace css::uno;
27 uno::Reference<sheet::XSheetAnnotationAnchor> xAnchor(
init(), UNO_QUERY_THROW);
28 uno::Reference<sheet::XSheetAnnotation> xAnnotation(xAnchor->getAnnotation(), UNO_SET_THROW);
29 CPPUNIT_ASSERT_MESSAGE(
"Unable to get XSheetAnnotation", xAnnotation.is());
31 CPPUNIT_ASSERT_MESSAGE(
"Unable to check: getAuthor()", !xAnnotation->getAuthor().isEmpty());
32 CPPUNIT_ASSERT_MESSAGE(
"Unable to check: getDate()", !xAnnotation->getDate().isEmpty());
33 CPPUNIT_ASSERT_MESSAGE(
"Unable to check: getIsVisible()", !xAnnotation->getIsVisible());
34 CPPUNIT_ASSERT_EQUAL_MESSAGE(
"Unable to check: getPosition()", table::CellAddress(0, 2, 3),
35 xAnnotation->getPosition());
37 xAnnotation->setIsVisible(
false);
38 CPPUNIT_ASSERT_MESSAGE(
"Unable to setIsVisible() to false", !xAnnotation->getIsVisible());
39 xAnnotation->setIsVisible(
true);
40 CPPUNIT_ASSERT_MESSAGE(
"Unable to setIsVisible() to true", xAnnotation->getIsVisible());
virtual css::uno::Reference< css::uno::XInterface > init()=0