nss: upgrade to release 3.73
[LibreOffice.git] / test / source / sheet / xsheetlinkable.cxx
blobaa394a0064e1fe0c11cbfe86f866bc8e3a88f4d3
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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/.
8 */
10 #include <test/sheet/xsheetlinkable.hxx>
12 #include <com/sun/star/sheet/SheetLinkMode.hpp>
13 #include <com/sun/star/sheet/XSheetLinkable.hpp>
14 #include <com/sun/star/uno/Reference.hxx>
16 #include <cppunit/TestAssert.h>
18 using namespace css;
19 using namespace css::uno;
21 namespace apitest {
23 void XSheetLinkable::testSheetLinkable()
25 uno::Reference< sheet::XSheetLinkable > xSheetLinkable(init(), UNO_QUERY_THROW);
27 xSheetLinkable->link(getFileURL(), "Sheet1", "", "", sheet::SheetLinkMode_VALUE);
28 CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to get link mode",
29 sheet::SheetLinkMode_VALUE, xSheetLinkable->getLinkMode());
30 CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to get link URL",
31 getFileURL(), xSheetLinkable->getLinkUrl());
32 CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to get sheet name",
33 OUString("Sheet1"), xSheetLinkable->getLinkSheetName());
35 xSheetLinkable->setLinkMode(sheet::SheetLinkMode_NONE);
36 CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to set link mode",
37 sheet::SheetLinkMode_NONE, xSheetLinkable->getLinkMode());
39 xSheetLinkable->setLinkSheetName("Sheet2");
40 CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to set sheet name",
41 OUString("Sheet2"), xSheetLinkable->getLinkSheetName());
43 xSheetLinkable->setLinkUrl(getFileURL());
44 CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to set link URL",
45 getFileURL(), xSheetLinkable->getLinkUrl());
50 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */