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/unoapi_test.hxx>
11 #include <test/beans/xpropertyset.hxx>
12 #include <test/lang/xserviceinfo.hxx>
13 #include <test/sheet/globalsheetsettings.hxx>
15 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
16 #include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
17 #include <com/sun/star/uno/XInterface.hpp>
19 #include <com/sun/star/uno/Reference.hxx>
22 using namespace css::uno
;
23 using namespace com::sun::star
;
27 class ScSpreadsheetSettings
: public UnoApiTest
,
28 public apitest::GlobalSheetSettings
,
29 public apitest::XPropertySet
,
30 public apitest::XServiceInfo
33 ScSpreadsheetSettings();
35 virtual uno::Reference
<uno::XInterface
> init() override
;
36 virtual void setUp() override
;
38 CPPUNIT_TEST_SUITE(ScSpreadsheetSettings
);
40 // GlobalSheetSettings
41 CPPUNIT_TEST(testGlobalSheetSettingsProperties
);
44 CPPUNIT_TEST(testGetPropertySetInfo
);
45 CPPUNIT_TEST(testGetPropertyValue
);
46 CPPUNIT_TEST(testSetPropertyValue
);
47 CPPUNIT_TEST(testPropertyChangeListener
);
48 CPPUNIT_TEST(testVetoableChangeListener
);
51 CPPUNIT_TEST(testGetImplementationName
);
52 CPPUNIT_TEST(testGetSupportedServiceNames
);
53 CPPUNIT_TEST(testSupportsService
);
55 CPPUNIT_TEST_SUITE_END();
58 ScSpreadsheetSettings::ScSpreadsheetSettings()
59 : UnoApiTest(u
"/sc/qa/extras/testdocuments"_ustr
)
60 , XPropertySet({ u
"LinkUpdateMode"_ustr
, u
"UsePrinterMetrics"_ustr
, u
"UserLists"_ustr
})
61 , XServiceInfo(u
"stardiv.StarCalc.ScSpreadsheetSettings"_ustr
,
62 u
"com.sun.star.sheet.GlobalSheetSettings"_ustr
)
66 uno::Reference
<uno::XInterface
> ScSpreadsheetSettings::init()
68 uno::Reference
<sheet::XSpreadsheetDocument
> xDoc(mxComponent
, UNO_QUERY_THROW
);
69 uno::Reference
<lang::XMultiServiceFactory
> xMSF(xDoc
, UNO_QUERY_THROW
);
70 return xMSF
->createInstance(u
"com.sun.star.sheet.GlobalSheetSettings"_ustr
);
73 void ScSpreadsheetSettings::setUp()
76 // create a calc document
77 loadFromURL(u
"private:factory/scalc"_ustr
);
80 CPPUNIT_TEST_SUITE_REGISTRATION(ScSpreadsheetSettings
);
82 } // namespace sc_apitest
84 CPPUNIT_PLUGIN_IMPLEMENT();
86 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */