xref: /aoo42x/main/svx/source/unodraw/unoctabl.cxx (revision f6e50924)
1*f6e50924SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*f6e50924SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*f6e50924SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*f6e50924SAndrew Rist  * distributed with this work for additional information
6*f6e50924SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*f6e50924SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*f6e50924SAndrew Rist  * "License"); you may not use this file except in compliance
9*f6e50924SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*f6e50924SAndrew Rist  *
11*f6e50924SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*f6e50924SAndrew Rist  *
13*f6e50924SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*f6e50924SAndrew Rist  * software distributed under the License is distributed on an
15*f6e50924SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*f6e50924SAndrew Rist  * KIND, either express or implied.  See the License for the
17*f6e50924SAndrew Rist  * specific language governing permissions and limitations
18*f6e50924SAndrew Rist  * under the License.
19*f6e50924SAndrew Rist  *
20*f6e50924SAndrew Rist  *************************************************************/
21*f6e50924SAndrew Rist 
22*f6e50924SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_svx.hxx"
26cdf0e10cSrcweir #include <unotools/pathoptions.hxx>
27cdf0e10cSrcweir #include <com/sun/star/lang/XServiceInfo.hpp>
28cdf0e10cSrcweir #include <com/sun/star/container/XNameContainer.hpp>
29cdf0e10cSrcweir #include <cppuhelper/implbase2.hxx>
30cdf0e10cSrcweir 
31cdf0e10cSrcweir #include "../customshapes/EnhancedCustomShapeEngine.hxx"
32cdf0e10cSrcweir 
33cdf0e10cSrcweir #include <svx/xtable.hxx>
34cdf0e10cSrcweir #include "svx/unoshcol.hxx"
35cdf0e10cSrcweir #include "recoveryui.hxx"
36cdf0e10cSrcweir #include "svx/xmlgrhlp.hxx"
37cdf0e10cSrcweir #include "tbunocontroller.hxx"
38cdf0e10cSrcweir #include "tbunosearchcontrollers.hxx"
39cdf0e10cSrcweir 
40cdf0e10cSrcweir using namespace ::com::sun::star;
41cdf0e10cSrcweir using namespace ::rtl;
42cdf0e10cSrcweir using namespace ::cppu;
43cdf0e10cSrcweir 
44cdf0e10cSrcweir class SvxUnoColorTable : public WeakImplHelper2< container::XNameContainer, lang::XServiceInfo >
45cdf0e10cSrcweir {
46cdf0e10cSrcweir private:
47cdf0e10cSrcweir 	XColorTable*	pTable;
48cdf0e10cSrcweir 
49cdf0e10cSrcweir public:
50cdf0e10cSrcweir 	SvxUnoColorTable() throw();
51cdf0e10cSrcweir 	virtual	~SvxUnoColorTable() throw();
52cdf0e10cSrcweir 
53cdf0e10cSrcweir     // XServiceInfo
54cdf0e10cSrcweir     virtual OUString SAL_CALL getImplementationName(  ) throw( uno::RuntimeException );
55cdf0e10cSrcweir     virtual sal_Bool SAL_CALL supportsService( const  OUString& ServiceName ) throw( uno::RuntimeException);
56cdf0e10cSrcweir     virtual uno::Sequence<  OUString > SAL_CALL getSupportedServiceNames(  ) throw( uno::RuntimeException);
57cdf0e10cSrcweir 
58cdf0e10cSrcweir     static OUString getImplementationName_Static() throw()
59cdf0e10cSrcweir 	{
60cdf0e10cSrcweir 		return OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.SvxUnoColorTable"));
61cdf0e10cSrcweir 	}
62cdf0e10cSrcweir 
63cdf0e10cSrcweir     static uno::Sequence< OUString >  getSupportedServiceNames_Static(void) throw();
64cdf0e10cSrcweir 
65cdf0e10cSrcweir 	// XNameContainer
66cdf0e10cSrcweir 	virtual void SAL_CALL insertByName( const  OUString& aName, const  uno::Any& aElement ) throw( lang::IllegalArgumentException, container::ElementExistException, lang::WrappedTargetException, uno::RuntimeException);
67cdf0e10cSrcweir 	virtual void SAL_CALL removeByName( const  OUString& Name ) throw( container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException);
68cdf0e10cSrcweir 
69cdf0e10cSrcweir 	// XNameReplace
70cdf0e10cSrcweir     virtual void SAL_CALL replaceByName( const  OUString& aName, const  uno::Any& aElement ) throw( lang::IllegalArgumentException, container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException);
71cdf0e10cSrcweir 
72cdf0e10cSrcweir 	// XNameAccess
73cdf0e10cSrcweir     virtual uno::Any SAL_CALL getByName( const  OUString& aName ) throw( container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException);
74cdf0e10cSrcweir 
75cdf0e10cSrcweir     virtual uno::Sequence<  OUString > SAL_CALL getElementNames(  ) throw( uno::RuntimeException);
76cdf0e10cSrcweir 
77cdf0e10cSrcweir     virtual sal_Bool SAL_CALL hasByName( const  OUString& aName ) throw( uno::RuntimeException);
78cdf0e10cSrcweir 
79cdf0e10cSrcweir 	// XElementAccess
80cdf0e10cSrcweir     virtual uno::Type SAL_CALL getElementType(  ) throw( uno::RuntimeException);
81cdf0e10cSrcweir     virtual sal_Bool SAL_CALL hasElements(  ) throw( uno::RuntimeException);
82cdf0e10cSrcweir };
83cdf0e10cSrcweir 
84cdf0e10cSrcweir SvxUnoColorTable::SvxUnoColorTable() throw()
85cdf0e10cSrcweir {
86cdf0e10cSrcweir 	pTable = new XColorTable( SvtPathOptions().GetPalettePath() );
87cdf0e10cSrcweir }
88cdf0e10cSrcweir 
89cdf0e10cSrcweir SvxUnoColorTable::~SvxUnoColorTable() throw()
90cdf0e10cSrcweir {
91cdf0e10cSrcweir 	delete pTable;
92cdf0e10cSrcweir }
93cdf0e10cSrcweir 
94cdf0e10cSrcweir sal_Bool SAL_CALL SvxUnoColorTable::supportsService( const  OUString& ServiceName ) throw(uno::RuntimeException)
95cdf0e10cSrcweir {
96cdf0e10cSrcweir     uno::Sequence< OUString > aSNL( getSupportedServiceNames() );
97cdf0e10cSrcweir     const OUString * pArray = aSNL.getConstArray();
98cdf0e10cSrcweir 
99cdf0e10cSrcweir     for( sal_Int32 i = 0; i < aSNL.getLength(); i++ )
100cdf0e10cSrcweir         if( pArray[i] == ServiceName )
101cdf0e10cSrcweir             return sal_True;
102cdf0e10cSrcweir 
103cdf0e10cSrcweir     return sal_False;
104cdf0e10cSrcweir }
105cdf0e10cSrcweir 
106cdf0e10cSrcweir OUString SAL_CALL SvxUnoColorTable::getImplementationName() throw( uno::RuntimeException )
107cdf0e10cSrcweir {
108cdf0e10cSrcweir 	return OUString( RTL_CONSTASCII_USTRINGPARAM("SvxUnoColorTable") );
109cdf0e10cSrcweir }
110cdf0e10cSrcweir 
111cdf0e10cSrcweir uno::Sequence< OUString > SAL_CALL SvxUnoColorTable::getSupportedServiceNames(  )
112cdf0e10cSrcweir 	throw( uno::RuntimeException )
113cdf0e10cSrcweir {
114cdf0e10cSrcweir     return getSupportedServiceNames_Static();
115cdf0e10cSrcweir }
116cdf0e10cSrcweir 
117cdf0e10cSrcweir uno::Sequence< OUString > SvxUnoColorTable::getSupportedServiceNames_Static(void) throw()
118cdf0e10cSrcweir {
119cdf0e10cSrcweir     uno::Sequence< OUString > aSNS( 1 );
120cdf0e10cSrcweir     aSNS.getArray()[0] = OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.ColorTable" ));
121cdf0e10cSrcweir     return aSNS;
122cdf0e10cSrcweir }
123cdf0e10cSrcweir 
124cdf0e10cSrcweir // XNameContainer
125cdf0e10cSrcweir void SAL_CALL SvxUnoColorTable::insertByName( const OUString& aName, const uno::Any& aElement )
126cdf0e10cSrcweir 	throw( lang::IllegalArgumentException, container::ElementExistException, lang::WrappedTargetException, uno::RuntimeException )
127cdf0e10cSrcweir {
128cdf0e10cSrcweir 	if( hasByName( aName ) )
129cdf0e10cSrcweir 		throw container::ElementExistException();
130cdf0e10cSrcweir 
131cdf0e10cSrcweir 	sal_Int32 nColor = 0;
132cdf0e10cSrcweir 	if( !(aElement >>= nColor) )
133cdf0e10cSrcweir 		throw lang::IllegalArgumentException();
134cdf0e10cSrcweir 
135cdf0e10cSrcweir 	if( pTable )
136cdf0e10cSrcweir 	{
137cdf0e10cSrcweir 		XColorEntry* pEntry = new XColorEntry( Color( (ColorData)nColor ), aName  );
138cdf0e10cSrcweir 		pTable->Insert( pTable->Count(), pEntry );
139cdf0e10cSrcweir 	}
140cdf0e10cSrcweir }
141cdf0e10cSrcweir 
142cdf0e10cSrcweir void SAL_CALL SvxUnoColorTable::removeByName( const OUString& Name )
143cdf0e10cSrcweir 	throw( container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
144cdf0e10cSrcweir {
145cdf0e10cSrcweir 	long nIndex = pTable ? ((XPropertyTable*)pTable)->Get( Name ) : -1;
146cdf0e10cSrcweir 	if( nIndex == -1 )
147cdf0e10cSrcweir 		throw container::NoSuchElementException();
148cdf0e10cSrcweir 
149cdf0e10cSrcweir 	pTable->Remove( nIndex );
150cdf0e10cSrcweir }
151cdf0e10cSrcweir 
152cdf0e10cSrcweir // XNameReplace
153cdf0e10cSrcweir void SAL_CALL SvxUnoColorTable::replaceByName( const OUString& aName, const uno::Any& aElement )
154cdf0e10cSrcweir 	throw( lang::IllegalArgumentException, container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException )
155cdf0e10cSrcweir {
156cdf0e10cSrcweir 	sal_Int32 nColor = 0;
157cdf0e10cSrcweir 	if( !(aElement >>= nColor) )
158cdf0e10cSrcweir 		throw lang::IllegalArgumentException();
159cdf0e10cSrcweir 
160cdf0e10cSrcweir 	long nIndex = pTable ? ((XPropertyTable*)pTable)->Get( aName ) : -1;
161cdf0e10cSrcweir 	if( nIndex == -1  )
162cdf0e10cSrcweir 		throw container::NoSuchElementException();
163cdf0e10cSrcweir 
164cdf0e10cSrcweir 	XColorEntry* pEntry = new XColorEntry( Color( (ColorData)nColor ), aName );
165cdf0e10cSrcweir 	delete pTable->Replace( nIndex, pEntry );
166cdf0e10cSrcweir }
167cdf0e10cSrcweir 
168cdf0e10cSrcweir // XNameAccess
169cdf0e10cSrcweir uno::Any SAL_CALL SvxUnoColorTable::getByName( const  OUString& aName )
170cdf0e10cSrcweir 	throw( container::NoSuchElementException,  lang::WrappedTargetException, uno::RuntimeException)
171cdf0e10cSrcweir {
172cdf0e10cSrcweir 	long nIndex = pTable ? ((XPropertyTable*)pTable)->Get( aName ) : -1;
173cdf0e10cSrcweir 	if( nIndex == -1 )
174cdf0e10cSrcweir 		throw container::NoSuchElementException();
175cdf0e10cSrcweir 
176cdf0e10cSrcweir 	XColorEntry* pEntry = ((XColorTable*)pTable)->GetColor( nIndex );
177cdf0e10cSrcweir 	return uno::Any( (sal_Int32) pEntry->GetColor().GetRGBColor() );
178cdf0e10cSrcweir }
179cdf0e10cSrcweir 
180cdf0e10cSrcweir uno::Sequence< OUString > SAL_CALL SvxUnoColorTable::getElementNames(  )
181cdf0e10cSrcweir 	throw( uno::RuntimeException )
182cdf0e10cSrcweir {
183cdf0e10cSrcweir 	const long nCount = pTable ? pTable->Count() : 0;
184cdf0e10cSrcweir 
185cdf0e10cSrcweir 	uno::Sequence< OUString > aSeq( nCount );
186cdf0e10cSrcweir 	OUString* pStrings = aSeq.getArray();
187cdf0e10cSrcweir 
188cdf0e10cSrcweir 	for( long nIndex = 0; nIndex < nCount; nIndex++ )
189cdf0e10cSrcweir 	{
190cdf0e10cSrcweir 		XColorEntry* pEntry = pTable->GetColor( (long)nIndex );
191cdf0e10cSrcweir 		pStrings[nIndex] = pEntry->GetName();
192cdf0e10cSrcweir 	}
193cdf0e10cSrcweir 
194cdf0e10cSrcweir 	return aSeq;
195cdf0e10cSrcweir }
196cdf0e10cSrcweir 
197cdf0e10cSrcweir sal_Bool SAL_CALL SvxUnoColorTable::hasByName( const OUString& aName )
198cdf0e10cSrcweir 	throw( uno::RuntimeException )
199cdf0e10cSrcweir {
200cdf0e10cSrcweir 	long nIndex = pTable ? ((XPropertyTable*)pTable)->Get( aName ) : -1;
201cdf0e10cSrcweir 	return nIndex != -1;
202cdf0e10cSrcweir }
203cdf0e10cSrcweir 
204cdf0e10cSrcweir // XElementAccess
205cdf0e10cSrcweir uno::Type SAL_CALL SvxUnoColorTable::getElementType(  )
206cdf0e10cSrcweir 	throw( uno::RuntimeException )
207cdf0e10cSrcweir {
208cdf0e10cSrcweir 	return ::getCppuType((const sal_Int32*)0);
209cdf0e10cSrcweir }
210cdf0e10cSrcweir 
211cdf0e10cSrcweir sal_Bool SAL_CALL SvxUnoColorTable::hasElements(  )
212cdf0e10cSrcweir 	throw( uno::RuntimeException )
213cdf0e10cSrcweir {
214cdf0e10cSrcweir 	return pTable && pTable->Count() != 0;
215cdf0e10cSrcweir }
216cdf0e10cSrcweir 
217cdf0e10cSrcweir /**
218cdf0e10cSrcweir  * Create a colortable
219cdf0e10cSrcweir  */
220cdf0e10cSrcweir uno::Reference< uno::XInterface > SAL_CALL SvxUnoColorTable_createInstance(const uno::Reference< lang::XMultiServiceFactory > & ) throw(uno::Exception)
221cdf0e10cSrcweir {
222cdf0e10cSrcweir 	return *new SvxUnoColorTable();
223cdf0e10cSrcweir }
224cdf0e10cSrcweir uno::Reference< uno::XInterface > SAL_CALL create_EnhancedCustomShapeEngine( const uno::Reference< lang::XMultiServiceFactory >& rxFact ) throw(uno::Exception)
225cdf0e10cSrcweir {
226cdf0e10cSrcweir 	return *new EnhancedCustomShapeEngine( rxFact );
227cdf0e10cSrcweir }
228cdf0e10cSrcweir 
229cdf0e10cSrcweir //
230cdf0e10cSrcweir // export this service
231cdf0e10cSrcweir //
232cdf0e10cSrcweir 
233cdf0e10cSrcweir #include "UnoGraphicExporter.hxx"
234cdf0e10cSrcweir #include "unogalthemeprovider.hxx"
235cdf0e10cSrcweir #include <com/sun/star/registry/XRegistryKey.hpp>
236cdf0e10cSrcweir #include "sal/types.h"
237cdf0e10cSrcweir #include "osl/diagnose.h"
238cdf0e10cSrcweir #include "cppuhelper/factory.hxx"
239cdf0e10cSrcweir #include "uno/lbnames.h"
240cdf0e10cSrcweir #include <svx/sdr/primitive2d/primitiveFactory2d.hxx>
241cdf0e10cSrcweir 
242cdf0e10cSrcweir /*
243cdf0e10cSrcweir namespace svx
244cdf0e10cSrcweir {
245cdf0e10cSrcweir extern OUString SAL_CALL ExtrusionDepthController_getImplementationName();
246cdf0e10cSrcweir extern uno::Reference< uno::XInterface > SAL_CALL ExtrusionDepthController_createInstance(const uno::Reference< lang::XMultiServiceFactory > &)  throw( uno::RuntimeException );
247cdf0e10cSrcweir extern uno::Sequence< OUString > SAL_CALL ExtrusionDepthController_getSupportedServiceNames() throw( uno::RuntimeException );
248cdf0e10cSrcweir }
249cdf0e10cSrcweir */
250cdf0e10cSrcweir 
251cdf0e10cSrcweir extern "C"
252cdf0e10cSrcweir {
253cdf0e10cSrcweir 
254cdf0e10cSrcweir SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment (
255cdf0e10cSrcweir 	const sal_Char ** ppEnvTypeName, uno_Environment ** )
256cdf0e10cSrcweir {
257cdf0e10cSrcweir 	*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
258cdf0e10cSrcweir }
259cdf0e10cSrcweir 
260cdf0e10cSrcweir SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory (
261cdf0e10cSrcweir 	const sal_Char * pImplName, void * pServiceManager, void *  )
262cdf0e10cSrcweir {
263cdf0e10cSrcweir 	void * pRet = 0;
264cdf0e10cSrcweir 	if( pServiceManager  )
265cdf0e10cSrcweir 	{
266cdf0e10cSrcweir 		uno::Reference< lang::XSingleServiceFactory > xFactory;
267cdf0e10cSrcweir 
268cdf0e10cSrcweir 		if( rtl_str_compare( pImplName, "com.sun.star.drawing.SvxUnoColorTable" ) == 0 )
269cdf0e10cSrcweir 		{
270cdf0e10cSrcweir 			xFactory = createSingleFactory( reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ),
271cdf0e10cSrcweir 				SvxUnoColorTable::getImplementationName_Static(),
272cdf0e10cSrcweir 				SvxUnoColorTable_createInstance,
273cdf0e10cSrcweir 				SvxUnoColorTable::getSupportedServiceNames_Static() );
274cdf0e10cSrcweir 		}
275cdf0e10cSrcweir 		else if ( rtl_str_compare( pImplName, "com.sun.star.drawing.EnhancedCustomShapeEngine" ) == 0 )
276cdf0e10cSrcweir 		{
277cdf0e10cSrcweir 			xFactory = createSingleFactory( reinterpret_cast< NMSP_LANG::XMultiServiceFactory* >( pServiceManager ),
278cdf0e10cSrcweir 				EnhancedCustomShapeEngine_getImplementationName(),
279cdf0e10cSrcweir 				create_EnhancedCustomShapeEngine,
280cdf0e10cSrcweir 				EnhancedCustomShapeEngine_getSupportedServiceNames() );
281cdf0e10cSrcweir 		}
282cdf0e10cSrcweir 		else if( rtl_str_compare( pImplName, "com.sun.star.drawing.SvxShapeCollection" ) == 0 )
283cdf0e10cSrcweir 		{
284cdf0e10cSrcweir 			xFactory = createSingleFactory( reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ),
285cdf0e10cSrcweir 				SvxShapeCollection::getImplementationName_Static(),
286cdf0e10cSrcweir 				SvxShapeCollection_createInstance,
287cdf0e10cSrcweir 				SvxShapeCollection::getSupportedServiceNames_Static() );
288cdf0e10cSrcweir 		}
289cdf0e10cSrcweir 		else if( svx::RecoveryUI::st_getImplementationName().equalsAscii( pImplName ) )
290cdf0e10cSrcweir 		{
291cdf0e10cSrcweir 			xFactory = ::cppu::createSingleFactory( reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ),
292cdf0e10cSrcweir 				svx::RecoveryUI::st_getImplementationName(),
293cdf0e10cSrcweir 				svx::RecoveryUI::st_createInstance,
294cdf0e10cSrcweir 				svx::RecoveryUI::st_getSupportedServiceNames() );
295cdf0e10cSrcweir 		}
296cdf0e10cSrcweir 		else if( svx::GraphicExporter_getImplementationName().equalsAscii( pImplName ) )
297cdf0e10cSrcweir 		{
298cdf0e10cSrcweir 			xFactory = ::cppu::createSingleFactory( reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ),
299cdf0e10cSrcweir 				svx::GraphicExporter_getImplementationName(),
300cdf0e10cSrcweir 				svx::GraphicExporter_createInstance,
301cdf0e10cSrcweir 				svx::GraphicExporter_getSupportedServiceNames() );
302cdf0e10cSrcweir 		}
303cdf0e10cSrcweir         else if ( svx::FontHeightToolBoxControl::getImplementationName_Static().equalsAscii( pImplName ) )
304cdf0e10cSrcweir         {
305cdf0e10cSrcweir             xFactory = createSingleFactory( reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ),
306cdf0e10cSrcweir 				svx::FontHeightToolBoxControl::getImplementationName_Static(),
307cdf0e10cSrcweir 				svx::FontHeightToolBoxControl_createInstance,
308cdf0e10cSrcweir 				svx::FontHeightToolBoxControl::getSupportedServiceNames_Static() );
309cdf0e10cSrcweir         }
310cdf0e10cSrcweir         else if ( svx::FindTextToolbarController::getImplementationName_Static().equalsAscii( pImplName ) )
311cdf0e10cSrcweir         {
312cdf0e10cSrcweir             xFactory = createSingleFactory( reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ),
313cdf0e10cSrcweir                 svx::FindTextToolbarController::getImplementationName_Static(),
314cdf0e10cSrcweir                 svx::FindTextToolbarController_createInstance,
315cdf0e10cSrcweir                 svx::FindTextToolbarController::getSupportedServiceNames_Static() );
316cdf0e10cSrcweir         }
317cdf0e10cSrcweir         else if ( svx::DownSearchToolboxController::getImplementationName_Static().equalsAscii( pImplName ) )
318cdf0e10cSrcweir         {
319cdf0e10cSrcweir             xFactory = createSingleFactory( reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ),
320cdf0e10cSrcweir                 svx::DownSearchToolboxController::getImplementationName_Static(),
321cdf0e10cSrcweir                 svx::DownSearchToolboxController_createInstance,
322cdf0e10cSrcweir                 svx::DownSearchToolboxController::getSupportedServiceNames_Static() );
323cdf0e10cSrcweir         }
324cdf0e10cSrcweir         else if ( svx::UpSearchToolboxController::getImplementationName_Static().equalsAscii( pImplName ) )
325cdf0e10cSrcweir         {
326cdf0e10cSrcweir             xFactory = createSingleFactory( reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ),
327cdf0e10cSrcweir                 svx::UpSearchToolboxController::getImplementationName_Static(),
328cdf0e10cSrcweir                 svx::UpSearchToolboxController_createInstance,
329cdf0e10cSrcweir                 svx::UpSearchToolboxController::getSupportedServiceNames_Static() );
330cdf0e10cSrcweir         }
331cdf0e10cSrcweir         else if ( svx::FindbarDispatcher::getImplementationName_Static().equalsAscii( pImplName ) )
332cdf0e10cSrcweir         {
333cdf0e10cSrcweir             xFactory = createSingleFactory( reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ),
334cdf0e10cSrcweir                 svx::FindbarDispatcher::getImplementationName_Static(),
335cdf0e10cSrcweir                 svx::FindbarDispatcher_createInstance,
336cdf0e10cSrcweir                 svx::FindbarDispatcher::getSupportedServiceNames_Static() );
337cdf0e10cSrcweir         }
338cdf0e10cSrcweir 		else if( ::unogallery::GalleryThemeProvider_getImplementationName().equalsAscii( pImplName ) )
339cdf0e10cSrcweir 		{
340cdf0e10cSrcweir 			xFactory = ::cppu::createSingleFactory( reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ),
341cdf0e10cSrcweir 				::unogallery::GalleryThemeProvider_getImplementationName(),
342cdf0e10cSrcweir 				::unogallery::GalleryThemeProvider_createInstance,
343cdf0e10cSrcweir 				::unogallery::GalleryThemeProvider_getSupportedServiceNames() );
344cdf0e10cSrcweir 		}
345cdf0e10cSrcweir 		else if( drawinglayer::primitive2d::PrimitiveFactory2D::getImplementationName_Static().equalsAscii( pImplName ) )
346cdf0e10cSrcweir 		{
347cdf0e10cSrcweir 			// XPrimitiveFactory2D
348cdf0e10cSrcweir 			xFactory = ::cppu::createSingleFactory( reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ),
349cdf0e10cSrcweir 				drawinglayer::primitive2d::PrimitiveFactory2D::getImplementationName_Static(),
350cdf0e10cSrcweir 				drawinglayer::primitive2d::XPrimitiveFactory2DProvider_createInstance,
351cdf0e10cSrcweir 				drawinglayer::primitive2d::PrimitiveFactory2D::getSupportedServiceNames_Static() );
352cdf0e10cSrcweir 		}
353cdf0e10cSrcweir         else if( ::svx::SvXMLGraphicImportHelper_getImplementationName().equalsAscii( pImplName ) )
354cdf0e10cSrcweir         {
355cdf0e10cSrcweir             xFactory = ::cppu::createSingleFactory(
356cdf0e10cSrcweir                 reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ),
357cdf0e10cSrcweir                 ::svx::SvXMLGraphicImportHelper_getImplementationName(),
358cdf0e10cSrcweir                 ::svx::SvXMLGraphicImportHelper_createInstance,
359cdf0e10cSrcweir                 ::svx::SvXMLGraphicImportHelper_getSupportedServiceNames() );
360cdf0e10cSrcweir         }
361cdf0e10cSrcweir         else if( ::svx::SvXMLGraphicExportHelper_getImplementationName().equalsAscii( pImplName ) )
362cdf0e10cSrcweir         {
363cdf0e10cSrcweir             xFactory = ::cppu::createSingleFactory(
364cdf0e10cSrcweir                 reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ),
365cdf0e10cSrcweir                 ::svx::SvXMLGraphicExportHelper_getImplementationName(),
366cdf0e10cSrcweir                 ::svx::SvXMLGraphicExportHelper_createInstance,
367cdf0e10cSrcweir                 ::svx::SvXMLGraphicExportHelper_getSupportedServiceNames() );
368cdf0e10cSrcweir         }
369cdf0e10cSrcweir /*
370cdf0e10cSrcweir 		else if( ::svx::ExtrusionDepthController_getImplementationName().equalsAscii( pImplName ) )
371cdf0e10cSrcweir 		{
372cdf0e10cSrcweir 			xFactory = ::cppu::createSingleFactory(
373cdf0e10cSrcweir 				reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ),
374cdf0e10cSrcweir 				::svx::ExtrusionDepthController_getImplementationName(),
375cdf0e10cSrcweir 				::svx::ExtrusionDepthController_createInstance,
376cdf0e10cSrcweir 				::svx::ExtrusionDepthController_getSupportedServiceNames() );
377cdf0e10cSrcweir 		}
378cdf0e10cSrcweir */
379cdf0e10cSrcweir 		if( xFactory.is())
380cdf0e10cSrcweir 		{
381cdf0e10cSrcweir 			xFactory->acquire();
382cdf0e10cSrcweir 			pRet = xFactory.get();
383cdf0e10cSrcweir 		}
384cdf0e10cSrcweir 	}
385cdf0e10cSrcweir 
386cdf0e10cSrcweir 	return pRet;
387cdf0e10cSrcweir }
388cdf0e10cSrcweir 
389cdf0e10cSrcweir }
390