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/sheet/databaseimportdescriptor.hxx>
13 #include <com/sun/star/container/XIndexAccess.hpp>
14 #include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
15 #include <com/sun/star/sheet/XSpreadsheet.hpp>
16 #include <com/sun/star/sheet/XSpreadsheets.hpp>
17 #include <com/sun/star/util/XImportable.hpp>
18 #include <com/sun/star/uno/XInterface.hpp>
20 #include <com/sun/star/uno/Reference.hxx>
23 using namespace css::uno
;
24 using namespace com::sun::star
;
28 class ScImportDescriptorBaseObj
: public UnoApiTest
, public apitest::DatabaseImportDescriptor
31 ScImportDescriptorBaseObj();
33 virtual uno::Reference
<uno::XInterface
> init() override
;
34 virtual uno::Reference
<uno::XInterface
> getXImportable() override
;
36 virtual void setUp() override
;
38 CPPUNIT_TEST_SUITE(ScImportDescriptorBaseObj
);
40 // DatabaseImportDescriptor
41 CPPUNIT_TEST(testDatabaseImportDescriptorProperties
);
43 CPPUNIT_TEST_SUITE_END();
46 ScImportDescriptorBaseObj::ScImportDescriptorBaseObj()
47 : UnoApiTest(u
"/sc/qa/extras/testdocuments"_ustr
)
51 uno::Reference
<uno::XInterface
> ScImportDescriptorBaseObj::init()
53 uno::Reference
<sheet::XSpreadsheetDocument
> xDoc(mxComponent
, UNO_QUERY_THROW
);
55 uno::Reference
<sheet::XSpreadsheets
> xSheets(xDoc
->getSheets(), UNO_SET_THROW
);
56 uno::Reference
<container::XIndexAccess
> xIA(xSheets
, UNO_QUERY_THROW
);
58 uno::Reference
<sheet::XSpreadsheet
> xSheet(xIA
->getByIndex(0), UNO_QUERY_THROW
);
62 uno::Reference
<uno::XInterface
> ScImportDescriptorBaseObj::getXImportable()
64 uno::Reference
<sheet::XSpreadsheetDocument
> xDoc(mxComponent
, UNO_QUERY_THROW
);
66 uno::Reference
<sheet::XSpreadsheets
> xSheets(xDoc
->getSheets(), UNO_SET_THROW
);
67 uno::Reference
<container::XIndexAccess
> xIA(xSheets
, UNO_QUERY_THROW
);
69 uno::Reference
<sheet::XSpreadsheet
> xSheet(xIA
->getByIndex(0), UNO_QUERY_THROW
);
70 uno::Reference
<util::XImportable
> XImportable(xSheet
, UNO_QUERY_THROW
);
74 void ScImportDescriptorBaseObj::setUp()
77 // create a calc document
78 loadFromURL(u
"private:factory/scalc"_ustr
);
81 CPPUNIT_TEST_SUITE_REGISTRATION(ScImportDescriptorBaseObj
);
85 CPPUNIT_PLUGIN_IMPLEMENT();
87 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */