1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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/.
11 #include "functions_test.hxx"
12 #include <document.hxx>
14 FunctionsTest::FunctionsTest(const OUString
& rPath
):
15 ScBootstrapFixture(rPath
)
19 void FunctionsTest::setUp()
21 ScBootstrapFixture::setUp();
23 // This is a bit of a fudge, we do this to ensure that ScGlobals::ensure,
24 // which is a private symbol to us, gets called
26 getMultiServiceFactory()->createInstance("com.sun.star.comp.Calc.SpreadsheetDocument");
27 CPPUNIT_ASSERT_MESSAGE("no calc component!", m_xCalcComponent
.is());
30 bool FunctionsTest::load(const OUString
& rFilter
, const OUString
& rURL
,
31 const OUString
& rUserData
, SfxFilterFlags nFilterFlags
,
32 SotClipboardFormatId nClipboardID
,
33 unsigned int nFilterVersion
)
35 ScDocShellRef xDocShRef
= ScBootstrapFixture::load(rURL
, rFilter
, rUserData
,
36 OUString(), nFilterFlags
, nClipboardID
, nFilterVersion
);
37 CPPUNIT_ASSERT(xDocShRef
.is());
39 xDocShRef
->DoHardRecalc();
41 ScDocument
& rDoc
= xDocShRef
->GetDocument();
44 // FIXME tends to fail a lot
45 if (!rURL
.endsWith("forecast.ets.add.fods"))
47 CPPUNIT_ASSERT_DOUBLES_EQUAL(1.0, rDoc
.GetValue(1, 2, 0), 1e-14);
54 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */