From 4a969ac35174520f1ffeb4f919f5d7bb6d99a628 Mon Sep 17 00:00:00 2001 From: Matúš Kukan Date: Tue, 17 Dec 2013 21:59:50 +0100 Subject: svx: split into direct implementation getFactories Change-Id: I888f10a923dc2b97247b2a66cc6bd116eee280a7 --- svx/source/unodraw/UnoGraphicExporter.cxx | 48 ++++++++++++++----------------- 1 file changed, 21 insertions(+), 27 deletions(-) (limited to 'svx/source/unodraw/UnoGraphicExporter.cxx') 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 // #i102251# #include ////////////////////////////////////////////////////////////////////////////// -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 x( + static_cast(new GraphicExporter)); + x->acquire(); + return x.get(); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit v1.2.3