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/sheet/sheetsortdescriptor2.hxx>
13 #include <com/sun/star/container/XIndexAccess.hpp>
14 #include <com/sun/star/lang/XComponent.hpp>
15 #include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
16 #include <com/sun/star/sheet/XSpreadsheet.hpp>
17 #include <com/sun/star/sheet/XSpreadsheets.hpp>
18 #include <com/sun/star/uno/XInterface.hpp>
19 #include <com/sun/star/util/XSortable.hpp>
21 #include <com/sun/star/uno/Reference.hxx>
24 using namespace css::uno
;
25 using namespace com::sun::star
;
29 class ScSortDescriptorBaseObj
: public CalcUnoApiTest
, public apitest::SheetSortDescriptor2
32 ScSortDescriptorBaseObj();
34 virtual uno::Reference
<uno::XInterface
> init() override
;
35 virtual void setUp() override
;
36 virtual void tearDown() override
;
38 CPPUNIT_TEST_SUITE(ScSortDescriptorBaseObj
);
40 // SheetSortDescriptor2
41 CPPUNIT_TEST(testSheetSortDescriptor2Properties
);
43 CPPUNIT_TEST_SUITE_END();
46 uno::Reference
<lang::XComponent
> mxComponent
;
49 ScSortDescriptorBaseObj::ScSortDescriptorBaseObj()
50 : CalcUnoApiTest("/sc/qa/extras/testdocuments")
54 uno::Reference
<uno::XInterface
> ScSortDescriptorBaseObj::init()
56 uno::Reference
<sheet::XSpreadsheetDocument
> xDoc(mxComponent
, UNO_QUERY_THROW
);
57 uno::Reference
<sheet::XSpreadsheets
> xSheets(xDoc
->getSheets(), UNO_SET_THROW
);
58 uno::Reference
<container::XIndexAccess
> xIA(xSheets
, UNO_QUERY_THROW
);
60 uno::Reference
<sheet::XSpreadsheet
> xSheet(xIA
->getByIndex(0), UNO_QUERY_THROW
);
61 uno::Reference
<util::XSortable
> xSortable(xSheet
, UNO_QUERY_THROW
);
65 void ScSortDescriptorBaseObj::setUp()
67 CalcUnoApiTest::setUp();
68 // create a calc document
69 mxComponent
= loadFromDesktop("private:factory/scalc");
72 void ScSortDescriptorBaseObj::tearDown()
74 closeDocument(mxComponent
);
75 CalcUnoApiTest::tearDown();
78 CPPUNIT_TEST_SUITE_REGISTRATION(ScSortDescriptorBaseObj
);
80 } // namespace sc_apitest
82 CPPUNIT_PLUGIN_IMPLEMENT();
84 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */