svt: Use constructor feature for GraphicProvider.
Change-Id: I0cb66814c3dcbe38a92ada0dfcc0374313784a2b
This commit is contained in:
@@ -60,10 +60,6 @@ class Graphic;
|
|||||||
|
|
||||||
namespace unographic {
|
namespace unographic {
|
||||||
|
|
||||||
// -------------------
|
|
||||||
// - GraphicProvider -
|
|
||||||
// -------------------
|
|
||||||
|
|
||||||
class GraphicDescriptor : public ::cppu::OWeakAggObject,
|
class GraphicDescriptor : public ::cppu::OWeakAggObject,
|
||||||
public ::com::sun::star::lang::XServiceInfo,
|
public ::com::sun::star::lang::XServiceInfo,
|
||||||
public ::com::sun::star::lang::XTypeProvider,
|
public ::com::sun::star::lang::XTypeProvider,
|
||||||
|
@@ -31,10 +31,6 @@ using namespace com::sun::star;
|
|||||||
|
|
||||||
namespace unographic {
|
namespace unographic {
|
||||||
|
|
||||||
// -------------------
|
|
||||||
// - GraphicProvider -
|
|
||||||
// -------------------
|
|
||||||
|
|
||||||
Graphic::Graphic() :
|
Graphic::Graphic() :
|
||||||
mpGraphic( NULL )
|
mpGraphic( NULL )
|
||||||
{
|
{
|
||||||
|
@@ -28,14 +28,8 @@
|
|||||||
#include "descriptor.hxx"
|
#include "descriptor.hxx"
|
||||||
#include "transformer.hxx"
|
#include "transformer.hxx"
|
||||||
|
|
||||||
class Graphic;
|
|
||||||
|
|
||||||
namespace unographic {
|
namespace unographic {
|
||||||
|
|
||||||
// -------------------
|
|
||||||
// - GraphicProvider -
|
|
||||||
// -------------------
|
|
||||||
|
|
||||||
class Graphic : public ::com::sun::star::graphic::XGraphic,
|
class Graphic : public ::com::sun::star::graphic::XGraphic,
|
||||||
public ::com::sun::star::awt::XBitmap,
|
public ::com::sun::star::awt::XBitmap,
|
||||||
public ::com::sun::star::lang::XUnoTunnel,
|
public ::com::sun::star::lang::XUnoTunnel,
|
||||||
|
@@ -43,19 +43,10 @@
|
|||||||
|
|
||||||
using namespace com::sun::star;
|
using namespace com::sun::star;
|
||||||
|
|
||||||
namespace unographic {
|
namespace {
|
||||||
|
|
||||||
#define UNO_NAME_GRAPHOBJ_URLPREFIX "vnd.sun.star.GraphicObject:"
|
#define UNO_NAME_GRAPHOBJ_URLPREFIX "vnd.sun.star.GraphicObject:"
|
||||||
|
|
||||||
// -------------------
|
|
||||||
// - GraphicProvider -
|
|
||||||
// -------------------
|
|
||||||
|
|
||||||
uno::Reference< uno::XInterface > SAL_CALL GraphicProvider_CreateInstance( const uno::Reference< lang::XMultiServiceFactory >& )
|
|
||||||
{
|
|
||||||
return (static_cast< ::cppu::OWeakObject* >(new GraphicProvider ));
|
|
||||||
}
|
|
||||||
|
|
||||||
GraphicProvider::GraphicProvider()
|
GraphicProvider::GraphicProvider()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -68,30 +59,10 @@ GraphicProvider::~GraphicProvider()
|
|||||||
|
|
||||||
// ------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------
|
||||||
|
|
||||||
OUString GraphicProvider::getImplementationName_Static()
|
|
||||||
throw()
|
|
||||||
{
|
|
||||||
return OUString( "com.sun.star.comp.graphic.GraphicProvider" );
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
uno::Sequence< OUString > GraphicProvider::getSupportedServiceNames_Static()
|
|
||||||
throw()
|
|
||||||
{
|
|
||||||
uno::Sequence< OUString > aSeq( 1 );
|
|
||||||
|
|
||||||
aSeq.getArray()[ 0 ] = "com.sun.star.graphic.GraphicProvider";
|
|
||||||
|
|
||||||
return aSeq;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
OUString SAL_CALL GraphicProvider::getImplementationName()
|
OUString SAL_CALL GraphicProvider::getImplementationName()
|
||||||
throw( uno::RuntimeException )
|
throw( uno::RuntimeException )
|
||||||
{
|
{
|
||||||
return getImplementationName_Static();
|
return OUString( "com.sun.star.comp.graphic.GraphicProvider" );
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------
|
||||||
@@ -114,7 +85,9 @@ sal_Bool SAL_CALL GraphicProvider::supportsService( const OUString& ServiceName
|
|||||||
uno::Sequence< OUString > SAL_CALL GraphicProvider::getSupportedServiceNames()
|
uno::Sequence< OUString > SAL_CALL GraphicProvider::getSupportedServiceNames()
|
||||||
throw( uno::RuntimeException )
|
throw( uno::RuntimeException )
|
||||||
{
|
{
|
||||||
return getSupportedServiceNames_Static();
|
uno::Sequence< OUString > aSeq( 1 );
|
||||||
|
aSeq.getArray()[ 0 ] = "com.sun.star.graphic.GraphicProvider";
|
||||||
|
return aSeq;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------
|
||||||
@@ -384,7 +357,7 @@ uno::Reference< beans::XPropertySet > SAL_CALL GraphicProvider::queryGraphicDesc
|
|||||||
|
|
||||||
if( xIStm.is() )
|
if( xIStm.is() )
|
||||||
{
|
{
|
||||||
GraphicDescriptor* pDescriptor = new GraphicDescriptor;
|
unographic::GraphicDescriptor* pDescriptor = new unographic::GraphicDescriptor;
|
||||||
pDescriptor->init( xIStm, aURL );
|
pDescriptor->init( xIStm, aURL );
|
||||||
xRet = pDescriptor;
|
xRet = pDescriptor;
|
||||||
}
|
}
|
||||||
@@ -408,7 +381,7 @@ uno::Reference< beans::XPropertySet > SAL_CALL GraphicProvider::queryGraphicDesc
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
GraphicDescriptor* pDescriptor = new GraphicDescriptor;
|
unographic::GraphicDescriptor* pDescriptor = new unographic::GraphicDescriptor;
|
||||||
pDescriptor->init( aURL );
|
pDescriptor->init( aURL );
|
||||||
xRet = pDescriptor;
|
xRet = pDescriptor;
|
||||||
}
|
}
|
||||||
@@ -898,4 +871,16 @@ void SAL_CALL GraphicProvider::storeGraphic( const uno::Reference< ::graphic::XG
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
|
||||||
|
com_sun_star_comp_graphic_GraphicProvider_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 GraphicProvider));
|
||||||
|
x->acquire();
|
||||||
|
return x.get();
|
||||||
|
}
|
||||||
|
|
||||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||||
|
@@ -25,11 +25,7 @@
|
|||||||
#include <com/sun/star/graphic/XGraphicProvider.hpp>
|
#include <com/sun/star/graphic/XGraphicProvider.hpp>
|
||||||
#include <com/sun/star/awt/XBitmap.hpp>
|
#include <com/sun/star/awt/XBitmap.hpp>
|
||||||
|
|
||||||
namespace unographic {
|
namespace {
|
||||||
|
|
||||||
// -------------------
|
|
||||||
// - GraphicProvider -
|
|
||||||
// -------------------
|
|
||||||
|
|
||||||
class GraphicProvider : public ::cppu::WeakImplHelper1< ::com::sun::star::graphic::XGraphicProvider >
|
class GraphicProvider : public ::cppu::WeakImplHelper1< ::com::sun::star::graphic::XGraphicProvider >
|
||||||
{
|
{
|
||||||
@@ -38,9 +34,6 @@ public:
|
|||||||
GraphicProvider();
|
GraphicProvider();
|
||||||
~GraphicProvider();
|
~GraphicProvider();
|
||||||
|
|
||||||
static OUString getImplementationName_Static() throw();
|
|
||||||
static ::com::sun::star::uno::Sequence< OUString > getSupportedServiceNames_Static() throw();
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// XServiceInfo
|
// XServiceInfo
|
||||||
|
@@ -28,7 +28,6 @@
|
|||||||
#include <uno/mapping.hxx>
|
#include <uno/mapping.hxx>
|
||||||
#include "documentcloser.hxx"
|
#include "documentcloser.hxx"
|
||||||
#include "hatchwindow.hxx"
|
#include "hatchwindow.hxx"
|
||||||
#include "provider.hxx"
|
|
||||||
#include "unowizard.hxx"
|
#include "unowizard.hxx"
|
||||||
|
|
||||||
#include "comphelper/servicedecl.hxx"
|
#include "comphelper/servicedecl.hxx"
|
||||||
@@ -39,7 +38,6 @@ using namespace ::com::sun::star;
|
|||||||
using namespace ::com::sun::star::uno;
|
using namespace ::com::sun::star::uno;
|
||||||
using namespace ::com::sun::star::registry;
|
using namespace ::com::sun::star::registry;
|
||||||
using namespace ::com::sun::star::lang;
|
using namespace ::com::sun::star::lang;
|
||||||
using namespace unographic;
|
|
||||||
|
|
||||||
|
|
||||||
namespace sdecl = comphelper::service_decl;
|
namespace sdecl = comphelper::service_decl;
|
||||||
@@ -74,7 +72,6 @@ namespace
|
|||||||
|
|
||||||
DECLARE_CREATEINSTANCE_NAMESPACE( svt, OAddressBookSourceDialogUno )
|
DECLARE_CREATEINSTANCE_NAMESPACE( svt, OAddressBookSourceDialogUno )
|
||||||
DECLARE_CREATEINSTANCE( SvFilterOptionsDialog )
|
DECLARE_CREATEINSTANCE( SvFilterOptionsDialog )
|
||||||
DECLARE_CREATEINSTANCE_NAMESPACE( unographic, GraphicProvider )
|
|
||||||
|
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
||||||
@@ -112,13 +109,6 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL svt_component_getFactory (
|
|||||||
SvFilterOptionsDialog_CreateInstance,
|
SvFilterOptionsDialog_CreateInstance,
|
||||||
aServiceNames);
|
aServiceNames);
|
||||||
}
|
}
|
||||||
else if( GraphicProvider::getImplementationName_Static().equalsAscii( pImplementationName ) )
|
|
||||||
{
|
|
||||||
xFactory = ::cppu::createOneInstanceFactory(xSMgr,
|
|
||||||
GraphicProvider::getImplementationName_Static(),
|
|
||||||
GraphicProvider_CreateInstance,
|
|
||||||
GraphicProvider::getSupportedServiceNames_Static() );
|
|
||||||
}
|
|
||||||
else if (rtl_str_compare (pImplementationName, "com.sun.star.comp.embed.DocumentCloser") == 0)
|
else if (rtl_str_compare (pImplementationName, "com.sun.star.comp.embed.DocumentCloser") == 0)
|
||||||
{
|
{
|
||||||
xFactory = ::cppu::createOneInstanceFactory(xSMgr,
|
xFactory = ::cppu::createOneInstanceFactory(xSMgr,
|
||||||
@@ -132,7 +122,7 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL svt_component_getFactory (
|
|||||||
pImplementationName,
|
pImplementationName,
|
||||||
static_cast<css::lang::XMultiServiceFactory *>(_pServiceManager),
|
static_cast<css::lang::XMultiServiceFactory *>(_pServiceManager),
|
||||||
static_cast<css::registry::XRegistryKey *>(pRegistryKey),
|
static_cast<css::registry::XRegistryKey *>(pRegistryKey),
|
||||||
serviceDecl );
|
unographic::serviceDecl );
|
||||||
if ( !pResult )
|
if ( !pResult )
|
||||||
pResult = cppu::component_getFactoryHelper(pImplementationName,
|
pResult = cppu::component_getFactoryHelper(pImplementationName,
|
||||||
_pServiceManager,
|
_pServiceManager,
|
||||||
|
@@ -19,7 +19,8 @@
|
|||||||
|
|
||||||
<component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@"
|
<component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@"
|
||||||
prefix="svt" xmlns="http://openoffice.org/2010/uno-components">
|
prefix="svt" xmlns="http://openoffice.org/2010/uno-components">
|
||||||
<implementation name="com.sun.star.comp.graphic.GraphicProvider">
|
<implementation name="com.sun.star.comp.graphic.GraphicProvider"
|
||||||
|
constructor="com_sun_star_comp_graphic_GraphicProvider_get_implementation">
|
||||||
<service name="com.sun.star.graphic.GraphicProvider"/>
|
<service name="com.sun.star.graphic.GraphicProvider"/>
|
||||||
</implementation>
|
</implementation>
|
||||||
<implementation name="com.sun.star.comp.graphic.GraphicRendererVCL"
|
<implementation name="com.sun.star.comp.graphic.GraphicRendererVCL"
|
||||||
|
Reference in New Issue
Block a user