summaryrefslogtreecommitdiff
path: root/svx/source/unodraw
diff options
context:
space:
mode:
authorMatúš Kukan <matus.kukan@collabora.com>2013-12-17 21:59:50 +0100
committerMatúš Kukan <matus.kukan@collabora.com>2013-12-20 16:26:35 +0100
commit4a969ac35174520f1ffeb4f919f5d7bb6d99a628 (patch)
tree887738c0aeae027c1067e7c1092d5c7ef401d654 /svx/source/unodraw
parent296b1e76071698c990e726d2f7935cef9ca07fbe (diff)
svx: split into direct implementation getFactories
Change-Id: I888f10a923dc2b97247b2a66cc6bd116eee280a7
Diffstat (limited to 'svx/source/unodraw')
-rw-r--r--svx/source/unodraw/UnoGraphicExporter.cxx48
-rw-r--r--svx/source/unodraw/UnoGraphicExporter.hxx34
-rw-r--r--svx/source/unodraw/recoveryui.cxx40
-rw-r--r--svx/source/unodraw/unoctabl.cxx210
-rw-r--r--svx/source/unodraw/unoshcol.cxx24
5 files changed, 62 insertions, 294 deletions
diff --git a/svx/source/unodraw/UnoGraphicExporter.cxx b/svx/source/unodraw/UnoGraphicExporter.cxx
index 0c83a677b248..365ba925377e 100644
--- a/svx/source/unodraw/UnoGraphicExporter.cxx
+++ b/svx/source/unodraw/UnoGraphicExporter.cxx
@@ -83,15 +83,14 @@ using namespace ::com::sun::star::document;
using namespace ::com::sun::star::frame;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::task;
-#include <svx/sdr/contact/viewobjectcontactredirector.hxx>
// #i102251#
#include <editeng/editstat.hxx>
//////////////////////////////////////////////////////////////////////////////
-namespace svx
-{
+namespace {
+
struct ExportSettings
{
OUString maFilterName;
@@ -180,26 +179,6 @@ namespace svx
SdrModel* mpDoc;
};
- SVX_DLLPUBLIC Reference< XInterface > SAL_CALL GraphicExporter_createInstance(const Reference< XMultiServiceFactory > & )
- throw( Exception )
- {
- return (XWeak*)new GraphicExporter();
- }
-
- SVX_DLLPUBLIC Sequence< OUString > SAL_CALL GraphicExporter_getSupportedServiceNames()
- throw()
- {
- Sequence< OUString > aSupportedServiceNames( 1 );
- aSupportedServiceNames[0] = "com.sun.star.drawing.GraphicExportFilter";
- return aSupportedServiceNames;
- }
-
- SVX_DLLPUBLIC OUString SAL_CALL GraphicExporter_getImplementationName()
- throw()
- {
- return OUString( "com.sun.star.comp.Draw.GraphicExporter" );
- }
-
/** creates a bitmap that is optionaly transparent from a metafile
*/
BitmapEx GetBitmapFromMetaFile( const GDIMetaFile& rMtf, sal_Bool bTransparent, const Size* pSize )
@@ -300,7 +279,6 @@ namespace svx
return &aOutSize;
}
-}
class ImplExportCheckVisisbilityRedirector : public ::sdr::contact::ViewObjectContactRedirector
{
@@ -351,7 +329,7 @@ drawinglayer::primitive2d::Primitive2DSequence ImplExportCheckVisisbilityRedirec
}
}
-using namespace ::svx;
+// using namespace ::svx;
GraphicExporter::GraphicExporter()
: mpUnoPage( NULL ), mnPageNumber(-1), mpCurrentPage(0), mpDoc( NULL )
@@ -1224,7 +1202,7 @@ void SAL_CALL GraphicExporter::setSourceDocument( const Reference< lang::XCompon
OUString SAL_CALL GraphicExporter::getImplementationName( )
throw(RuntimeException)
{
- return GraphicExporter_getImplementationName();
+ return OUString( "com.sun.star.comp.Draw.GraphicExporter" );
}
sal_Bool SAL_CALL GraphicExporter::supportsService( const OUString& ServiceName )
@@ -1236,7 +1214,9 @@ sal_Bool SAL_CALL GraphicExporter::supportsService( const OUString& ServiceName
Sequence< OUString > SAL_CALL GraphicExporter::getSupportedServiceNames( )
throw(RuntimeException)
{
- return GraphicExporter_getSupportedServiceNames();
+ Sequence< OUString > aSupportedServiceNames( 1 );
+ aSupportedServiceNames[0] = "com.sun.star.drawing.GraphicExportFilter";
+ return aSupportedServiceNames;
}
// XMimeTypeInfo
@@ -1284,6 +1264,8 @@ Sequence< OUString > SAL_CALL GraphicExporter::getSupportedMimeTypeNames( ) thr
return aSeq;
}
+}
+
Graphic SvxGetGraphicForShape( SdrObject& rShape, bool bVector )
{
Graphic aGraphic;
@@ -1302,4 +1284,16 @@ Graphic SvxGetGraphicForShape( SdrObject& rShape, bool bVector )
return aGraphic;
}
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
+com_sun_star_comp_Draw_GraphicExporter_implementation_getFactory(
+ SAL_UNUSED_PARAMETER css::uno::XComponentContext *,
+ uno_Sequence * arguments)
+{
+ assert(arguments != 0 && arguments->nElements == 0); (void) arguments;
+ css::uno::Reference<css::uno::XInterface> x(
+ static_cast<cppu::OWeakObject *>(new GraphicExporter));
+ x->acquire();
+ return x.get();
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/unodraw/UnoGraphicExporter.hxx b/svx/source/unodraw/UnoGraphicExporter.hxx
deleted file mode 100644
index 864ad2158e67..000000000000
--- a/svx/source/unodraw/UnoGraphicExporter.hxx
+++ /dev/null
@@ -1,34 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#ifndef INCLUDED_SVX_SOURCE_UNODRAW_UNOGRAPHICEXPORTER_HXX
-#define INCLUDED_SVX_SOURCE_UNODRAW_UNOGRAPHICEXPORTER_HXX
-
-#include <com/sun/star/uno/XInterface.hpp>
-
-namespace svx
-{
- SVX_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL GraphicExporter_createInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & rSMgr) throw( ::com::sun::star::uno::Exception );
- SVX_DLLPUBLIC ::com::sun::star::uno::Sequence< OUString > SAL_CALL GraphicExporter_getSupportedServiceNames() throw();
- SVX_DLLPUBLIC OUString SAL_CALL GraphicExporter_getImplementationName() throw();
-}
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/unodraw/recoveryui.cxx b/svx/source/unodraw/recoveryui.cxx
index 986afe7d8695..d0c83dcfe6a5 100644
--- a/svx/source/unodraw/recoveryui.cxx
+++ b/svx/source/unodraw/recoveryui.cxx
@@ -35,8 +35,7 @@
#include <boost/scoped_ptr.hpp>
#include <officecfg/Office/Recovery.hxx>
-namespace svx
-{
+namespace {
namespace svxdr = ::svx::DocRecovery;
@@ -57,7 +56,7 @@ RecoveryUI::~RecoveryUI()
OUString SAL_CALL RecoveryUI::getImplementationName()
throw(css::uno::RuntimeException)
{
- return RecoveryUI::st_getImplementationName();
+ return OUString("com.sun.star.comp.svx.RecoveryUI");
}
sal_Bool SAL_CALL RecoveryUI::supportsService(const OUString& sServiceName)
@@ -69,7 +68,9 @@ sal_Bool SAL_CALL RecoveryUI::supportsService(const OUString& sServiceName)
css::uno::Sequence< OUString > SAL_CALL RecoveryUI::getSupportedServiceNames()
throw(css::uno::RuntimeException)
{
- return RecoveryUI::st_getSupportedServiceNames();
+ css::uno::Sequence< OUString > lServiceNames(1);
+ lServiceNames[0] = "com.sun.star.dialog.RecoveryUI";
+ return lServiceNames;
}
css::uno::Any SAL_CALL RecoveryUI::dispatchWithReturnValue(const css::util::URL& aURL,
@@ -132,24 +133,6 @@ void SAL_CALL RecoveryUI::removeStatusListener(const css::uno::Reference< css::f
OSL_FAIL("RecoveryUI::removeStatusListener()\nNot implemented yet!");
}
-OUString RecoveryUI::st_getImplementationName()
-{
- return OUString("com.sun.star.comp.svx.RecoveryUI");
-}
-
-css::uno::Sequence< OUString > RecoveryUI::st_getSupportedServiceNames()
-{
- css::uno::Sequence< OUString > lServiceNames(1);
- lServiceNames[0] = "com.sun.star.dialog.RecoveryUI";
- return lServiceNames;
-}
-
-css::uno::Reference< css::uno::XInterface > SAL_CALL RecoveryUI::st_createInstance(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR)
-{
- RecoveryUI* pNew = new RecoveryUI(comphelper::getComponentContext(xSMGR));
- return css::uno::Reference< css::uno::XInterface >(static_cast< css::lang::XServiceInfo* >(pNew));
-}
-
static OUString GetCrashConfigDir()
{
@@ -342,6 +325,17 @@ void RecoveryUI::impl_showAllRecoveredDocs()
}
}
-} // namespace svx
+}
+
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
+com_sun_star_comp_svx_RecoveryUI_implementation_getFactory(
+ css::uno::XComponentContext *context, uno_Sequence * arguments)
+{
+ assert(arguments != 0 && arguments->nElements == 0); (void) arguments;
+ css::uno::Reference<css::uno::XInterface> x(
+ static_cast<cppu::OWeakObject *>(new RecoveryUI(context)));
+ x->acquire();
+ return x.get();
+}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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: */
diff --git a/svx/source/unodraw/unoshcol.cxx b/svx/source/unodraw/unoshcol.cxx
index 2850e1efb958..7e77015129ef 100644
--- a/svx/source/unodraw/unoshcol.cxx
+++ b/svx/source/unodraw/unoshcol.cxx
@@ -18,8 +18,9 @@
*/
#include <com/sun/star/document/EventObject.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
-#include "svx/unoshcol.hxx"
+#include <svx/unoshcol.hxx>
#include <svx/unoprov.hxx>
#include <cppuhelper/supportsservice.hxx>
@@ -210,11 +211,6 @@ sal_Bool SAL_CALL SvxShapeCollection::hasElements() throw( uno::RuntimeException
OUString SAL_CALL SvxShapeCollection::getImplementationName()
throw( uno::RuntimeException )
{
- return getImplementationName_Static();
-}
-
-OUString SvxShapeCollection::getImplementationName_Static()
-{
return OUString("com.sun.star.drawing.SvxShapeCollection");
}
@@ -226,20 +222,22 @@ sal_Bool SAL_CALL SvxShapeCollection::supportsService( const OUString& ServiceNa
uno::Sequence< OUString > SAL_CALL SvxShapeCollection::getSupportedServiceNames() throw( uno::RuntimeException )
{
- return getSupportedServiceNames_Static();
-}
-
-uno::Sequence< OUString > SvxShapeCollection::getSupportedServiceNames_Static()
-{
uno::Sequence< OUString > aSeq(2);
aSeq.getArray()[0] = "com.sun.star.drawing.Shapes";
aSeq.getArray()[1] = "com.sun.star.drawing.ShapeCollection";
return aSeq;
}
-Reference< XInterface > SAL_CALL SvxShapeCollection_createInstance( const Reference< ::com::sun::star::lang::XMultiServiceFactory >& )
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
+com_sun_star_drawing_SvxShapeCollection_implementation_getFactory(
+ SAL_UNUSED_PARAMETER css::uno::XComponentContext *,
+ uno_Sequence * arguments)
{
- return *( new SvxShapeCollection() );
+ assert(arguments != 0 && arguments->nElements == 0); (void) arguments;
+ css::uno::Reference<css::uno::XInterface> x(
+ static_cast<cppu::OWeakObject *>(new SvxShapeCollection));
+ x->acquire();
+ return x.get();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */