2011-11-30 16:12:48 +01:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
|
|
|
/*
|
2013-04-19 21:10:42 +01:00
|
|
|
* This file is part of the LibreOffice project.
|
2011-11-30 16:12:48 +01:00
|
|
|
*
|
2013-04-19 21:10:42 +01:00
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
2011-11-30 16:12:48 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "test/unoapi_test.hxx"
|
|
|
|
|
2012-01-21 12:02:46 +01:00
|
|
|
#include <com/sun/star/util/XCloseable.hpp>
|
2012-12-14 12:58:00 +02:00
|
|
|
#include <com/sun/star/frame/Desktop.hpp>
|
|
|
|
#include <comphelper/processfactory.hxx>
|
2012-01-21 12:02:46 +01:00
|
|
|
|
2013-04-26 14:38:52 +02:00
|
|
|
using namespace css;
|
|
|
|
using namespace css::uno;
|
|
|
|
|
2013-01-30 01:58:32 -02:00
|
|
|
UnoApiTest::UnoApiTest(const OUString& path)
|
|
|
|
: m_aBaseString(path)
|
2011-11-30 16:12:48 +01:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void UnoApiTest::setUp()
|
|
|
|
{
|
|
|
|
test::BootstrapFixture::setUp();
|
|
|
|
|
2015-11-09 08:46:33 +02:00
|
|
|
mxDesktop = css::frame::Desktop::create( comphelper::getComponentContext(getMultiServiceFactory()) );
|
2013-11-09 05:54:59 +01:00
|
|
|
CPPUNIT_ASSERT_MESSAGE("no desktop!", mxDesktop.is());
|
2011-11-30 16:12:48 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void UnoApiTest::tearDown()
|
|
|
|
{
|
|
|
|
test::BootstrapFixture::tearDown();
|
|
|
|
}
|
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
void UnoApiTest::createFileURL(const OUString& aFileBase, OUString& rFilePath)
|
2011-11-30 16:12:48 +01:00
|
|
|
{
|
2016-03-09 14:14:18 +01:00
|
|
|
rFilePath = m_directories.getSrcRootURL() + m_aBaseString + "/" + aFileBase;
|
2011-11-30 16:12:48 +01:00
|
|
|
}
|
|
|
|
|
2012-01-21 12:02:46 +01:00
|
|
|
void UnoApiTest::closeDocument( uno::Reference< lang::XComponent > xDocument )
|
|
|
|
{
|
|
|
|
uno::Reference< util::XCloseable > xCloseable(xDocument, UNO_QUERY_THROW);
|
|
|
|
xCloseable->close(false);
|
|
|
|
}
|
|
|
|
|
2011-11-30 16:12:48 +01:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|