Update git submodules
[LibreOffice.git] / sc / qa / extras / scindexenumeration_tableautoformatenumeration.cxx
blob2253a7172962b1dac284d7a1a20767e639cdf6f0
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/unoapi_test.hxx>
11 #include <test/container/xenumeration.hxx>
13 #include <com/sun/star/container/XEnumerationAccess.hpp>
14 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
15 #include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
16 #include <com/sun/star/uno/XInterface.hpp>
18 #include <com/sun/star/uno/Reference.hxx>
20 using namespace css;
21 using namespace css::uno;
23 namespace sc_apitest
25 class ScIndexEnumeration_TableAutoFormatEnumeration : public UnoApiTest,
26 public apitest::XEnumeration
28 public:
29 ScIndexEnumeration_TableAutoFormatEnumeration();
31 virtual uno::Reference<uno::XInterface> init() override;
32 virtual void setUp() override;
34 CPPUNIT_TEST_SUITE(ScIndexEnumeration_TableAutoFormatEnumeration);
36 // XEnumeration
37 CPPUNIT_TEST(testHasMoreElements);
38 CPPUNIT_TEST(testNextElement);
40 CPPUNIT_TEST_SUITE_END();
43 ScIndexEnumeration_TableAutoFormatEnumeration::ScIndexEnumeration_TableAutoFormatEnumeration()
44 : UnoApiTest(u"/sc/qa/extras/testdocuments"_ustr)
48 uno::Reference<uno::XInterface> ScIndexEnumeration_TableAutoFormatEnumeration::init()
50 uno::Reference<sheet::XSpreadsheetDocument> xDoc(mxComponent, uno::UNO_QUERY_THROW);
51 CPPUNIT_ASSERT_MESSAGE("no calc document", xDoc.is());
53 uno::Reference<lang::XMultiServiceFactory> xMSF(xDoc, uno::UNO_QUERY_THROW);
54 uno::Reference<container::XEnumerationAccess> xEA(
55 xMSF->createInstance(u"com.sun.star.sheet.TableAutoFormats"_ustr), uno::UNO_QUERY_THROW);
57 return xEA->createEnumeration();
60 void ScIndexEnumeration_TableAutoFormatEnumeration::setUp()
62 UnoApiTest::setUp();
63 loadFromURL(u"private:factory/scalc"_ustr);
66 CPPUNIT_TEST_SUITE_REGISTRATION(ScIndexEnumeration_TableAutoFormatEnumeration);
68 } // namespace sc_apitest
70 CPPUNIT_PLUGIN_IMPLEMENT();
72 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */