xref: /aoo4110/main/starmath/source/unodoc.cxx (revision b1cdbd2c)
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_starmath.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 "smdll.hxx"
35 #include "document.hxx"
36 #include <vos/mutex.hxx>
37 #include <vcl/svapp.hxx>
38 
39 using namespace ::com::sun::star;
40 
SmDocument_getImplementationName()41 ::rtl::OUString SAL_CALL SmDocument_getImplementationName() throw()
42 {
43 	return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.Math.FormulaDocument" ) );
44 }
45 
SmDocument_getSupportedServiceNames()46 uno::Sequence< rtl::OUString > SAL_CALL SmDocument_getSupportedServiceNames() throw()
47 {
48 	uno::Sequence< rtl::OUString > aSeq( 1 );
49 	aSeq[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.formula.FormulaProperties" ));
50 	return aSeq;
51 }
52 
SmDocument_createInstance(const uno::Reference<lang::XMultiServiceFactory> &,const sal_uInt64 _nCreationFlags)53 uno::Reference< uno::XInterface > SAL_CALL SmDocument_createInstance(
54                 const uno::Reference< lang::XMultiServiceFactory > & /*rSMgr*/, const sal_uInt64 _nCreationFlags ) throw( uno::Exception )
55 {
56     ::vos::OGuard aGuard( Application::GetSolarMutex() );
57 	if ( !SM_MOD() )
58 		SmDLL::Init();
59 
60     SfxObjectShell* pShell = new SmDocShell( _nCreationFlags );
61 	if( pShell )
62 		return uno::Reference< uno::XInterface >( pShell->GetModel() );
63 
64 	return uno::Reference< uno::XInterface >();
65 }
66 
67 
68