update emoji autocorrect entries from po-files
[LibreOffice.git] / sc / qa / extras / scdatapilotfieldobj.cxx
blobcad8aa7297aa01cdbd5686f9d677949ed1604813
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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/sheet/xdatapilotfieldgrouping.hxx>
12 #include <test/sheet/datapilotfield.hxx>
14 #include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
15 #include <com/sun/star/sheet/XSpreadsheet.hpp>
16 #include <com/sun/star/sheet/XDataPilotTablesSupplier.hpp>
17 #include <com/sun/star/sheet/XDataPilotTables.hpp>
18 #include <com/sun/star/sheet/XDataPilotDescriptor.hpp>
20 using namespace css;
21 using namespace css::uno;
23 namespace sc_apitest {
25 #define NUMBER_OF_TESTS 6
27 class ScDataPilotFieldObj : public CalcUnoApiTest, apitest::XDataPilotFieldGrouping,
28 apitest::DataPilotField
30 public:
31 virtual void setUp() SAL_OVERRIDE;
32 virtual void tearDown() SAL_OVERRIDE;
33 virtual uno::Reference< uno::XInterface > init() SAL_OVERRIDE;
35 ScDataPilotFieldObj();
37 CPPUNIT_TEST_SUITE(ScDataPilotFieldObj);
38 CPPUNIT_TEST(testSortInfo);
39 CPPUNIT_TEST(testLayoutInfo);
40 CPPUNIT_TEST(testAutoShowInfo);
41 CPPUNIT_TEST(testReference);
42 CPPUNIT_TEST(testIsGroupField);
43 CPPUNIT_TEST(testCreateNameGroup);
44 // see fdo#
45 //CPPUNIT_TEST(testCreateDateGroup);
46 CPPUNIT_TEST_SUITE_END();
47 private:
48 static sal_Int32 nTest;
49 static uno::Reference< lang::XComponent > mxComponent;
52 sal_Int32 ScDataPilotFieldObj::nTest = 0;
53 uno::Reference< lang::XComponent > ScDataPilotFieldObj::mxComponent;
55 ScDataPilotFieldObj::ScDataPilotFieldObj()
56 : CalcUnoApiTest("/sc/qa/extras/testdocuments")
60 uno::Reference< uno::XInterface > ScDataPilotFieldObj::init()
62 OUString aFileURL;
63 createFileURL(OUString("scdatapilotfieldobj.ods"), aFileURL);
64 if(!mxComponent.is())
65 mxComponent = loadFromDesktop(aFileURL, "com.sun.star.sheet.SpreadsheetDocument");
66 CPPUNIT_ASSERT(mxComponent.is());
68 uno::Reference< sheet::XSpreadsheetDocument > xDoc(mxComponent, UNO_QUERY_THROW);
69 uno::Reference< container::XIndexAccess > xIndex (xDoc->getSheets(), UNO_QUERY_THROW);
70 uno::Reference< sheet::XSpreadsheet > xSheet( xIndex->getByIndex(1), UNO_QUERY_THROW);
72 CPPUNIT_ASSERT_MESSAGE("Could not create interface of type XSpreadsheet", xSheet.is());
73 uno::Reference< sheet::XDataPilotTablesSupplier > xDPTS(xSheet, UNO_QUERY_THROW);
74 CPPUNIT_ASSERT(xDPTS.is());
75 uno::Reference< sheet::XDataPilotTables > xDPT = xDPTS->getDataPilotTables();
76 CPPUNIT_ASSERT(xDPT.is());
77 uno::Sequence<OUString> aElementNames = xDPT->getElementNames();
78 (void) aElementNames;
80 uno::Reference< sheet::XDataPilotDescriptor > xDPDsc(xDPT->getByName("DataPilot1"),UNO_QUERY_THROW);
81 CPPUNIT_ASSERT(xDPDsc.is());
82 uno::Reference< container::XIndexAccess > xIA( xDPDsc->getDataPilotFields(), UNO_QUERY_THROW);
83 uno::Reference< uno::XInterface > xReturnValue( xIA->getByIndex(0), UNO_QUERY_THROW);
84 CPPUNIT_ASSERT(xReturnValue.is());
85 return xReturnValue;
88 void ScDataPilotFieldObj::setUp()
90 nTest++;
91 CalcUnoApiTest::setUp();
94 void ScDataPilotFieldObj::tearDown()
96 if (nTest == NUMBER_OF_TESTS)
98 closeDocument(mxComponent);
99 mxComponent.clear();
102 CalcUnoApiTest::tearDown();
105 CPPUNIT_TEST_SUITE_REGISTRATION(ScDataPilotFieldObj);
109 CPPUNIT_PLUGIN_IMPLEMENT();
111 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */