update emoji autocorrect entries from po-files
[LibreOffice.git] / sc / qa / extras / sctablesheetobj.cxx
blobfd9aa7671d06fe9ecd119d81c2a8b031031372dc
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/util/xreplaceable.hxx>
12 #include <test/util/xsearchable.hxx>
13 #include <test/sheet/xprintareas.hxx>
15 #include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
16 #include <com/sun/star/sheet/XSpreadsheet.hpp>
18 using namespace css;
19 using namespace css::uno;
21 namespace sc_apitest
24 class ScTableSheetObj : public CalcUnoApiTest, apitest::XSearchable, apitest::XReplaceable, apitest::XPrintAreas
26 public:
27 ScTableSheetObj();
29 virtual void setUp() SAL_OVERRIDE;
30 virtual void tearDown() SAL_OVERRIDE;
32 virtual uno::Reference< uno::XInterface > init() SAL_OVERRIDE;
34 CPPUNIT_TEST_SUITE(ScTableSheetObj);
35 CPPUNIT_TEST(testFindAll);
36 CPPUNIT_TEST(testFindNext);
37 CPPUNIT_TEST(testFindFirst);
38 CPPUNIT_TEST(testReplaceAll);
39 CPPUNIT_TEST(testCreateReplaceDescriptor);
40 // XPrintAreas
41 CPPUNIT_TEST(testSetAndGetPrintTitleColumns);
42 CPPUNIT_TEST(testSetAndGetPrintTitleRows);
43 CPPUNIT_TEST_SUITE_END();
45 private:
46 uno::Reference< lang::XComponent > mxComponent;
49 ScTableSheetObj::ScTableSheetObj():
50 CalcUnoApiTest("/sc/qa/extras/testdocuments"),
51 apitest::XSearchable(OUString("test"), 4),
52 apitest::XReplaceable(OUString("searchReplaceString"), OUString("replaceReplaceString"))
56 uno::Reference< uno::XInterface > ScTableSheetObj::init()
58 OUString aFileURL;
59 createFileURL(OUString("ScTableSheetObj.ods"), aFileURL);
60 if(!mxComponent.is())
61 mxComponent = loadFromDesktop(aFileURL, "com.sun.star.sheet.SpreadsheetDocument");
62 CPPUNIT_ASSERT(mxComponent.is());
64 uno::Reference< sheet::XSpreadsheetDocument > xDoc(mxComponent, UNO_QUERY_THROW);
65 uno::Reference< container::XIndexAccess > xIndex (xDoc->getSheets(), UNO_QUERY_THROW);
66 uno::Reference< sheet::XSpreadsheet > xSheet( xIndex->getByIndex(0), UNO_QUERY_THROW);
68 return xSheet;
71 void ScTableSheetObj::setUp()
73 CalcUnoApiTest::setUp();
76 void ScTableSheetObj::tearDown()
78 closeDocument(mxComponent);
79 mxComponent.clear();
81 CalcUnoApiTest::tearDown();
84 CPPUNIT_TEST_SUITE_REGISTRATION(ScTableSheetObj);
88 CPPUNIT_PLUGIN_IMPLEMENT();
90 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */