summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatúš Kukan <matus.kukan@collabora.com>2013-12-30 12:37:34 +0100
committerMatúš Kukan <matus.kukan@collabora.com>2013-12-31 13:25:52 +0100
commit2978ddf60d9cc0aced1c3804cd489b47c63bcf6d (patch)
treebe70bc34e101a0fcaf8db52ec63b52713c243fbd
parente11a80d0be9db1e8cc1054d166638a99e89defea (diff)
svx: Use constructor feature for SvxShapeCollection.
Change-Id: If717b1d526e5d3e67adae4a224018b6da4bf09aa
-rw-r--r--include/svx/unoshcol.hxx3
-rw-r--r--svx/source/unodraw/unoctabl.cxx8
-rw-r--r--svx/source/unodraw/unoshcol.cxx24
-rw-r--r--svx/util/svx.component3
4 files changed, 13 insertions, 25 deletions
diff --git a/include/svx/unoshcol.hxx b/include/svx/unoshcol.hxx
index b349b5e01ea2..523313f6213b 100644
--- a/include/svx/unoshcol.hxx
+++ b/include/svx/unoshcol.hxx
@@ -81,11 +81,8 @@ public:
virtual OUString SAL_CALL getImplementationName() throw(::com::sun::star::uno::RuntimeException);
virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
- static com::sun::star::uno::Sequence< OUString > getSupportedServiceNames_Static();
- static OUString getImplementationName_Static();
};
-::com::sun::star::uno::Reference< com::sun::star::uno::XInterface > SAL_CALL SvxShapeCollection_createInstance( const com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rSMgr );
#endif
diff --git a/svx/source/unodraw/unoctabl.cxx b/svx/source/unodraw/unoctabl.cxx
index 660a0cea43f8..1c952142427a 100644
--- a/svx/source/unodraw/unoctabl.cxx
+++ b/svx/source/unodraw/unoctabl.cxx
@@ -25,7 +25,6 @@
#include "../customshapes/EnhancedCustomShapeEngine.hxx"
#include <svx/xtable.hxx>
-#include "svx/unoshcol.hxx"
using namespace ::com::sun::star;
using namespace ::rtl;
@@ -249,13 +248,6 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL svx_component_getFactory (
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() );
- }
if( xFactory.is())
{
diff --git a/svx/source/unodraw/unoshcol.cxx b/svx/source/unodraw/unoshcol.cxx
index 2850e1efb958..66b2195ed309 100644
--- a/svx/source/unodraw/unoshcol.cxx
+++ b/svx/source/unodraw/unoshcol.cxx
@@ -18,9 +18,10 @@
*/
#include <com/sun/star/document/EventObject.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
-#include "svx/unoshcol.hxx"
#include <svx/unoprov.hxx>
+#include <svx/unoshcol.hxx>
#include <cppuhelper/supportsservice.hxx>
using namespace ::cppu;
@@ -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: */
diff --git a/svx/util/svx.component b/svx/util/svx.component
index 3aedd3ae871c..da40ece83729 100644
--- a/svx/util/svx.component
+++ b/svx/util/svx.component
@@ -35,7 +35,8 @@
<implementation name="com.sun.star.drawing.EnhancedCustomShapeEngine">
<service name="com.sun.star.drawing.CustomShapeEngine"/>
</implementation>
- <implementation name="com.sun.star.drawing.SvxShapeCollection">
+ <implementation name="com.sun.star.drawing.SvxShapeCollection"
+ constructor="com_sun_star_drawing_SvxShapeCollection_implementation_getFactory">
<service name="com.sun.star.drawing.ShapeCollection"/>
</implementation>
<implementation name="com.sun.star.drawing.SvxUnoColorTable">