nss: upgrade to release 3.73
[LibreOffice.git] / sc / qa / extras / scspreadsheetsettings.cxx
bloba06d65cd5060cbd4afa44b3b1b977aa2fab7510b
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/calc_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/XComponent.hpp>
16 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
17 #include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
18 #include <com/sun/star/uno/XInterface.hpp>
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 ScSpreadsheetSettings : public CalcUnoApiTest,
29 public apitest::GlobalSheetSettings,
30 public apitest::XPropertySet,
31 public apitest::XServiceInfo
33 public:
34 ScSpreadsheetSettings();
36 virtual uno::Reference<uno::XInterface> init() override;
37 virtual void setUp() override;
38 virtual void tearDown() override;
40 CPPUNIT_TEST_SUITE(ScSpreadsheetSettings);
42 // GlobalSheetSettings
43 CPPUNIT_TEST(testGlobalSheetSettingsProperties);
45 // XPropertySet
46 CPPUNIT_TEST(testGetPropertySetInfo);
47 CPPUNIT_TEST(testGetPropertyValue);
48 CPPUNIT_TEST(testSetPropertyValue);
49 CPPUNIT_TEST(testPropertyChangeListener);
50 CPPUNIT_TEST(testVetoableChangeListener);
52 // XServiceInfo
53 CPPUNIT_TEST(testGetImplementationName);
54 CPPUNIT_TEST(testGetSupportedServiceNames);
55 CPPUNIT_TEST(testSupportsService);
57 CPPUNIT_TEST_SUITE_END();
59 private:
60 uno::Reference<lang::XComponent> mxComponent;
63 ScSpreadsheetSettings::ScSpreadsheetSettings()
64 : CalcUnoApiTest("/sc/qa/extras/testdocuments")
65 , XPropertySet({ "LinkUpdateMode", "UsePrinterMetrics", "UserLists" })
66 , XServiceInfo("stardiv.StarCalc.ScSpreadsheetSettings",
67 "com.sun.star.sheet.GlobalSheetSettings")
71 uno::Reference<uno::XInterface> ScSpreadsheetSettings::init()
73 uno::Reference<sheet::XSpreadsheetDocument> xDoc(mxComponent, UNO_QUERY_THROW);
74 uno::Reference<lang::XMultiServiceFactory> xMSF(xDoc, UNO_QUERY_THROW);
75 return xMSF->createInstance("com.sun.star.sheet.GlobalSheetSettings");
78 void ScSpreadsheetSettings::setUp()
80 CalcUnoApiTest::setUp();
81 // create a calc document
82 mxComponent = loadFromDesktop("private:factory/scalc");
85 void ScSpreadsheetSettings::tearDown()
87 closeDocument(mxComponent);
88 CalcUnoApiTest::tearDown();
91 CPPUNIT_TEST_SUITE_REGISTRATION(ScSpreadsheetSettings);
93 } // namespace sc_apitest
95 CPPUNIT_PLUGIN_IMPLEMENT();
97 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */