Kaydet (Commit) 84206b23 authored tarafından Chris Sherlock's avatar Chris Sherlock Kaydeden (comit) Stephan Bergmann

avmedia: use constructor syntax for avmedia.component

Change-Id: Ia4572e10fb97a5e88f08341d8a1c8af87e68904c
Signed-off-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst 4c11ac45
......@@ -142,30 +142,6 @@ OUString SoundHandler::impl_getStaticImplementationName()
return IMPLEMENTATIONNAME_SOUNDHANDLER;
}
css::uno::Reference< css::uno::XInterface > SAL_CALL SoundHandler::impl_createInstance( const css::uno::Reference< css::lang::XMultiServiceFactory >& xServiceManager ) throw( css::uno::Exception )
{
/* create new instance of service */
SoundHandler* pClass = new SoundHandler( xServiceManager );
/* hold it alive by increasing his ref count!!! */
css::uno::Reference< css::uno::XInterface > xService( static_cast< ::cppu::OWeakObject* >(pClass), css::uno::UNO_QUERY );
/* initialize new service instance ... he can use his own refcount ... we hold it! */
pClass->impl_initService();
/* return new created service as reference */
return xService;
}
css::uno::Reference< css::lang::XSingleServiceFactory > SoundHandler::impl_createFactory( const css::uno::Reference< css::lang::XMultiServiceFactory >& xServiceManager )
{
css::uno::Reference< css::lang::XSingleServiceFactory > xReturn ( cppu::createSingleFactory (
xServiceManager,
SoundHandler::impl_getStaticImplementationName(),
SoundHandler::impl_createInstance,
SoundHandler::impl_getStaticSupportedServiceNames()
)
);
return xReturn;
}
void SAL_CALL SoundHandler::impl_initService()
{
}
......@@ -379,27 +355,17 @@ IMPL_LINK_NOARG(SoundHandler, implts_PlayerNotify)
} // namespace framework
extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL avmedia_component_getFactory(const sal_Char* pImplementationName, void* pServiceManager, void* /*pRegistryKey*/ )
extern "C" SAL_DLLPUBLIC_EXPORT ::com::sun::star::uno::XInterface* SAL_CALL
com_sun_star_comp_framework_SoundHandler_get_implementation(::com::sun::star::uno::XComponentContext* context,
::com::sun::star::uno::Sequence<css::uno::Any> const &)
{
void* pReturn = NULL;
if (pServiceManager != NULL )
{
/* Define variables which are used in following macros. */
css::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory > xFactory;
css::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xServiceManager;
xServiceManager = reinterpret_cast< ::com::sun::star::lang::XMultiServiceFactory* >( pServiceManager ) ;
css::uno::Reference< css::lang::XMultiServiceFactory> xSM(context->getServiceManager(), css::uno::UNO_QUERY_THROW);
avmedia::SoundHandler* pClass = new avmedia::SoundHandler( xSM );
pClass->impl_initService();
return cppu::acquire( pClass );
}
if ( avmedia::SoundHandler::impl_getStaticImplementationName().equals( OUString::createFromAscii( pImplementationName ) ) )
xFactory = avmedia::SoundHandler::impl_createFactory( xServiceManager );
if ( xFactory.is() )
{
xFactory->acquire();
pReturn = xFactory.get();
}
}
/* Return with result of this operation. */
return pReturn;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -91,9 +91,6 @@ class SoundHandler : // interfaces
/* Helper for XServiceInfo */
static css::uno::Sequence< OUString > SAL_CALL impl_getStaticSupportedServiceNames( );
static OUString SAL_CALL impl_getStaticImplementationName ( );
/* Helper for registry */
static css::uno::Reference< css::uno::XInterface > SAL_CALL impl_createInstance ( const css::uno::Reference< css::lang::XMultiServiceFactory >& xServiceManager ) throw( css::uno::Exception );
static css::uno::Reference< css::lang::XSingleServiceFactory > SAL_CALL impl_createFactory ( const css::uno::Reference< css::lang::XMultiServiceFactory >& xServiceManager );
/* Helper for initialization of service by using own reference! */
void SAL_CALL impl_initService ( );
......
......@@ -19,7 +19,8 @@
<component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@"
prefix="avmedia" xmlns="http://openoffice.org/2010/uno-components">
<implementation name="com.sun.star.comp.framework.SoundHandler">
<implementation name="com.sun.star.comp.framework.SoundHandler"
constructor="com_sun_star_comp_framework_SoundHandler_get_implementation">
<service name="com.sun.star.frame.ContentHandler"/>
</implementation>
</component>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment