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