nss: upgrade to release 3.73
[LibreOffice.git] / sc / qa / extras / sctablerowobj.cxx
blobbb377646e3f067d0a23c65a5f52e21732ab1bfa8
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/table/tablerow.hxx>
14 #include <test/table/xcellrange.hxx>
16 #include <com/sun/star/container/XIndexAccess.hpp>
17 #include <com/sun/star/lang/XComponent.hpp>
18 #include <com/sun/star/sheet/XSpreadsheet.hpp>
19 #include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
20 #include <com/sun/star/sheet/XSpreadsheets.hpp>
21 #include <com/sun/star/table/XColumnRowRange.hpp>
22 #include <com/sun/star/table/XTableRows.hpp>
23 #include <com/sun/star/uno/XInterface.hpp>
25 #include <com/sun/star/uno/Reference.hxx>
27 using namespace css;
29 namespace sc_apitest
31 class ScTableRowObj : public CalcUnoApiTest,
32 public apitest::TableRow,
33 public apitest::XCellRange,
34 public apitest::XPropertySet,
35 public apitest::XServiceInfo
37 public:
38 ScTableRowObj();
40 virtual uno::Reference<uno::XInterface> init() override;
41 virtual void setUp() override;
42 virtual void tearDown() override;
44 CPPUNIT_TEST_SUITE(ScTableRowObj);
46 // TableRow
47 CPPUNIT_TEST(testTableRowProperties);
49 // XCellRange
50 CPPUNIT_TEST(testGetCellByPosition);
51 CPPUNIT_TEST(testGetCellRangeByName);
52 CPPUNIT_TEST(testGetCellRangeByPosition);
54 // XPropertySet
55 CPPUNIT_TEST(testGetPropertySetInfo);
56 CPPUNIT_TEST(testGetPropertyValue);
57 CPPUNIT_TEST(testSetPropertyValue);
58 CPPUNIT_TEST(testPropertyChangeListener);
59 CPPUNIT_TEST(testVetoableChangeListener);
61 // XServiceInfo
62 CPPUNIT_TEST(testGetImplementationName);
63 CPPUNIT_TEST(testGetSupportedServiceNames);
64 CPPUNIT_TEST(testSupportsService);
66 CPPUNIT_TEST_SUITE_END();
68 private:
69 uno::Reference<lang::XComponent> m_xComponent;
72 ScTableRowObj::ScTableRowObj()
73 : CalcUnoApiTest("/sc/qa/extras/testdocuments")
74 , XCellRange("A7:A7")
75 , XPropertySet({ "BottomBorder",
76 "BottomBorder2",
77 "CellProtection",
78 "CharLocale",
79 "CharLocaleAsian",
80 "CharLocaleComplex",
81 "CharPosture",
82 "CharPostureAsian",
83 "CharPostureComplex",
84 "ConditionalFormat",
85 "ConditionalFormatLocal",
86 "ConditionalFormatXML",
87 "DiagonalBLTR",
88 "DiagonalBLTR2",
89 "DiagonalTLBR",
90 "DiagonalTLBR2",
91 "HoriJustify",
92 "LeftBorder",
93 "LeftBorder2",
94 "NumberingRules",
95 "Orientation",
96 "RightBorder",
97 "RightBorder2",
98 "ShadowFormat",
99 "TableBorder",
100 "TableBorder2",
101 "TopBorder",
102 "TopBorder2",
103 "UserDefinedAttributes",
104 "Validation",
105 "ValidationLocal",
106 "ValidationXML",
107 "WritingMode" })
108 , XServiceInfo("ScTableRowObj", "com.sun.star.table.TableRow")
112 uno::Reference<uno::XInterface> ScTableRowObj::init()
114 uno::Reference<sheet::XSpreadsheetDocument> xDoc(m_xComponent, uno::UNO_QUERY_THROW);
115 uno::Reference<sheet::XSpreadsheets> xSheets(xDoc->getSheets(), uno::UNO_SET_THROW);
116 uno::Reference<container::XIndexAccess> xIA(xSheets, uno::UNO_QUERY_THROW);
118 uno::Reference<sheet::XSpreadsheet> xSheet0(xIA->getByIndex(0), uno::UNO_QUERY_THROW);
119 uno::Reference<table::XColumnRowRange> xCRR(xSheet0, uno::UNO_QUERY_THROW);
120 uno::Reference<table::XTableRows> xTR(xCRR->getRows(), uno::UNO_SET_THROW);
122 uno::Reference<container::XIndexAccess> xIA_TR(xTR, uno::UNO_QUERY_THROW);
123 uno::Reference<uno::XInterface> xReturn(xIA_TR->getByIndex(6), uno::UNO_QUERY_THROW);
124 return xReturn;
127 void ScTableRowObj::setUp()
129 CalcUnoApiTest::setUp();
130 // create calc document
131 m_xComponent = loadFromDesktop("private:factory/scalc");
134 void ScTableRowObj::tearDown()
136 closeDocument(m_xComponent);
137 CalcUnoApiTest::tearDown();
140 CPPUNIT_TEST_SUITE_REGISTRATION(ScTableRowObj);
142 } // namespace sc_apitest
144 CPPUNIT_PLUGIN_IMPLEMENT();
146 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */