1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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/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>
19 using namespace css::uno
;
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: */