1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * Version: MPL 1.1 / GPLv3+ / LGPLv3+
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License or as specified alternatively below. You may obtain a copy of
8 * the License at http://www.mozilla.org/MPL/
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
15 * Major Contributor(s):
16 * Copyright (C) 2012 Markus Mohrhard <markus.mohrhard@googlemail.com> (initial developer)
18 * All Rights Reserved.
20 * For minor contributions see the git repository.
22 * Alternatively, the contents of this file may be used under the terms of
23 * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
24 * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
25 * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
26 * instead of those above.
29 #include <test/unoapi_test.hxx>
30 #include <test/util/xreplaceable.hxx>
31 #include <test/util/xsearchable.hxx>
32 #include <test/sheet/xprintareas.hxx>
34 #include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
35 #include <com/sun/star/sheet/XSpreadsheet.hpp>
40 class ScTableSheetObj
: public UnoApiTest
, apitest::XSearchable
, apitest::XReplaceable
, apitest::XPrintAreas
45 virtual uno::Reference
< uno::XInterface
> init();
47 CPPUNIT_TEST_SUITE(ScTableSheetObj
);
48 CPPUNIT_TEST(testFindAll
);
49 CPPUNIT_TEST(testFindNext
);
50 CPPUNIT_TEST(testFindFirst
);
51 CPPUNIT_TEST(testReplaceAll
);
52 CPPUNIT_TEST(testCreateReplaceDescriptor
);
54 CPPUNIT_TEST(testSetAndGetPrintTitleColumns
);
55 CPPUNIT_TEST(testSetAndGetPrintTitleRows
);
56 CPPUNIT_TEST_SUITE_END();
59 static sal_Int32 nTest
;
60 static uno::Reference
< lang::XComponent
> mxComponent
;
63 sal_Int32
ScTableSheetObj::nTest
= 0;
64 uno::Reference
< lang::XComponent
> ScTableSheetObj::mxComponent
;
66 ScTableSheetObj::ScTableSheetObj():
67 apitest::XSearchable(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("test")), 4),
68 apitest::XReplaceable(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("searchReplaceString")), rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("replaceReplaceString")))
74 uno::Reference
< uno::XInterface
> ScTableSheetObj::init()
76 rtl::OUString aFileURL
;
77 createFileURL(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ScTableSheetObj.ods")), aFileURL
);
79 mxComponent
= loadFromDesktop(aFileURL
);
80 CPPUNIT_ASSERT(mxComponent
.is());
82 uno::Reference
< sheet::XSpreadsheetDocument
> xDoc(mxComponent
, UNO_QUERY_THROW
);
83 uno::Reference
< container::XIndexAccess
> xIndex (xDoc
->getSheets(), UNO_QUERY_THROW
);
84 uno::Reference
< sheet::XSpreadsheet
> xSheet( xIndex
->getByIndex(0), UNO_QUERY_THROW
);
89 CPPUNIT_TEST_SUITE_REGISTRATION(ScTableSheetObj
);
91 CPPUNIT_PLUGIN_IMPLEMENT();
95 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */