LibreOffice Module test (master)  1
xddelinks.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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  */
9 
10 #include <test/sheet/xddelinks.hxx>
11 
12 #include <com/sun/star/sheet/DDELinkMode.hpp>
13 #include <com/sun/star/sheet/XDDELink.hpp>
14 #include <com/sun/star/sheet/XDDELinks.hpp>
15 
16 #include <com/sun/star/uno/Reference.hxx>
17 
18 #include <cppunit/TestAssert.h>
19 
20 using namespace css;
21 using namespace css::uno;
22 
23 namespace apitest
24 {
25 void XDDELinks::testAddDDELink()
26 {
27  uno::Reference<sheet::XDDELinks> xLinks(init(), UNO_QUERY_THROW);
28 
29  uno::Reference<sheet::XDDELink> xLink
30  = xLinks->addDDELink("soffice", m_aTopic, "Sheet1.A1", sheet::DDELinkMode_DEFAULT);
31 
32  CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to execute getApplication()", OUString("soffice"),
33  xLink->getApplication());
34  CPPUNIT_ASSERT_MESSAGE("Unable to execute getTopic()",
35  xLink->getTopic().endsWith("ScDDELinksObj.ods"));
36  CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to execute getItem()", OUString("Sheet1.A1"),
37  xLink->getItem());
38 }
39 } // namespace apitest
40 
41 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
FILE * init(int, char **)