Kaydet (Commit) a587899c authored tarafından Matúš Kukan's avatar Matúš Kukan

svt: Use constructor feature for GraphicRendererVCL.

Change-Id: Idb4cdfcdc8e06dca070bda5dd63e4291bb582e0f
üst 2fbb4715
......@@ -38,17 +38,7 @@
using namespace ::com::sun::star;
namespace unographic {
// ---------------------
// - GraphicRendererVCL -
// ---------------------
uno::Reference< uno::XInterface > SAL_CALL GraphicRendererVCL_CreateInstance( const uno::Reference< lang::XMultiServiceFactory >& )
{
return (static_cast< ::cppu::OWeakObject* >(new GraphicRendererVCL ));
}
namespace {
GraphicRendererVCL::GraphicRendererVCL() :
::comphelper::PropertySetHelper( createPropertySetInfo() ),
......@@ -65,26 +55,6 @@ GraphicRendererVCL::~GraphicRendererVCL()
// ------------------------------------------------------------------------------
OUString GraphicRendererVCL::getImplementationName_Static()
throw()
{
return OUString( "com.sun.star.comp.graphic.GraphicRendererVCL" );
}
// ------------------------------------------------------------------------------
uno::Sequence< OUString > GraphicRendererVCL::getSupportedServiceNames_Static()
throw( )
{
uno::Sequence< OUString > aSeq( 1 );
aSeq.getArray()[ 0 ] = "com.sun.star.graphic.GraphicRendererVCL";
return aSeq;
}
// ------------------------------------------------------------------------------
uno::Any SAL_CALL GraphicRendererVCL::queryAggregation( const uno::Type & rType )
throw( uno::RuntimeException )
{
......@@ -137,7 +107,7 @@ void SAL_CALL GraphicRendererVCL::release()
OUString SAL_CALL GraphicRendererVCL::getImplementationName()
throw( uno::RuntimeException )
{
return getImplementationName_Static();
return OUString( "com.sun.star.comp.graphic.GraphicRendererVCL" );
}
sal_Bool SAL_CALL GraphicRendererVCL::supportsService( const OUString& ServiceName )
......@@ -151,7 +121,9 @@ sal_Bool SAL_CALL GraphicRendererVCL::supportsService( const OUString& ServiceNa
uno::Sequence< OUString > SAL_CALL GraphicRendererVCL::getSupportedServiceNames()
throw( uno::RuntimeException )
{
return getSupportedServiceNames_Static();
uno::Sequence< OUString > aSeq( 1 );
aSeq.getArray()[ 0 ] = "com.sun.star.graphic.GraphicRendererVCL";
return aSeq;
}
// ------------------------------------------------------------------------------
......@@ -319,4 +291,16 @@ void SAL_CALL GraphicRendererVCL::render( const uno::Reference< graphic::XGraphi
}
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
com_sun_star_comp_graphic_GraphicRendererVCL_get_implementation(
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 GraphicRendererVCL));
x->acquire();
return x.get();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -29,11 +29,7 @@
class OutputDevice;
namespace unographic {
// -------------------
// - GraphicRenderer -
// -------------------
namespace {
class GraphicRendererVCL : public ::cppu::OWeakAggObject,
public ::com::sun::star::lang::XServiceInfo,
......@@ -46,9 +42,6 @@ public:
GraphicRendererVCL();
~GraphicRendererVCL() throw();
static OUString getImplementationName_Static() throw();
static ::com::sun::star::uno::Sequence< OUString > getSupportedServiceNames_Static() throw();
protected:
static ::comphelper::PropertySetInfo* createPropertySetInfo();
......
......@@ -30,7 +30,6 @@
#include "hatchwindowfactory.hxx"
#include "hatchwindow.hxx"
#include "provider.hxx"
#include "renderer.hxx"
#include "unowizard.hxx"
#include "comphelper/servicedecl.hxx"
......@@ -77,7 +76,6 @@ namespace
DECLARE_CREATEINSTANCE_NAMESPACE( svt, OAddressBookSourceDialogUno )
DECLARE_CREATEINSTANCE( SvFilterOptionsDialog )
DECLARE_CREATEINSTANCE_NAMESPACE( unographic, GraphicProvider )
DECLARE_CREATEINSTANCE_NAMESPACE( unographic, GraphicRendererVCL )
extern "C"
{
......@@ -122,13 +120,6 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL svt_component_getFactory (
GraphicProvider_CreateInstance,
GraphicProvider::getSupportedServiceNames_Static() );
}
else if( GraphicRendererVCL::getImplementationName_Static().equalsAscii( pImplementationName ) )
{
xFactory = ::cppu::createOneInstanceFactory(xSMgr,
GraphicRendererVCL::getImplementationName_Static(),
GraphicRendererVCL_CreateInstance,
GraphicRendererVCL::getSupportedServiceNames_Static() );
}
else if (rtl_str_compare (pImplementationName, "com.sun.star.comp.embed.DocumentCloser") == 0)
{
xFactory = ::cppu::createOneInstanceFactory(xSMgr,
......
......@@ -22,7 +22,8 @@
<implementation name="com.sun.star.comp.graphic.GraphicProvider">
<service name="com.sun.star.graphic.GraphicProvider"/>
</implementation>
<implementation name="com.sun.star.comp.graphic.GraphicRendererVCL">
<implementation name="com.sun.star.comp.graphic.GraphicRendererVCL"
constructor="com_sun_star_comp_graphic_GraphicRendererVCL_get_implementation">
<service name="com.sun.star.graphic.GraphicRendererVCL"/>
</implementation>
<implementation name="com.sun.star.comp.svtools.OAddressBookSourceDialogUno">
......
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