Impress Remote 1.0.5, tag sdremote-1.0.5
[LibreOffice.git] / sc / qa / extras / scmodelobj.cxx
blob93bb0ca1d4429eb9498d2731aa80896aba44ef64
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/unoapi_test.hxx>
11 #include <test/sheet/xgoalseek.hxx>
13 namespace sc_apitest {
15 #define NUMBER_OF_TESTS 1
17 class ScModelObj : public UnoApiTest, apitest::XGoalSeek
19 public:
20 virtual void setUp();
21 virtual void tearDown();
23 virtual uno::Reference< uno::XInterface > init();
25 CPPUNIT_TEST_SUITE(ScModelObj);
26 CPPUNIT_TEST(testSeekGoal);
27 CPPUNIT_TEST_SUITE_END();
29 private:
30 static sal_Int32 nTest;
31 static uno::Reference< lang::XComponent > mxComponent;
35 sal_Int32 ScModelObj::nTest = 0;
36 uno::Reference< lang::XComponent > ScModelObj::mxComponent;
38 uno::Reference< uno::XInterface > ScModelObj::init()
40 rtl::OUString aFileURL;
41 createFileURL(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ScModelObj.ods")), aFileURL);
42 if(!mxComponent.is())
43 mxComponent = loadFromDesktop(aFileURL);
44 CPPUNIT_ASSERT(mxComponent.is());
46 return mxComponent;
49 void ScModelObj::setUp()
51 nTest++;
52 UnoApiTest::setUp();
55 void ScModelObj::tearDown()
57 if (nTest == NUMBER_OF_TESTS)
58 closeDocument(mxComponent);
60 UnoApiTest::tearDown();
63 CPPUNIT_TEST_SUITE_REGISTRATION(ScModelObj);
65 CPPUNIT_PLUGIN_IMPLEMENT();
69 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */