summaryrefslogtreecommitdiff
path: root/svx/source/unodraw/unoctabl.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'svx/source/unodraw/unoctabl.cxx')
-rw-r--r--svx/source/unodraw/unoctabl.cxx210
1 files changed, 13 insertions, 197 deletions
diff --git a/svx/source/unodraw/unoctabl.cxx b/svx/source/unodraw/unoctabl.cxx
index 6963cf9b52bc..76762b9a7efa 100644
--- a/svx/source/unodraw/unoctabl.cxx
+++ b/svx/source/unodraw/unoctabl.cxx
@@ -20,21 +20,15 @@
#include <unotools/pathoptions.hxx>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/container/XNameContainer.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
#include <cppuhelper/implbase2.hxx>
-
-#include "../customshapes/EnhancedCustomShapeEngine.hxx"
-
#include <svx/xtable.hxx>
-#include "svx/unoshcol.hxx"
-#include "recoveryui.hxx"
-#include "svx/xmlgrhlp.hxx"
-#include "tbunocontroller.hxx"
-#include "tbunosearchcontrollers.hxx"
using namespace ::com::sun::star;
-using namespace ::rtl;
using namespace ::cppu;
+namespace {
+
class SvxUnoColorTable : public WeakImplHelper2< container::XNameContainer, lang::XServiceInfo >
{
private:
@@ -49,13 +43,6 @@ public:
virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw( uno::RuntimeException);
virtual uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( uno::RuntimeException);
- static OUString getImplementationName_Static() throw()
- {
- return OUString("com.sun.star.drawing.SvxUnoColorTable");
- }
-
- static uno::Sequence< OUString > getSupportedServiceNames_Static(void) throw();
-
// XNameContainer
virtual void SAL_CALL insertByName( const OUString& aName, const uno::Any& aElement ) throw( lang::IllegalArgumentException, container::ElementExistException, lang::WrappedTargetException, uno::RuntimeException);
virtual void SAL_CALL removeByName( const OUString& Name ) throw( container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException);
@@ -98,17 +85,12 @@ sal_Bool SAL_CALL SvxUnoColorTable::supportsService( const OUString& ServiceNam
OUString SAL_CALL SvxUnoColorTable::getImplementationName() throw( uno::RuntimeException )
{
- return OUString("SvxUnoColorTable");
+ return OUString("com.sun.star.drawing.SvxUnoColorTable");
}
uno::Sequence< OUString > SAL_CALL SvxUnoColorTable::getSupportedServiceNames()
throw( uno::RuntimeException )
{
- return getSupportedServiceNames_Static();
-}
-
-uno::Sequence< OUString > SvxUnoColorTable::getSupportedServiceNames_Static(void) throw()
-{
uno::Sequence< OUString > aSNS( 1 );
aSNS.getArray()[0] = "com.sun.star.drawing.ColorTable";
return aSNS;
@@ -207,184 +189,18 @@ sal_Bool SAL_CALL SvxUnoColorTable::hasElements()
return pList.is() && pList->Count() != 0;
}
-/**
- * Create a colortable
- */
-uno::Reference< uno::XInterface > SAL_CALL SvxUnoColorTable_createInstance(const uno::Reference< lang::XMultiServiceFactory > & ) throw(uno::Exception)
-{
- return *new SvxUnoColorTable();
}
-uno::Reference< uno::XInterface > SAL_CALL create_EnhancedCustomShapeEngine( const uno::Reference< lang::XMultiServiceFactory >& rxFact ) throw(uno::Exception)
-{
- return *new EnhancedCustomShapeEngine( rxFact );
-}
-
-//
-// export this service
-//
-
-#include "UnoGraphicExporter.hxx"
-#include "unogalthemeprovider.hxx"
-#include <com/sun/star/registry/XRegistryKey.hpp>
-#include "sal/types.h"
-#include "osl/diagnose.h"
-#include "cppuhelper/factory.hxx"
-#include <svx/sdr/primitive2d/primitiveFactory2d.hxx>
-#include "sidebar/PanelFactory.hxx"
-
-
-extern "C"
-{
-SAL_DLLPUBLIC_EXPORT void * SAL_CALL svx_component_getFactory (
- const sal_Char * pImplName, void * pServiceManager, void * )
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
+com_sun_star_drawing_SvxUnoColorTable_implementation_getFactory(
+ SAL_UNUSED_PARAMETER css::uno::XComponentContext *,
+ uno_Sequence * arguments)
{
- void * pRet = 0;
- if( pServiceManager )
- {
- uno::Reference< lang::XSingleServiceFactory > xFactory;
-
- if( rtl_str_compare( pImplName, "com.sun.star.drawing.SvxUnoColorTable" ) == 0 )
- {
- xFactory = createSingleFactory( reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ),
- SvxUnoColorTable::getImplementationName_Static(),
- SvxUnoColorTable_createInstance,
- SvxUnoColorTable::getSupportedServiceNames_Static() );
- }
- else if ( rtl_str_compare( pImplName, "com.sun.star.drawing.EnhancedCustomShapeEngine" ) == 0 )
- {
- xFactory = createSingleFactory( reinterpret_cast< lang::XMultiServiceFactory* >( pServiceManager ),
- EnhancedCustomShapeEngine_getImplementationName(),
- create_EnhancedCustomShapeEngine,
- EnhancedCustomShapeEngine_getSupportedServiceNames() );
- }
- else if( rtl_str_compare( pImplName, "com.sun.star.drawing.SvxShapeCollection" ) == 0 )
- {
- xFactory = createSingleFactory( reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ),
- SvxShapeCollection::getImplementationName_Static(),
- SvxShapeCollection_createInstance,
- SvxShapeCollection::getSupportedServiceNames_Static() );
- }
- else if( svx::RecoveryUI::st_getImplementationName().equalsAscii( pImplName ) )
- {
- xFactory = ::cppu::createSingleFactory( reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ),
- svx::RecoveryUI::st_getImplementationName(),
- svx::RecoveryUI::st_createInstance,
- svx::RecoveryUI::st_getSupportedServiceNames() );
- }
- else if( svx::GraphicExporter_getImplementationName().equalsAscii( pImplName ) )
- {
- xFactory = ::cppu::createSingleFactory( reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ),
- svx::GraphicExporter_getImplementationName(),
- svx::GraphicExporter_createInstance,
- svx::GraphicExporter_getSupportedServiceNames() );
- }
- else if ( svx::FontHeightToolBoxControl::getImplementationName_Static().equalsAscii( pImplName ) )
- {
- xFactory = createSingleFactory( reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ),
- svx::FontHeightToolBoxControl::getImplementationName_Static(),
- svx::FontHeightToolBoxControl_createInstance,
- svx::FontHeightToolBoxControl::getSupportedServiceNames_Static() );
- }
- else if ( svx::FindTextToolbarController::getImplementationName_Static().equalsAscii( pImplName ) )
- {
- xFactory = createSingleFactory( reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ),
- svx::FindTextToolbarController::getImplementationName_Static(),
- svx::FindTextToolbarController_createInstance,
- svx::FindTextToolbarController::getSupportedServiceNames_Static() );
- }
- else if ( svx::UpDownSearchToolboxController::getImplementationName_Static( svx::UpDownSearchToolboxController::DOWN ).equalsAscii( pImplName ) )
- {
- xFactory = createSingleFactory( reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ),
- svx::UpDownSearchToolboxController::getImplementationName_Static( svx::UpDownSearchToolboxController::DOWN ),
- svx::DownSearchToolboxController_createInstance,
- svx::UpDownSearchToolboxController::getSupportedServiceNames_Static() );
- }
- else if ( svx::UpDownSearchToolboxController::getImplementationName_Static( svx::UpDownSearchToolboxController::UP ).equalsAscii( pImplName ) )
- {
- xFactory = createSingleFactory( reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ),
- svx::UpDownSearchToolboxController::getImplementationName_Static( svx::UpDownSearchToolboxController::UP ),
- svx::UpSearchToolboxController_createInstance,
- svx::UpDownSearchToolboxController::getSupportedServiceNames_Static() );
- }
- else if ( svx::MatchCaseToolboxController::getImplementationName_Static().equalsAscii( pImplName ) )
- {
- xFactory = createSingleFactory( reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ),
- svx::MatchCaseToolboxController::getImplementationName_Static(),
- svx::MatchCaseToolboxController_createInstance,
- svx::MatchCaseToolboxController::getSupportedServiceNames_Static() );
- }
- else if ( svx::FindAllToolboxController::getImplementationName_Static().equalsAscii( pImplName ) )
- {
- xFactory = createSingleFactory( reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ),
- svx::FindAllToolboxController::getImplementationName_Static(),
- svx::FindAllToolboxController_createInstance,
- svx::FindAllToolboxController::getSupportedServiceNames_Static() );
- }
- else if ( svx::ExitSearchToolboxController::getImplementationName_Static().equalsAscii( pImplName ) )
- {
- xFactory = createSingleFactory( reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ),
- svx::ExitSearchToolboxController::getImplementationName_Static(),
- svx::ExitFindbarToolboxController_createInstance,
- svx::ExitSearchToolboxController::getSupportedServiceNames_Static() );
- }
- else if ( svx::FindbarDispatcher::getImplementationName_Static().equalsAscii( pImplName ) )
- {
- xFactory = createSingleFactory( reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ),
- svx::FindbarDispatcher::getImplementationName_Static(),
- svx::FindbarDispatcher_createInstance,
- svx::FindbarDispatcher::getSupportedServiceNames_Static() );
- }
- else if( ::unogallery::GalleryThemeProvider_getImplementationName().equalsAscii( pImplName ) )
- {
- xFactory = ::cppu::createSingleFactory( reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ),
- ::unogallery::GalleryThemeProvider_getImplementationName(),
- ::unogallery::GalleryThemeProvider_createInstance,
- ::unogallery::GalleryThemeProvider_getSupportedServiceNames() );
- }
- else if( drawinglayer::primitive2d::PrimitiveFactory2D::getImplementationName_Static().equalsAscii( pImplName ) )
- {
- // XPrimitiveFactory2D
- xFactory = ::cppu::createSingleFactory( reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ),
- drawinglayer::primitive2d::PrimitiveFactory2D::getImplementationName_Static(),
- drawinglayer::primitive2d::XPrimitiveFactory2DProvider_createInstance,
- drawinglayer::primitive2d::PrimitiveFactory2D::getSupportedServiceNames_Static() );
- }
- else if( ::svx::SvXMLGraphicImportHelper_getImplementationName().equalsAscii( pImplName ) )
- {
- xFactory = ::cppu::createSingleFactory(
- reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ),
- ::svx::SvXMLGraphicImportHelper_getImplementationName(),
- ::svx::SvXMLGraphicImportHelper_createInstance,
- ::svx::SvXMLGraphicImportHelper_getSupportedServiceNames() );
- }
- else if( ::svx::SvXMLGraphicExportHelper_getImplementationName().equalsAscii( pImplName ) )
- {
- xFactory = ::cppu::createSingleFactory(
- reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ),
- ::svx::SvXMLGraphicExportHelper_getImplementationName(),
- ::svx::SvXMLGraphicExportHelper_createInstance,
- ::svx::SvXMLGraphicExportHelper_getSupportedServiceNames() );
- }
- else if (::svx::sidebar::PanelFactory::getImplementationName().equalsAscii(pImplName))
- {
- xFactory = ::cppu::createSingleFactory(
- reinterpret_cast<lang::XMultiServiceFactory*>(pServiceManager),
- ::svx::sidebar::PanelFactory::getImplementationName(),
- ::svx::sidebar::PanelFactory::createInstance,
- ::svx::sidebar::PanelFactory::getSupportedServiceNames());
- }
-
- if( xFactory.is())
- {
- xFactory->acquire();
- pRet = xFactory.get();
- }
- }
-
- return pRet;
-}
-
+ assert(arguments != 0 && arguments->nElements == 0); (void) arguments;
+ css::uno::Reference<css::uno::XInterface> x(
+ static_cast<cppu::OWeakObject *>(new SvxUnoColorTable));
+ x->acquire();
+ return x.get();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */