1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 #include <test/sheet/xsheetannotationanchor.hxx>
11 #include <test/cppunitasserthelper.hxx>
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>
21 using namespace css::uno
;
25 void XSheetAnnotationAnchor::testGetAnnotation()
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());
44 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */