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/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>
31 class ScTableRowObj
: public CalcUnoApiTest
,
32 public apitest::TableRow
,
33 public apitest::XCellRange
,
34 public apitest::XPropertySet
,
35 public apitest::XServiceInfo
40 virtual uno::Reference
<uno::XInterface
> init() override
;
41 virtual void setUp() override
;
42 virtual void tearDown() override
;
44 CPPUNIT_TEST_SUITE(ScTableRowObj
);
47 CPPUNIT_TEST(testTableRowProperties
);
50 CPPUNIT_TEST(testGetCellByPosition
);
51 CPPUNIT_TEST(testGetCellRangeByName
);
52 CPPUNIT_TEST(testGetCellRangeByPosition
);
55 CPPUNIT_TEST(testGetPropertySetInfo
);
56 CPPUNIT_TEST(testGetPropertyValue
);
57 CPPUNIT_TEST(testSetPropertyValue
);
58 CPPUNIT_TEST(testPropertyChangeListener
);
59 CPPUNIT_TEST(testVetoableChangeListener
);
62 CPPUNIT_TEST(testGetImplementationName
);
63 CPPUNIT_TEST(testGetSupportedServiceNames
);
64 CPPUNIT_TEST(testSupportsService
);
66 CPPUNIT_TEST_SUITE_END();
69 uno::Reference
<lang::XComponent
> m_xComponent
;
72 ScTableRowObj::ScTableRowObj()
73 : CalcUnoApiTest("/sc/qa/extras/testdocuments")
75 , XPropertySet({ "BottomBorder",
85 "ConditionalFormatLocal",
86 "ConditionalFormatXML",
103 "UserDefinedAttributes",
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
);
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: */