diff options
author | Marcos Paulo de Souza <marcos.souza.org@gmail.com> | 2014-01-14 13:09:33 -0200 |
---|---|---|
committer | Matúš Kukan <matus.kukan@collabora.com> | 2014-01-16 10:26:04 +0100 |
commit | eeeefd6fd87b3cff18ba9078869bdfcd0e351d6f (patch) | |
tree | 3074028ba5615b40c092ee51b3b5e2cb26cadb89 /filter/source | |
parent | ccf47bd943bf8d09e60fd3310ba31d550e744765 (diff) |
fdo#54938: Convert filter to cppu::supportsService
final part
Change-Id: If9387b4f7aa8ca694092f51eabeac096c71347eb
Diffstat (limited to 'filter/source')
-rw-r--r-- | filter/source/config/cache/configflush.cxx | 20 | ||||
-rw-r--r-- | filter/source/config/cache/configflush.hxx | 7 | ||||
-rw-r--r-- | filter/source/flash/swffilter.cxx | 30 | ||||
-rw-r--r-- | filter/source/pdf/pdffilter.cxx | 31 | ||||
-rw-r--r-- | filter/source/pdf/pdfinteract.cxx | 35 | ||||
-rw-r--r-- | filter/source/placeware/filter.cxx | 28 | ||||
-rw-r--r-- | filter/source/t602/t602filter.cxx | 38 | ||||
-rw-r--r-- | filter/source/textfilterdetect/filterdetect.cxx | 9 | ||||
-rw-r--r-- | filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx | 19 | ||||
-rw-r--r-- | filter/source/xmlfilterdetect/filterdetect.cxx | 7 | ||||
-rw-r--r-- | filter/source/xsltdialog/xmlfilterdialogcomponent.cxx | 27 |
11 files changed, 42 insertions, 209 deletions
diff --git a/filter/source/config/cache/configflush.cxx b/filter/source/config/cache/configflush.cxx index 4ccdb10c13e6..d9715a1ee68c 100644 --- a/filter/source/config/cache/configflush.cxx +++ b/filter/source/config/cache/configflush.cxx @@ -17,18 +17,15 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ - #include "configflush.hxx" #include "constant.hxx" +#include <cppuhelper/supportsservice.hxx> #include <osl/diagnose.h> - namespace filter{ namespace config{ - -//----------------------------------------------- ConfigFlush::ConfigFlush(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR) : BaseLock ( ) , m_xSMGR (xSMGR ) @@ -36,12 +33,10 @@ ConfigFlush::ConfigFlush(const css::uno::Reference< css::lang::XMultiServiceFact { } -//----------------------------------------------- ConfigFlush::~ConfigFlush() { } -//----------------------------------------------- OUString SAL_CALL ConfigFlush::getImplementationName() throw (css::uno::RuntimeException) { @@ -49,29 +44,18 @@ OUString SAL_CALL ConfigFlush::getImplementationName() // <- SAFE } -//----------------------------------------------- sal_Bool SAL_CALL ConfigFlush::supportsService(const OUString& sServiceName) throw (css::uno::RuntimeException) { - css::uno::Sequence< OUString > lServiceNames = impl_getSupportedServiceNames(); - sal_Int32 c = lServiceNames.getLength(); - const OUString* pNames = lServiceNames.getConstArray(); - for (sal_Int32 i=0; i<c; ++i) - { - if (pNames[i].equals(sServiceName)) - return sal_True; - } - return sal_False; + return cppu::supportsService(this, sServiceName); } -//----------------------------------------------- css::uno::Sequence< OUString > SAL_CALL ConfigFlush::getSupportedServiceNames() throw (css::uno::RuntimeException) { return impl_getSupportedServiceNames(); } -//----------------------------------------------- void SAL_CALL ConfigFlush::refresh() throw(css::uno::RuntimeException) { diff --git a/filter/source/config/cache/configflush.hxx b/filter/source/config/cache/configflush.hxx index 664d979fb608..7fa9f98de3e4 100644 --- a/filter/source/config/cache/configflush.hxx +++ b/filter/source/config/cache/configflush.hxx @@ -23,7 +23,7 @@ #include <com/sun/star/util/XRefreshable.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> #include <cppuhelper/interfacecontainer.h> -#include <cppuhelper/implbase1.hxx> +#include <cppuhelper/implbase2.hxx> namespace filter{ @@ -39,7 +39,10 @@ namespace filter{ type/filter configuration will be changed at runtime. */ class ConfigFlush : public BaseLock - , public ::cppu::WeakImplHelper1< css::util::XRefreshable > + , public ::cppu::WeakImplHelper2< + css::util::XRefreshable, + css::lang::XServiceInfo + > { //------------------------------------------- // member diff --git a/filter/source/flash/swffilter.cxx b/filter/source/flash/swffilter.cxx index 4d0ace89759d..54ea4efd9a48 100644 --- a/filter/source/flash/swffilter.cxx +++ b/filter/source/flash/swffilter.cxx @@ -31,6 +31,7 @@ #include <com/sun/star/io/XOutputStream.hpp> #include <cppuhelper/implbase1.hxx> #include <cppuhelper/implbase4.hxx> +#include <cppuhelper/supportsservice.hxx> #include <comphelper/processfactory.hxx> #include <osl/file.hxx> @@ -448,37 +449,20 @@ void SAL_CALL FlashExportFilter::initialize( const ::com::sun::star::uno::Sequen { } -// ----------------------------------------------------------------------------- - OUString FlashExportFilter_getImplementationName () throw (RuntimeException) { return OUString ( "com.sun.star.comp.Impress.FlashExportFilter" ); } -// ----------------------------------------------------------------------------- - -#define SERVICE_NAME "com.sun.star.document.ExportFilter" - -sal_Bool SAL_CALL FlashExportFilter_supportsService( const OUString& ServiceName ) - throw (RuntimeException) -{ - return ServiceName == SERVICE_NAME; -} - -// ----------------------------------------------------------------------------- - Sequence< OUString > SAL_CALL FlashExportFilter_getSupportedServiceNames( ) throw (RuntimeException) { Sequence < OUString > aRet(1); OUString* pArray = aRet.getArray(); - pArray[0] = OUString ( SERVICE_NAME ); + pArray[0] = "com.sun.star.document.ExportFilter"; return aRet; } -#undef SERVICE_NAME - -// ----------------------------------------------------------------------------- Reference< XInterface > SAL_CALL FlashExportFilter_createInstance( const Reference< XMultiServiceFactory > & rSMgr) throw( Exception ) @@ -486,8 +470,6 @@ Reference< XInterface > SAL_CALL FlashExportFilter_createInstance( const Referen return (cppu::OWeakObject*) new FlashExportFilter( comphelper::getComponentContext(rSMgr) ); } -// ----------------------------------------------------------------------------- - // XServiceInfo OUString SAL_CALL FlashExportFilter::getImplementationName( ) throw (RuntimeException) @@ -495,24 +477,18 @@ OUString SAL_CALL FlashExportFilter::getImplementationName( ) return FlashExportFilter_getImplementationName(); } -// ----------------------------------------------------------------------------- - sal_Bool SAL_CALL FlashExportFilter::supportsService( const OUString& rServiceName ) throw (RuntimeException) { - return FlashExportFilter_supportsService( rServiceName ); + return cppu::supportsService( this, rServiceName ); } -// ----------------------------------------------------------------------------- - ::com::sun::star::uno::Sequence< OUString > SAL_CALL FlashExportFilter::getSupportedServiceNames( ) throw (RuntimeException) { return FlashExportFilter_getSupportedServiceNames(); } -// ----------------------------------------------------------------------------- - } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/filter/source/pdf/pdffilter.cxx b/filter/source/pdf/pdffilter.cxx index 092cad6a3f26..2db9df8ac26e 100644 --- a/filter/source/pdf/pdffilter.cxx +++ b/filter/source/pdf/pdffilter.cxx @@ -17,31 +17,24 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ - #include "pdffilter.hxx" #include "pdfexport.hxx" +#include <cppuhelper/supportsservice.hxx> #include <vcl/svapp.hxx> #include <vcl/window.hxx> #include <svl/outstrm.hxx> #include <vcl/FilterConfigItem.hxx> -// ------------- // - PDFFilter - -// ------------- - PDFFilter::PDFFilter( const Reference< XComponentContext > &rxContext ) : mxContext( rxContext ) { } -// ----------------------------------------------------------------------------- - PDFFilter::~PDFFilter() { } -// ----------------------------------------------------------------------------- - sal_Bool PDFFilter::implExport( const Sequence< PropertyValue >& rDescriptor ) { Reference< XOutputStream > xOStm; @@ -200,38 +193,20 @@ void SAL_CALL PDFFilter::initialize( const ::com::sun::star::uno::Sequence< ::co { } -// ----------------------------------------------------------------------------- - OUString PDFFilter_getImplementationName () throw (RuntimeException) { return OUString ( "com.sun.star.comp.PDF.PDFFilter" ); } -// ----------------------------------------------------------------------------- - -#define SERVICE_NAME "com.sun.star.document.PDFFilter" - -sal_Bool SAL_CALL PDFFilter_supportsService( const OUString& ServiceName ) - throw (RuntimeException) -{ - return ServiceName == SERVICE_NAME; -} - -// ----------------------------------------------------------------------------- - Sequence< OUString > SAL_CALL PDFFilter_getSupportedServiceNames( ) throw (RuntimeException) { Sequence < OUString > aRet(1); OUString* pArray = aRet.getArray(); - pArray[0] = SERVICE_NAME; + pArray[0] = "com.sun.star.document.PDFFilter"; return aRet; } -#undef SERVICE_NAME - -// ----------------------------------------------------------------------------- - Reference< XInterface > SAL_CALL PDFFilter_createInstance( const Reference< XMultiServiceFactory > & rSMgr) throw( Exception ) { return (cppu::OWeakObject*) new PDFFilter( comphelper::getComponentContext(rSMgr) ); @@ -250,7 +225,7 @@ OUString SAL_CALL PDFFilter::getImplementationName() sal_Bool SAL_CALL PDFFilter::supportsService( const OUString& rServiceName ) throw (RuntimeException) { - return PDFFilter_supportsService( rServiceName ); + return cppu::supportsService( this, rServiceName ); } // ----------------------------------------------------------------------------- diff --git a/filter/source/pdf/pdfinteract.cxx b/filter/source/pdf/pdfinteract.cxx index 9898f77d4864..13b3cd50d46e 100644 --- a/filter/source/pdf/pdfinteract.cxx +++ b/filter/source/pdf/pdfinteract.cxx @@ -23,22 +23,17 @@ #include "com/sun/star/task/XInteractionRequest.hpp" #include "com/sun/star/task/PDFExportException.hpp" +#include <cppuhelper/supportsservice.hxx> -// ------------- // - PDFInteractionHandler - -// ------------- - PDFInteractionHandler::PDFInteractionHandler() { } -// ----------------------------------------------------------------------------- - PDFInteractionHandler::~PDFInteractionHandler() { } - void SAL_CALL PDFInteractionHandler::handle( const Reference< task::XInteractionRequest >& i_xRequest ) throw (RuntimeException) { @@ -65,61 +60,37 @@ sal_Bool SAL_CALL PDFInteractionHandler::handleInteractionRequest( const Referen return bHandled; } -// ----------------------------------------------------------------------------- - OUString PDFInteractionHandler_getImplementationName () throw (RuntimeException) { return OUString ( "com.sun.star.comp.PDF.PDFExportInteractionHandler" ); } -// ----------------------------------------------------------------------------- - -#define SERVICE_NAME "com.sun.star.filter.pdfexport.PDFExportInteractionHandler" - -sal_Bool SAL_CALL PDFInteractionHandler_supportsService( const OUString& ServiceName ) - throw (RuntimeException) -{ - return ServiceName == SERVICE_NAME; -} - -// ----------------------------------------------------------------------------- - Sequence< OUString > SAL_CALL PDFInteractionHandler_getSupportedServiceNames( ) throw (RuntimeException) { Sequence < OUString > aRet(1); OUString* pArray = aRet.getArray(); - pArray[0] = SERVICE_NAME; + pArray[0] = "com.sun.star.filter.pdfexport.PDFExportInteractionHandler"; return aRet; } -#undef SERVICE_NAME - -// ----------------------------------------------------------------------------- - Reference< XInterface > SAL_CALL PDFInteractionHandler_createInstance( const Reference< XMultiServiceFactory > & ) throw( Exception ) { return (cppu::OWeakObject*) new PDFInteractionHandler; } -// ----------------------------------------------------------------------------- - OUString SAL_CALL PDFInteractionHandler::getImplementationName() throw (RuntimeException) { return PDFInteractionHandler_getImplementationName(); } -// ----------------------------------------------------------------------------- - sal_Bool SAL_CALL PDFInteractionHandler::supportsService( const OUString& rServiceName ) throw (RuntimeException) { - return PDFInteractionHandler_supportsService( rServiceName ); + return cppu::supportsService( this, rServiceName ); } -// ----------------------------------------------------------------------------- - ::com::sun::star::uno::Sequence< OUString > SAL_CALL PDFInteractionHandler::getSupportedServiceNames( ) throw (RuntimeException) { return PDFInteractionHandler_getSupportedServiceNames(); diff --git a/filter/source/placeware/filter.cxx b/filter/source/placeware/filter.cxx index b2f7c98e905a..9077bcb44777 100644 --- a/filter/source/placeware/filter.cxx +++ b/filter/source/placeware/filter.cxx @@ -22,6 +22,7 @@ #include <com/sun/star/lang/XInitialization.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> #include <cppuhelper/implbase4.hxx> +#include <cppuhelper/supportsservice.hxx> #include <comphelper/processfactory.hxx> #include "exporter.hxx" @@ -139,37 +140,20 @@ void SAL_CALL PlaceWareExportFilter::initialize( const ::com::sun::star::uno::Se { } -// ----------------------------------------------------------------------------- - OUString PlaceWareExportFilter_getImplementationName () throw (RuntimeException) { return OUString( "com.sun.star.comp.Impress.PlaceWareExportFilter" ); } -// ----------------------------------------------------------------------------- - -#define SERVICE_NAME "com.sun.star.document.ExportFilter" - -sal_Bool SAL_CALL PlaceWareExportFilter_supportsService( const OUString& ServiceName ) - throw (RuntimeException) -{ - return ServiceName == SERVICE_NAME; -} - -// ----------------------------------------------------------------------------- - Sequence< OUString > SAL_CALL PlaceWareExportFilter_getSupportedServiceNames( ) throw (RuntimeException) { Sequence < OUString > aRet(1); OUString* pArray = aRet.getArray(); - pArray[0] = OUString ( SERVICE_NAME ); + pArray[0] = "com.sun.star.document.ExportFilter"; return aRet; } -#undef SERVICE_NAME - -// ----------------------------------------------------------------------------- Reference< XInterface > SAL_CALL PlaceWareExportFilter_createInstance( const Reference< XMultiServiceFactory > & rSMgr) throw( Exception ) @@ -177,8 +161,6 @@ Reference< XInterface > SAL_CALL PlaceWareExportFilter_createInstance( const Ref return (cppu::OWeakObject*) new PlaceWareExportFilter( comphelper::getComponentContext(rSMgr) ); } -// ----------------------------------------------------------------------------- - // XServiceInfo OUString SAL_CALL PlaceWareExportFilter::getImplementationName( ) throw (RuntimeException) @@ -186,16 +168,12 @@ OUString SAL_CALL PlaceWareExportFilter::getImplementationName( ) return PlaceWareExportFilter_getImplementationName(); } -// ----------------------------------------------------------------------------- - sal_Bool SAL_CALL PlaceWareExportFilter::supportsService( const OUString& rServiceName ) throw (RuntimeException) { - return PlaceWareExportFilter_supportsService( rServiceName ); + return cppu::supportsService( this, rServiceName ); } -// ----------------------------------------------------------------------------- - ::com::sun::star::uno::Sequence< OUString > SAL_CALL PlaceWareExportFilter::getSupportedServiceNames( ) throw (RuntimeException) { diff --git a/filter/source/t602/t602filter.cxx b/filter/source/t602/t602filter.cxx index a5c3842d2732..bdfbe4ffdf23 100644 --- a/filter/source/t602/t602filter.cxx +++ b/filter/source/t602/t602filter.cxx @@ -25,6 +25,7 @@ #include <cppuhelper/factory.hxx> #include <cppuhelper/bootstrap.hxx> +#include <cppuhelper/supportsservice.hxx> #include <com/sun/star/awt/Toolkit.hpp> #include <com/sun/star/bridge/XUnoUrlResolver.hpp> #include <com/sun/star/beans/XPropertySet.hpp> @@ -849,7 +850,7 @@ OUString SAL_CALL T602ImportFilter::getImplementationName( ) sal_Bool SAL_CALL T602ImportFilter::supportsService( const OUString& rServiceName ) throw (RuntimeException) { - return T602ImportFilter_supportsService( rServiceName ); + return cppu::supportsService( this, rServiceName ); } Sequence< OUString > SAL_CALL T602ImportFilter::getSupportedServiceNames( ) @@ -858,20 +859,10 @@ Sequence< OUString > SAL_CALL T602ImportFilter::getSupportedServiceNames( ) return T602ImportFilter_getSupportedServiceNames(); } -#define IMPLEMENTATION_NAME "com.sun.star.comp.Writer.T602ImportFilter" - OUString T602ImportFilter_getImplementationName () throw (RuntimeException) { - return OUString ( IMPLEMENTATION_NAME ); -} - -#define SERVICE_NAME1 "com.sun.star.document.ImportFilter" -#define SERVICE_NAME2 "com.sun.star.document.ExtendedTypeDetection" -sal_Bool SAL_CALL T602ImportFilter_supportsService( const OUString& ServiceName ) - throw (RuntimeException) -{ - return ( ServiceName == SERVICE_NAME1 || ServiceName == SERVICE_NAME2 ); + return OUString ( "com.sun.star.comp.Writer.T602ImportFilter" ); } Sequence< OUString > SAL_CALL T602ImportFilter_getSupportedServiceNames( ) @@ -879,13 +870,10 @@ Sequence< OUString > SAL_CALL T602ImportFilter_getSupportedServiceNames( ) { Sequence < OUString > aRet(2); OUString* pArray = aRet.getArray(); - pArray[0] = OUString ( SERVICE_NAME1 ); - pArray[1] = OUString ( SERVICE_NAME2 ); + pArray[0] = "com.sun.star.document.ImportFilter"; + pArray[1] = "com.sun.star.document.ExtendedTypeDetection"; return aRet; } -#undef SERVICE_NAME2 -#undef SERVICE_NAME1 -#undef IMPLEMENTATION_NAME Reference< XInterface > SAL_CALL T602ImportFilter_createInstance( const Reference< XMultiServiceFactory > & rSMgr) throw( Exception ) @@ -1155,7 +1143,7 @@ OUString SAL_CALL T602ImportFilterDialog::getImplementationName( ) sal_Bool SAL_CALL T602ImportFilterDialog::supportsService( const OUString& rServiceName ) throw (RuntimeException) { - return T602ImportFilterDialog_supportsService( rServiceName ); + return cppu::supportsService( this, rServiceName ); } Sequence< OUString > SAL_CALL T602ImportFilterDialog::getSupportedServiceNames( ) @@ -1164,19 +1152,10 @@ Sequence< OUString > SAL_CALL T602ImportFilterDialog::getSupportedServiceNames( return T602ImportFilterDialog_getSupportedServiceNames(); } -#define IMPLEMENTATION_NAME "com.sun.star.comp.Writer.T602ImportFilterDialog" - OUString T602ImportFilterDialog_getImplementationName () throw (RuntimeException) { - return OUString ( IMPLEMENTATION_NAME ); -} - -#define SERVICE_NAME "com.sun.star.ui.dialogs.FilterOptionsDialog" -sal_Bool SAL_CALL T602ImportFilterDialog_supportsService( const OUString& ServiceName ) - throw (RuntimeException) -{ - return ServiceName == SERVICE_NAME; + return OUString ( "com.sun.star.comp.Writer.T602ImportFilterDialog" ); } Sequence< OUString > SAL_CALL T602ImportFilterDialog_getSupportedServiceNames( ) @@ -1184,10 +1163,9 @@ Sequence< OUString > SAL_CALL T602ImportFilterDialog_getSupportedServiceNames( { Sequence < OUString > aRet(1); OUString* pArray = aRet.getArray(); - pArray[0] = OUString ( SERVICE_NAME ); + pArray[0] = "com.sun.star.ui.dialogs.FilterOptionsDialog"; return aRet; } -#undef SERVICE_NAME Reference< XInterface > SAL_CALL T602ImportFilterDialog_createInstance( const Reference< XMultiServiceFactory > & rSMgr) throw( Exception ) diff --git a/filter/source/textfilterdetect/filterdetect.cxx b/filter/source/textfilterdetect/filterdetect.cxx index deaeecd8dcf1..affcf340a0dd 100644 --- a/filter/source/textfilterdetect/filterdetect.cxx +++ b/filter/source/textfilterdetect/filterdetect.cxx @@ -14,6 +14,7 @@ #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/io/XInputStream.hpp> +#include <cppuhelper/supportsservice.hxx> #define WRITER_TEXT_FILTER "Text" #define CALC_TEXT_FILTER "Text - txt - csv (StarCalc)" @@ -118,12 +119,6 @@ OUString PlainTextFilterDetect_getImplementationName() return OUString("com.sun.star.comp.filters.PlainTextFilterDetect"); } -sal_Bool PlainTextFilterDetect_supportsService(const OUString& ServiceName) -{ - return ServiceName == "com.sun.star.document.ExtendedTypeDetection" || - ServiceName == "com.sun.star.comp.filters.PlainTextFilterDetect"; -} - uno::Sequence<OUString> PlainTextFilterDetect_getSupportedServiceNames() { uno::Sequence<OUString> aRet(2); @@ -149,7 +144,7 @@ OUString SAL_CALL PlainTextFilterDetect::getImplementationName() sal_Bool SAL_CALL PlainTextFilterDetect::supportsService(const OUString& rServiceName) throw (uno::RuntimeException) { - return PlainTextFilterDetect_supportsService(rServiceName); + return cppu::supportsService(this, rServiceName); } uno::Sequence<OUString> SAL_CALL PlainTextFilterDetect::getSupportedServiceNames() diff --git a/filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx b/filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx index 539f7462bcff..465cdcc3f0bd 100644 --- a/filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx +++ b/filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx @@ -48,6 +48,7 @@ #include <com/sun/star/beans/PropertyAttribute.hpp> #include <comphelper/genericpropertyset.hxx> #include <comphelper/propertysetinfo.hxx> +#include <cppuhelper/supportsservice.hxx> #include <unotools/pathoptions.hxx> using namespace comphelper; @@ -354,24 +355,16 @@ OUString XmlFilterAdaptor_getImplementationName () { return OUString( "com.sun.star.comp.Writer.XmlFilterAdaptor" ); } -#define SERVICE_NAME1 "com.sun.star.document.ExportFilter" -#define SERVICE_NAME2 "com.sun.star.document.ImportFilter" -sal_Bool SAL_CALL XmlFilterAdaptor_supportsService( const OUString& ServiceName ) - throw (RuntimeException) -{ - return ServiceName == SERVICE_NAME1 || ServiceName == SERVICE_NAME2; -} + Sequence< OUString > SAL_CALL XmlFilterAdaptor_getSupportedServiceNames( ) throw (RuntimeException) { Sequence < OUString > aRet(2); OUString* pArray = aRet.getArray(); - pArray[0] = OUString ( SERVICE_NAME1 ); - pArray[1] = OUString ( SERVICE_NAME2 ); + pArray[0] = "com.sun.star.document.ExportFilter"; + pArray[1] = "com.sun.star.document.ImportFilter"; return aRet; } -#undef SERVICE_NAME1 -#undef SERVICE_NAME2 Reference< XInterface > SAL_CALL XmlFilterAdaptor_createInstance( const Reference< XMultiServiceFactory > & rSMgr) throw( Exception ) @@ -385,11 +378,13 @@ OUString SAL_CALL XmlFilterAdaptor::getImplementationName( ) { return XmlFilterAdaptor_getImplementationName(); } + sal_Bool SAL_CALL XmlFilterAdaptor::supportsService( const OUString& rServiceName ) throw (RuntimeException) { - return XmlFilterAdaptor_supportsService( rServiceName ); + return cppu::supportsService( this, rServiceName ); } + Sequence< OUString > SAL_CALL XmlFilterAdaptor::getSupportedServiceNames( ) throw (RuntimeException) { diff --git a/filter/source/xmlfilterdetect/filterdetect.cxx b/filter/source/xmlfilterdetect/filterdetect.cxx index c409d8227cc4..ce48dfb75f4d 100644 --- a/filter/source/xmlfilterdetect/filterdetect.cxx +++ b/filter/source/xmlfilterdetect/filterdetect.cxx @@ -41,6 +41,7 @@ #include <com/sun/star/document/XExtendedFilterDetection.hpp> #include <com/sun/star/container/XNameAccess.hpp> #include <com/sun/star/beans/PropertyState.hpp> +#include <cppuhelper/supportsservice.hxx> #include <ucbhelper/content.hxx> #include <unotools/ucbstreamhelper.hxx> #include <boost/scoped_ptr.hpp> @@ -248,12 +249,11 @@ OUString FilterDetect_getImplementationName () { return OUString( "com.sun.star.comp.filters.XMLFilterDetect" ); } -#define SERVICE_NAME1 "com.sun.star.document.ExtendedTypeDetection" Sequence< OUString > FilterDetect_getSupportedServiceNames() { Sequence < OUString > aRet(1); - aRet[0] = SERVICE_NAME1; + aRet[0] = "com.sun.star.document.ExtendedTypeDetection"; return aRet; } @@ -271,8 +271,9 @@ OUString SAL_CALL FilterDetect::getImplementationName( ) sal_Bool SAL_CALL FilterDetect::supportsService( const OUString& rServiceName ) throw (RuntimeException) { - return rServiceName == SERVICE_NAME1; + return cppu::supportsService( this, rServiceName ); } + Sequence< OUString > SAL_CALL FilterDetect::getSupportedServiceNames( ) throw (RuntimeException) { diff --git a/filter/source/xsltdialog/xmlfilterdialogcomponent.cxx b/filter/source/xsltdialog/xmlfilterdialogcomponent.cxx index 4fe62c9339a5..1edb72cc0d73 100644 --- a/filter/source/xsltdialog/xmlfilterdialogcomponent.cxx +++ b/filter/source/xsltdialog/xmlfilterdialogcomponent.cxx @@ -28,6 +28,7 @@ #include <com/sun/star/frame/Desktop.hpp> #include <com/sun/star/frame/XTerminateListener.hpp> #include <cppuhelper/implbase4.hxx> +#include <cppuhelper/supportsservice.hxx> #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/lang/XInitialization.hpp> #include <com/sun/star/awt/XWindow.hpp> @@ -193,8 +194,6 @@ OUString XMLFilterDialogComponent_getImplementationName() throw ( RuntimeExcepti return OUString( "com.sun.star.comp.ui.XSLTFilterDialog" ); } -//------------------------------------------------------------------------- - Sequence< OUString > SAL_CALL XMLFilterDialogComponent_getSupportedServiceNames() throw ( RuntimeException ) { Sequence< OUString > aSupported(1); @@ -202,33 +201,16 @@ Sequence< OUString > SAL_CALL XMLFilterDialogComponent_getSupportedServiceNames( return aSupported; } -//------------------------------------------------------------------------- - -sal_Bool SAL_CALL XMLFilterDialogComponent_supportsService( const OUString& ServiceName ) throw ( RuntimeException ) -{ - Sequence< OUString > aSupported(XMLFilterDialogComponent_getSupportedServiceNames()); - const OUString* pArray = aSupported.getConstArray(); - for (sal_Int32 i = 0; i < aSupported.getLength(); ++i, ++pArray) - if (pArray->equals(ServiceName)) - return sal_True; - return sal_False; -} - -//------------------------------------------------------------------------- - Reference< XInterface > SAL_CALL XMLFilterDialogComponent_createInstance( const Reference< XMultiServiceFactory > & rSMgr) throw ( Exception ) { return (OWeakObject*)new XMLFilterDialogComponent( comphelper::getComponentContext(rSMgr) ); } -//------------------------------------------------------------------------- OUString SAL_CALL XMLFilterDialogComponent::getImplementationName() throw(com::sun::star::uno::RuntimeException) { return XMLFilterDialogComponent_getImplementationName(); } -//------------------------------------------------------------------------- - namespace { struct lcl_ImplId : public rtl::Static< ::cppu::OImplementationId, lcl_ImplId > {}; } Sequence< sal_Int8 > SAL_CALL XMLFilterDialogComponent::getImplementationId( void ) throw( RuntimeException ) @@ -269,21 +251,16 @@ Sequence< Type > XMLFilterDialogComponent::getTypes() throw (RuntimeException) return theDialogComponentTypes::get().getTypeCollection().getTypes(); } -//------------------------------------------------------------------------- - Sequence< OUString > SAL_CALL XMLFilterDialogComponent::getSupportedServiceNames() throw(com::sun::star::uno::RuntimeException) { return XMLFilterDialogComponent_getSupportedServiceNames(); } -//------------------------------------------------------------------------- sal_Bool SAL_CALL XMLFilterDialogComponent::supportsService(const OUString& ServiceName) throw(RuntimeException) { - return XMLFilterDialogComponent_supportsService( ServiceName ); + return cppu::supportsService( this, ServiceName ); } -//------------------------------------------------------------------------- - /** Called in dispose method after the listeners were notified. */ void SAL_CALL XMLFilterDialogComponent::disposing() |