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