Update ooo320-m1
[ooovba.git] / sw / source / ui / uno / unofreg.cxx
blob50e770923a9e5a928a6e6e8212f230a088f615bd
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: unofreg.cxx,v $
10 * $Revision: 1.19 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_sw.hxx"
33 #include "SwXFilterOptions.hxx"
34 #include "sal/types.h"
35 #include <osl/diagnose.h>
36 #include <uno/lbnames.h>
37 #include <cppuhelper/factory.hxx>
38 #include <sfx2/sfxmodelfactory.hxx>
39 #ifndef INCLUDED_STRING_H
40 #include <string.h>
41 #define INCLUDED_STRING_H
42 #endif
44 using namespace rtl;
45 using namespace ::com::sun::star;
46 using namespace ::com::sun::star::lang;
48 // module
49 extern uno::Sequence< OUString > SAL_CALL SwUnoModule_getSupportedServiceNames() throw();
50 extern OUString SAL_CALL SwUnoModule_getImplementationName() throw();
51 extern uno::Reference< uno::XInterface > SAL_CALL SwUnoModule_createInstance( const uno::Reference< XMultiServiceFactory > &rSMgr ) throw( uno::Exception );
53 // writer documents
54 extern uno::Sequence< OUString > SAL_CALL SwTextDocument_getSupportedServiceNames() throw();
55 extern OUString SAL_CALL SwTextDocument_getImplementationName() throw();
56 extern uno::Reference< uno::XInterface > SAL_CALL SwTextDocument_createInstance( const uno::Reference< XMultiServiceFactory > &rSMgr, const sal_uInt64 _nCreationFlags ) throw( uno::Exception );
57 extern uno::Sequence< OUString > SAL_CALL SwWebDocument_getSupportedServiceNames() throw();
58 extern OUString SAL_CALL SwWebDocument_getImplementationName() throw();
59 extern uno::Reference< uno::XInterface > SAL_CALL SwWebDocument_createInstance( const uno::Reference< XMultiServiceFactory > &rSMgr ) throw( uno::Exception );
60 extern uno::Sequence< OUString > SAL_CALL SwGlobalDocument_getSupportedServiceNames() throw();
61 extern OUString SAL_CALL SwGlobalDocument_getImplementationName() throw();
62 extern uno::Reference< uno::XInterface > SAL_CALL SwGlobalDocument_createInstance( const uno::Reference< XMultiServiceFactory > &rSMgr ) throw( uno::Exception );
64 // xml import
65 extern uno::Sequence< OUString > SAL_CALL SwXMLImport_getSupportedServiceNames() throw();
66 extern OUString SAL_CALL SwXMLImport_getImplementationName() throw();
67 extern uno::Reference< uno::XInterface > SAL_CALL SwXMLImport_createInstance(const uno::Reference< XMultiServiceFactory > & rSMgr) throw( uno::Exception );
68 extern uno::Sequence< OUString > SAL_CALL SwXMLImportStyles_getSupportedServiceNames() throw();
69 extern OUString SAL_CALL SwXMLImportStyles_getImplementationName() throw();
70 extern uno::Reference< uno::XInterface > SAL_CALL SwXMLImportStyles_createInstance(const uno::Reference< XMultiServiceFactory > & rSMgr) throw( uno::Exception );
71 extern uno::Sequence< OUString > SAL_CALL SwXMLImportContent_getSupportedServiceNames() throw();
72 extern OUString SAL_CALL SwXMLImportContent_getImplementationName() throw();
73 extern uno::Reference< uno::XInterface > SAL_CALL SwXMLImportContent_createInstance(const uno::Reference< XMultiServiceFactory > & rSMgr) throw( uno::Exception );
75 extern uno::Sequence< OUString > SAL_CALL SwXMLImportMeta_getSupportedServiceNames() throw();
76 extern OUString SAL_CALL SwXMLImportMeta_getImplementationName() throw();
77 extern uno::Reference< uno::XInterface > SAL_CALL SwXMLImportMeta_createInstance(const uno::Reference< XMultiServiceFactory > & rSMgr) throw( uno::Exception );
79 extern uno::Sequence< OUString > SAL_CALL SwXMLImportSettings_getSupportedServiceNames() throw();
80 extern OUString SAL_CALL SwXMLImportSettings_getImplementationName() throw();
81 extern uno::Reference< uno::XInterface > SAL_CALL SwXMLImportSettings_createInstance(const uno::Reference< XMultiServiceFactory > & rSMgr) throw( uno::Exception );
83 // xml export (OOo)
84 extern uno::Sequence< OUString > SAL_CALL SwXMLExportOOO_getSupportedServiceNames() throw();
85 extern OUString SAL_CALL SwXMLExportOOO_getImplementationName() throw();
86 extern uno::Reference< uno::XInterface > SAL_CALL SwXMLExportOOO_createInstance(const uno::Reference< XMultiServiceFactory > & rSMgr) throw( uno::Exception );
87 extern uno::Sequence< OUString > SAL_CALL SwXMLExportContentOOO_getSupportedServiceNames() throw();
88 extern OUString SAL_CALL SwXMLExportContentOOO_getImplementationName() throw();
89 extern uno::Reference< uno::XInterface > SAL_CALL SwXMLExportContentOOO_createInstance(const uno::Reference< XMultiServiceFactory > & rSMgr) throw( uno::Exception );
90 extern uno::Sequence< OUString > SAL_CALL SwXMLExportStylesOOO_getSupportedServiceNames() throw();
91 extern OUString SAL_CALL SwXMLExportStylesOOO_getImplementationName() throw();
92 extern uno::Reference< uno::XInterface > SAL_CALL SwXMLExportStylesOOO_createInstance(const uno::Reference< XMultiServiceFactory > & rSMgr) throw( uno::Exception );
93 extern uno::Sequence< OUString > SAL_CALL SwXMLExportMetaOOO_getSupportedServiceNames() throw();
94 extern OUString SAL_CALL SwXMLExportMetaOOO_getImplementationName() throw();
95 extern uno::Reference< uno::XInterface > SAL_CALL SwXMLExportMetaOOO_createInstance(const uno::Reference< XMultiServiceFactory > & rSMgr) throw( uno::Exception );
96 extern uno::Sequence< OUString > SAL_CALL SwXMLExportSettingsOOO_getSupportedServiceNames() throw();
97 extern OUString SAL_CALL SwXMLExportSettingsOOO_getImplementationName() throw();
98 extern uno::Reference< uno::XInterface > SAL_CALL SwXMLExportSettingsOOO_createInstance(const uno::Reference< XMultiServiceFactory > & rSMgr) throw( uno::Exception );
100 // xml export (OASIS)
101 extern uno::Sequence< OUString > SAL_CALL SwXMLExport_getSupportedServiceNames() throw();
102 extern OUString SAL_CALL SwXMLExport_getImplementationName() throw();
103 extern uno::Reference< uno::XInterface > SAL_CALL SwXMLExport_createInstance(const uno::Reference< XMultiServiceFactory > & rSMgr) throw( uno::Exception );
104 extern uno::Sequence< OUString > SAL_CALL SwXMLExportContent_getSupportedServiceNames() throw();
105 extern OUString SAL_CALL SwXMLExportContent_getImplementationName() throw();
106 extern uno::Reference< uno::XInterface > SAL_CALL SwXMLExportContent_createInstance(const uno::Reference< XMultiServiceFactory > & rSMgr) throw( uno::Exception );
107 extern uno::Sequence< OUString > SAL_CALL SwXMLExportStyles_getSupportedServiceNames() throw();
108 extern OUString SAL_CALL SwXMLExportStyles_getImplementationName() throw();
109 extern uno::Reference< uno::XInterface > SAL_CALL SwXMLExportStyles_createInstance(const uno::Reference< XMultiServiceFactory > & rSMgr) throw( uno::Exception );
110 extern uno::Sequence< OUString > SAL_CALL SwXMLExportMeta_getSupportedServiceNames() throw();
111 extern OUString SAL_CALL SwXMLExportMeta_getImplementationName() throw();
112 extern uno::Reference< uno::XInterface > SAL_CALL SwXMLExportMeta_createInstance(const uno::Reference< XMultiServiceFactory > & rSMgr) throw( uno::Exception );
113 extern uno::Sequence< OUString > SAL_CALL SwXMLExportSettings_getSupportedServiceNames() throw();
114 extern OUString SAL_CALL SwXMLExportSettings_getImplementationName() throw();
115 extern uno::Reference< uno::XInterface > SAL_CALL SwXMLExportSettings_createInstance(const uno::Reference< XMultiServiceFactory > & rSMgr) throw( uno::Exception );
117 //API objects
118 extern uno::Sequence< OUString > SAL_CALL SwXAutoTextContainer_getSupportedServiceNames() throw();
119 extern OUString SAL_CALL SwXAutoTextContainer_getImplementationName() throw();
120 extern uno::Reference< uno::XInterface > SAL_CALL SwXAutoTextContainer_createInstance(const uno::Reference< XMultiServiceFactory > & rSMgr) throw( uno::Exception );
122 extern uno::Sequence< OUString > SAL_CALL SwXModule_getSupportedServiceNames() throw();
123 extern OUString SAL_CALL SwXModule_getImplementationName() throw();
124 extern uno::Reference< uno::XInterface > SAL_CALL SwXModule_createInstance(const uno::Reference< XMultiServiceFactory > & rSMgr) throw( uno::Exception );
126 extern uno::Sequence< OUString > SAL_CALL SwXMailMerge_getSupportedServiceNames() throw();
127 extern OUString SAL_CALL SwXMailMerge_getImplementationName() throw();
128 extern uno::Reference< uno::XInterface > SAL_CALL SwXMailMerge_createInstance(const uno::Reference< XMultiServiceFactory > & rSMgr) throw( uno::Exception );
130 extern uno::Sequence< OUString > SAL_CALL SwXMailMerge_getSupportedServiceNames() throw();
131 extern OUString SAL_CALL SwXMailMerge_getImplementationName() throw();
132 extern uno::Reference< uno::XInterface > SAL_CALL SwXMailMerge_createInstance(const uno::Reference< XMultiServiceFactory > & rSMgr) throw( uno::Exception );
134 // --> OD 2007-05-24 #i73788#
135 #include "cppuhelper/implementationentry.hxx"
136 namespace comp_FinalThreadManager {
138 // component and service helper functions:
139 ::rtl::OUString SAL_CALL _getImplementationName();
140 com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL _getSupportedServiceNames();
141 com::sun::star::uno::Reference< com::sun::star::uno::XInterface > SAL_CALL _create(
142 com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > const & context );
145 // <--
148 #ifdef __cplusplus
149 extern "C"
151 #endif
153 SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(
154 const sal_Char ** ppEnvTypeName,
155 uno_Environment ** /*ppEnv*/ )
157 *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
160 static void lcl_uno_writeInfo(
161 registry::XRegistryKey * pRegistryKey,
162 const OUString& rImplementationName,
163 const uno::Sequence< OUString >& rServices )
165 uno::Reference< registry::XRegistryKey > xNewKey(
166 pRegistryKey->createKey(
167 OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) + rImplementationName + OUString(RTL_CONSTASCII_USTRINGPARAM( "/UNO/SERVICES") ) ) );
169 for( sal_Int32 i = 0; i < rServices.getLength(); i++ )
170 xNewKey->createKey( rServices.getConstArray()[i]);
173 SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(
174 void * /*pServiceManager*/,
175 void * pRegistryKey )
177 if( pRegistryKey )
181 registry::XRegistryKey *pKey =
182 reinterpret_cast< registry::XRegistryKey * >( pRegistryKey );
185 // xml filter
186 lcl_uno_writeInfo( pKey, SwXMLImport_getImplementationName(),
187 SwXMLImport_getSupportedServiceNames() );
188 lcl_uno_writeInfo( pKey, SwXMLImportStyles_getImplementationName(),
189 SwXMLImportStyles_getSupportedServiceNames() );
190 lcl_uno_writeInfo( pKey,SwXMLImportContent_getImplementationName(),
191 SwXMLImportContent_getSupportedServiceNames() );
192 lcl_uno_writeInfo( pKey, SwXMLImportMeta_getImplementationName(),
193 SwXMLImportMeta_getSupportedServiceNames() );
194 lcl_uno_writeInfo( pKey, SwXMLImportSettings_getImplementationName(),
195 SwXMLImportSettings_getSupportedServiceNames() );
196 lcl_uno_writeInfo( pKey, SwXMLExportOOO_getImplementationName(),
197 SwXMLExportOOO_getSupportedServiceNames() );
198 lcl_uno_writeInfo( pKey, SwXMLExportStylesOOO_getImplementationName(),
199 SwXMLExportStylesOOO_getSupportedServiceNames() );
200 lcl_uno_writeInfo( pKey,SwXMLExportContentOOO_getImplementationName(),
201 SwXMLExportContentOOO_getSupportedServiceNames() );
202 lcl_uno_writeInfo( pKey, SwXMLExportMetaOOO_getImplementationName(),
203 SwXMLExportMetaOOO_getSupportedServiceNames() );
204 lcl_uno_writeInfo( pKey, SwXMLExportSettingsOOO_getImplementationName(),
205 SwXMLExportSettingsOOO_getSupportedServiceNames() );
206 lcl_uno_writeInfo( pKey, SwXMLExport_getImplementationName(),
207 SwXMLExport_getSupportedServiceNames() );
208 lcl_uno_writeInfo( pKey, SwXMLExportStyles_getImplementationName(),
209 SwXMLExportStyles_getSupportedServiceNames() );
210 lcl_uno_writeInfo( pKey,SwXMLExportContent_getImplementationName(),
211 SwXMLExportContent_getSupportedServiceNames() );
212 lcl_uno_writeInfo( pKey, SwXMLExportMeta_getImplementationName(),
213 SwXMLExportMeta_getSupportedServiceNames() );
214 lcl_uno_writeInfo( pKey, SwXMLExportSettings_getImplementationName(),
215 SwXMLExportSettings_getSupportedServiceNames() );
216 //API objects
217 lcl_uno_writeInfo( pKey, SwXAutoTextContainer_getImplementationName(),
218 SwXAutoTextContainer_getSupportedServiceNames() );
219 lcl_uno_writeInfo( pKey, SwXModule_getImplementationName(),
220 SwXModule_getSupportedServiceNames() );
221 lcl_uno_writeInfo( pKey, SwXMailMerge_getImplementationName(),
222 SwXMailMerge_getSupportedServiceNames() );
223 //Filter options
224 lcl_uno_writeInfo( pKey, SwXFilterOptions::getImplementationName_Static(),
225 SwXFilterOptions::getSupportedServiceNames_Static() );
227 // documents
228 lcl_uno_writeInfo( pKey, SwTextDocument_getImplementationName(),
229 SwTextDocument_getSupportedServiceNames() );
230 lcl_uno_writeInfo( pKey, SwWebDocument_getImplementationName(),
231 SwWebDocument_getSupportedServiceNames() );
232 lcl_uno_writeInfo( pKey,SwGlobalDocument_getImplementationName(),
233 SwGlobalDocument_getSupportedServiceNames() );
235 // module
236 lcl_uno_writeInfo( pKey, SwUnoModule_getImplementationName(),
237 SwUnoModule_getSupportedServiceNames() );
238 // --> OD 2007-05-24 #i73788#
239 lcl_uno_writeInfo( pKey,
240 comp_FinalThreadManager::_getImplementationName(),
241 comp_FinalThreadManager::_getSupportedServiceNames() );
242 // <--
245 catch (registry::InvalidRegistryException &)
247 OSL_ENSURE( sal_False, "### InvalidRegistryException!" );
250 return sal_True;
253 static ::cppu::ImplementationEntry const entries[] = {
254 { &comp_FinalThreadManager::_create,
255 &comp_FinalThreadManager::_getImplementationName,
256 &comp_FinalThreadManager::_getSupportedServiceNames,
257 &::cppu::createSingleComponentFactory, 0, 0 },
258 { 0, 0, 0, 0, 0, 0 }
261 SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(
262 const sal_Char * pImplName,
263 void * pServiceManager,
264 void * pRegistryKey )
266 void * pRet = 0;
267 if( pServiceManager )
269 uno::Reference< XMultiServiceFactory > xMSF(
270 reinterpret_cast< XMultiServiceFactory * >( pServiceManager ) );
272 uno::Reference< XSingleServiceFactory > xFactory;
274 const sal_Int32 nImplNameLen = strlen( pImplName );
275 if( SwXMLImport_getImplementationName().equalsAsciiL( pImplName,
276 nImplNameLen ) )
278 xFactory = ::cppu::createSingleFactory( xMSF,
279 SwXMLImport_getImplementationName(),
280 SwXMLImport_createInstance,
281 SwXMLImport_getSupportedServiceNames() );
283 else if( SwXMLImportStyles_getImplementationName().equalsAsciiL(
284 pImplName, nImplNameLen ) )
286 xFactory = ::cppu::createSingleFactory( xMSF,
287 SwXMLImportStyles_getImplementationName(),
288 SwXMLImportStyles_createInstance,
289 SwXMLImportStyles_getSupportedServiceNames() );
291 else if( SwXMLImportContent_getImplementationName().equalsAsciiL(
292 pImplName, nImplNameLen ) )
294 xFactory = ::cppu::createSingleFactory( xMSF,
295 SwXMLImportContent_getImplementationName(),
296 SwXMLImportContent_createInstance,
297 SwXMLImportContent_getSupportedServiceNames() );
299 else if( SwXMLImportMeta_getImplementationName().equalsAsciiL(
300 pImplName, nImplNameLen ) )
302 xFactory = ::cppu::createSingleFactory( xMSF,
303 SwXMLImportMeta_getImplementationName(),
304 SwXMLImportMeta_createInstance,
305 SwXMLImportMeta_getSupportedServiceNames() );
307 else if( SwXMLImportSettings_getImplementationName().equalsAsciiL(
308 pImplName, nImplNameLen ) )
310 xFactory = ::cppu::createSingleFactory( xMSF,
311 SwXMLImportSettings_getImplementationName(),
312 SwXMLImportSettings_createInstance,
313 SwXMLImportSettings_getSupportedServiceNames() );
315 else if( SwXMLExportOOO_getImplementationName().equalsAsciiL( pImplName,
316 nImplNameLen ) )
318 xFactory = ::cppu::createSingleFactory( xMSF,
319 SwXMLExportOOO_getImplementationName(),
320 SwXMLExportOOO_createInstance,
321 SwXMLExportOOO_getSupportedServiceNames() );
323 else if( SwXMLExportStylesOOO_getImplementationName().equalsAsciiL(
324 pImplName, nImplNameLen ) )
326 xFactory = ::cppu::createSingleFactory( xMSF,
327 SwXMLExportStylesOOO_getImplementationName(),
328 SwXMLExportStylesOOO_createInstance,
329 SwXMLExportStylesOOO_getSupportedServiceNames() );
331 else if( SwXMLExportContentOOO_getImplementationName().equalsAsciiL(
332 pImplName, nImplNameLen ) )
334 xFactory = ::cppu::createSingleFactory( xMSF,
335 SwXMLExportContentOOO_getImplementationName(),
336 SwXMLExportContentOOO_createInstance,
337 SwXMLExportContentOOO_getSupportedServiceNames() );
339 else if( SwXMLExportMetaOOO_getImplementationName().equalsAsciiL(
340 pImplName, nImplNameLen ) )
342 xFactory = ::cppu::createSingleFactory( xMSF,
343 SwXMLExportMetaOOO_getImplementationName(),
344 SwXMLExportMetaOOO_createInstance,
345 SwXMLExportMetaOOO_getSupportedServiceNames() );
347 else if( SwXMLExportSettingsOOO_getImplementationName().equalsAsciiL(
348 pImplName, nImplNameLen ) )
350 xFactory = ::cppu::createSingleFactory( xMSF,
351 SwXMLExportSettingsOOO_getImplementationName(),
352 SwXMLExportSettingsOOO_createInstance,
353 SwXMLExportSettingsOOO_getSupportedServiceNames() );
355 else if( SwXMLExport_getImplementationName().equalsAsciiL( pImplName,
356 nImplNameLen ) )
358 xFactory = ::cppu::createSingleFactory( xMSF,
359 SwXMLExport_getImplementationName(),
360 SwXMLExport_createInstance,
361 SwXMLExport_getSupportedServiceNames() );
363 else if( SwXMLExportStyles_getImplementationName().equalsAsciiL(
364 pImplName, nImplNameLen ) )
366 xFactory = ::cppu::createSingleFactory( xMSF,
367 SwXMLExportStyles_getImplementationName(),
368 SwXMLExportStyles_createInstance,
369 SwXMLExportStyles_getSupportedServiceNames() );
371 else if( SwXMLExportContent_getImplementationName().equalsAsciiL(
372 pImplName, nImplNameLen ) )
374 xFactory = ::cppu::createSingleFactory( xMSF,
375 SwXMLExportContent_getImplementationName(),
376 SwXMLExportContent_createInstance,
377 SwXMLExportContent_getSupportedServiceNames() );
379 else if( SwXMLExportMeta_getImplementationName().equalsAsciiL(
380 pImplName, nImplNameLen ) )
382 xFactory = ::cppu::createSingleFactory( xMSF,
383 SwXMLExportMeta_getImplementationName(),
384 SwXMLExportMeta_createInstance,
385 SwXMLExportMeta_getSupportedServiceNames() );
387 else if( SwXMLExportSettings_getImplementationName().equalsAsciiL(
388 pImplName, nImplNameLen ) )
390 xFactory = ::cppu::createSingleFactory( xMSF,
391 SwXMLExportSettings_getImplementationName(),
392 SwXMLExportSettings_createInstance,
393 SwXMLExportSettings_getSupportedServiceNames() );
395 else if( SwXAutoTextContainer_getImplementationName().equalsAsciiL(
396 pImplName, nImplNameLen ) )
398 xFactory = ::cppu::createSingleFactory( xMSF,
399 SwXAutoTextContainer_getImplementationName(),
400 SwXAutoTextContainer_createInstance,
401 SwXAutoTextContainer_getSupportedServiceNames() );
403 else if( SwXModule_getImplementationName().equalsAsciiL(
404 pImplName, nImplNameLen ) )
406 xFactory = ::cppu::createSingleFactory( xMSF,
407 SwXModule_getImplementationName(),
408 SwXModule_createInstance,
409 SwXModule_getSupportedServiceNames() );
411 else if( SwXMailMerge_getImplementationName().equalsAsciiL(
412 pImplName, nImplNameLen ) )
414 xFactory = ::cppu::createSingleFactory( xMSF,
415 SwXMailMerge_getImplementationName(),
416 SwXMailMerge_createInstance,
417 SwXMailMerge_getSupportedServiceNames() );
419 else if( SwXFilterOptions::getImplementationName_Static().equalsAsciiL(
420 pImplName, nImplNameLen ) )
422 xFactory = ::cppu::createSingleFactory( xMSF,
423 SwXFilterOptions::getImplementationName_Static(),
424 SwXFilterOptions_createInstance,
425 SwXFilterOptions::getSupportedServiceNames_Static() );
427 else if( SwTextDocument_getImplementationName().equalsAsciiL(
428 pImplName, nImplNameLen ) )
430 xFactory = ::sfx2::createSfxModelFactory( xMSF,
431 SwTextDocument_getImplementationName(),
432 SwTextDocument_createInstance,
433 SwTextDocument_getSupportedServiceNames() );
435 else if( SwWebDocument_getImplementationName().equalsAsciiL(
436 pImplName, nImplNameLen ) )
438 xFactory = ::cppu::createSingleFactory( xMSF,
439 SwWebDocument_getImplementationName(),
440 SwWebDocument_createInstance,
441 SwWebDocument_getSupportedServiceNames() );
443 else if( SwGlobalDocument_getImplementationName().equalsAsciiL(
444 pImplName, nImplNameLen ) )
446 xFactory = ::cppu::createSingleFactory( xMSF,
447 SwGlobalDocument_getImplementationName(),
448 SwGlobalDocument_createInstance,
449 SwGlobalDocument_getSupportedServiceNames() );
451 else if( SwUnoModule_getImplementationName().equalsAsciiL(
452 pImplName, nImplNameLen ) )
454 xFactory = ::cppu::createSingleFactory( xMSF,
455 SwUnoModule_getImplementationName(),
456 SwUnoModule_createInstance,
457 SwUnoModule_getSupportedServiceNames() );
459 // --> OD 2007-05-24 #i73788#
460 else if( comp_FinalThreadManager::_getImplementationName().equalsAsciiL(
461 pImplName, nImplNameLen ) )
463 pRet = ::cppu::component_getFactoryHelper(
464 pImplName, pServiceManager, pRegistryKey, entries);
466 // <--
468 if( xFactory.is())
470 xFactory->acquire();
471 pRet = xFactory.get();
474 return pRet;
477 #ifdef __cplusplus
479 #endif