tdf#164627 docx export: consolidate getWordCompatibilityMode()
[LibreOffice.git] / sc / qa / extras / scfunctiondescriptionobj.cxx
blobb58aaee1bb06e99892b3dc67112be4710b4b63c1
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.
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/unoapi_test.hxx>
11 #include <test/sheet/functiondescription.hxx>
13 #include <com/sun/star/beans/PropertyValue.hpp>
14 #include <com/sun/star/container/XNameAccess.hpp>
15 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
16 #include <com/sun/star/sheet/XFunctionDescriptions.hpp>
17 #include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
19 #include <com/sun/star/uno/Sequence.hxx>
20 #include <com/sun/star/uno/Reference.hxx>
22 using namespace css;
23 using namespace css::uno;
24 using namespace com::sun::star;
26 namespace sc_apitest
28 class ScFunctionDescriptionObj : public UnoApiTest, public apitest::FunctionDescription
30 public:
31 ScFunctionDescriptionObj();
33 virtual uno::Sequence<beans::PropertyValue> init() override;
35 virtual void setUp() override;
37 CPPUNIT_TEST_SUITE(ScFunctionDescriptionObj);
39 // FunctionDescription
40 CPPUNIT_TEST(testFunctionDescriptionProperties);
42 CPPUNIT_TEST_SUITE_END();
45 ScFunctionDescriptionObj::ScFunctionDescriptionObj()
46 : UnoApiTest(u"/sc/qa/extras/testdocuments"_ustr)
50 uno::Sequence<beans::PropertyValue> ScFunctionDescriptionObj::init()
52 uno::Reference<sheet::XSpreadsheetDocument> xDoc(mxComponent, UNO_QUERY_THROW);
54 uno::Reference<lang::XMultiServiceFactory> xMSF(xDoc, UNO_QUERY_THROW);
55 uno::Reference<sheet::XFunctionDescriptions> xFDs(
56 xMSF->createInstance(u"com.sun.star.sheet.FunctionDescriptions"_ustr), UNO_QUERY_THROW);
58 uno::Reference<container::XNameAccess> xNA(xFDs, UNO_QUERY_THROW);
59 uno::Sequence<OUString> names = xNA->getElementNames();
61 uno::Sequence<beans::PropertyValue> sPropertyValues;
62 CPPUNIT_ASSERT(xNA->getByName(names[0]) >>= sPropertyValues);
63 return sPropertyValues;
66 void ScFunctionDescriptionObj::setUp()
68 UnoApiTest::setUp();
69 // create a calc document
70 loadFromURL(u"private:factory/scalc"_ustr);
73 CPPUNIT_TEST_SUITE_REGISTRATION(ScFunctionDescriptionObj);
75 } // end namespace
77 CPPUNIT_PLUGIN_IMPLEMENT();
79 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */