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/sheetlink.hxx>
12 #include <com/sun/star/beans/XPropertySet.hpp>
13 #include <com/sun/star/uno/Any.hxx>
14 #include <com/sun/star/uno/Reference.hxx>
16 #include <cppunit/TestAssert.h>
18 using namespace com::sun::star
;
19 using namespace com::sun::star::uno
;
23 void SheetLink::testSheetLinkProperties()
25 uno::Reference
<beans::XPropertySet
> xSheetLink(init(), UNO_QUERY_THROW
);
32 CPPUNIT_ASSERT_MESSAGE("Unable to get PropertyValue Url",
33 xSheetLink
->getPropertyValue(propName
) >>= aUrlGet
);
35 aNewValue
<<= OUString("file:///tmp/ScSheetLinkObj.ods");
36 xSheetLink
->setPropertyValue(propName
, aNewValue
);
37 CPPUNIT_ASSERT(xSheetLink
->getPropertyValue(propName
) >>= aUrlSet
);
38 CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to set PropertyValue Url",
39 OUString("file:///tmp/ScSheetLinkObj.ods"), aUrlSet
);
44 CPPUNIT_ASSERT_MESSAGE("Unable to get PropertyValue Filter",
45 xSheetLink
->getPropertyValue(propName
) >>= aFilterGet
);
47 aNewValue
<<= OUString("Text - txt - csv (StarCalc)");
48 xSheetLink
->setPropertyValue(propName
, aNewValue
);
49 CPPUNIT_ASSERT(xSheetLink
->getPropertyValue(propName
) >>= aFilterSet
);
50 CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to set PropertyValue Filter",
51 OUString("Text - txt - csv (StarCalc)"), aFilterSet
);
53 propName
= "FilterOptions";
54 OUString aFilterOptionsGet
;
55 OUString aFilterOptionsSet
;
56 CPPUNIT_ASSERT_MESSAGE("Unable to get PropertyValue FilterOptions",
57 xSheetLink
->getPropertyValue(propName
) >>= aFilterOptionsGet
);
59 aNewValue
<<= OUString("NewValue");
60 xSheetLink
->setPropertyValue(propName
, aNewValue
);
61 CPPUNIT_ASSERT(xSheetLink
->getPropertyValue(propName
) >>= aFilterOptionsSet
);
62 CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to set PropertyValue FilterOptions", OUString("NewValue"),
67 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */