2003-03-26 17:07:02 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-10 23:45:22 +00:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2003-03-26 17:07:02 +00:00
|
|
|
*
|
2010-02-12 15:01:35 +01:00
|
|
|
* Copyright 2000, 2010 Oracle and/or its affiliates.
|
2003-03-26 17:07:02 +00:00
|
|
|
*
|
2008-04-10 23:45:22 +00:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2003-03-26 17:07:02 +00:00
|
|
|
*
|
2008-04-10 23:45:22 +00:00
|
|
|
* This file is part of OpenOffice.org.
|
2003-03-26 17:07:02 +00:00
|
|
|
*
|
2008-04-10 23:45:22 +00:00
|
|
|
* OpenOffice.org is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Lesser General Public License version 3
|
|
|
|
* only, as published by the Free Software Foundation.
|
2003-03-26 17:07:02 +00:00
|
|
|
*
|
2008-04-10 23:45:22 +00:00
|
|
|
* OpenOffice.org is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Lesser General Public License version 3 for more details
|
|
|
|
* (a copy is included in the LICENSE file that accompanied this code).
|
2003-03-26 17:07:02 +00:00
|
|
|
*
|
2008-04-10 23:45:22 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* version 3 along with OpenOffice.org. If not, see
|
|
|
|
* <http://www.openoffice.org/license.html>
|
|
|
|
* for a copy of the LGPLv3 License.
|
2003-03-26 17:07:02 +00:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
2006-07-21 13:49:57 +00:00
|
|
|
// MARKER(update_precomp.py): autogen include statement, do not remove
|
|
|
|
#include "precompiled_sc.hxx"
|
|
|
|
|
2003-03-26 17:07:02 +00:00
|
|
|
// System - Includes -----------------------------------------------------
|
|
|
|
|
|
|
|
#include <tools/string.hxx>
|
|
|
|
#include <sfx2/docfac.hxx>
|
2008-03-06 18:35:37 +00:00
|
|
|
#include <sfx2/sfxmodelfactory.hxx>
|
2003-03-26 17:07:02 +00:00
|
|
|
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
|
|
|
|
|
|
|
|
#include "scmod.hxx"
|
2003-04-04 18:19:51 +00:00
|
|
|
#include <vos/mutex.hxx>
|
|
|
|
#include <vcl/svapp.hxx>
|
|
|
|
|
2003-09-19 07:25:48 +00:00
|
|
|
#include "docsh.hxx"
|
|
|
|
|
2003-03-26 17:07:02 +00:00
|
|
|
using namespace ::com::sun::star;
|
|
|
|
|
|
|
|
::rtl::OUString SAL_CALL ScDocument_getImplementationName() throw()
|
|
|
|
{
|
|
|
|
return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.Calc.SpreadsheetDocument" ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
uno::Sequence< rtl::OUString > SAL_CALL ScDocument_getSupportedServiceNames() throw()
|
|
|
|
{
|
2004-01-28 12:31:12 +00:00
|
|
|
uno::Sequence< rtl::OUString > aSeq( 1 );
|
|
|
|
aSeq[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.sheet.SpreadsheetDocument" ));
|
2003-03-26 17:07:02 +00:00
|
|
|
return aSeq;
|
|
|
|
}
|
|
|
|
|
|
|
|
uno::Reference< uno::XInterface > SAL_CALL ScDocument_createInstance(
|
2008-03-06 18:35:37 +00:00
|
|
|
const uno::Reference< lang::XMultiServiceFactory > & /* rSMgr */, const sal_uInt64 _nCreationFlags ) throw( uno::Exception )
|
2003-03-26 17:07:02 +00:00
|
|
|
{
|
2003-04-04 18:19:51 +00:00
|
|
|
::vos::OGuard aGuard( Application::GetSolarMutex() );
|
2003-09-19 07:25:48 +00:00
|
|
|
ScDLL::Init();
|
2010-01-06 21:34:53 +01:00
|
|
|
SfxObjectShell* pShell = new ScDocShell( _nCreationFlags );
|
2003-09-19 07:25:48 +00:00
|
|
|
return uno::Reference< uno::XInterface >( pShell->GetModel() );
|
2003-03-26 17:07:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|