xref: /trunk/main/sc/source/ui/unoobj/unodoc.cxx (revision b3f79822)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_sc.hxx"
26 
27 // System - Includes -----------------------------------------------------
28 
29 #include <tools/string.hxx>
30 #include <sfx2/docfac.hxx>
31 #include <sfx2/sfxmodelfactory.hxx>
32 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
33 
34 #include "scmod.hxx"
35 #include <vos/mutex.hxx>
36 #include <vcl/svapp.hxx>
37 
38 #include "docsh.hxx"
39 
40 using namespace ::com::sun::star;
41 
ScDocument_getImplementationName()42 ::rtl::OUString SAL_CALL ScDocument_getImplementationName() throw()
43 {
44 	return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.Calc.SpreadsheetDocument" ) );
45 }
46 
ScDocument_getSupportedServiceNames()47 uno::Sequence< rtl::OUString > SAL_CALL ScDocument_getSupportedServiceNames() throw()
48 {
49 	uno::Sequence< rtl::OUString > aSeq( 1 );
50 	aSeq[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.sheet.SpreadsheetDocument" ));
51 	return aSeq;
52 }
53 
ScDocument_createInstance(const uno::Reference<lang::XMultiServiceFactory> &,const sal_uInt64 _nCreationFlags)54 uno::Reference< uno::XInterface > SAL_CALL ScDocument_createInstance(
55                 const uno::Reference< lang::XMultiServiceFactory > & /* rSMgr */, const sal_uInt64 _nCreationFlags ) throw( uno::Exception )
56 {
57     ::vos::OGuard aGuard( Application::GetSolarMutex() );
58 	ScDLL::Init();
59     SfxObjectShell* pShell = new ScDocShell( _nCreationFlags );
60 	return uno::Reference< uno::XInterface >( pShell->GetModel() );
61 }
62 
63 
64