[Libreoffice-commits] core.git: package/source writerfilter/source writerperfect/source

Marcos Paulo de Souza marcos.souza.org at gmail.com
Wed Oct 30 16:28:20 CET 2013


 package/source/manifest/ManifestReader.cxx                |    8 +---
 package/source/manifest/ManifestReader.hxx                |    1 
 package/source/manifest/ManifestWriter.cxx                |    7 +--
 package/source/manifest/ManifestWriter.hxx                |    1 
 package/source/zippackage/ZipPackage.cxx                  |    3 +
 package/source/zippackage/ZipPackageFolder.cxx            |    4 +-
 package/source/zippackage/ZipPackageFolderEnumeration.cxx |    4 +-
 package/source/zippackage/ZipPackageStream.cxx            |    3 +
 package/source/zippackage/zipfileaccess.cxx               |    9 +---
 writerfilter/source/filter/ImportFilter.cxx               |   21 ++--------
 writerfilter/source/filter/RtfFilter.cxx                  |   12 ++----
 writerfilter/source/filter/WriterFilterDetection.cxx      |   13 +-----
 writerperfect/source/draw/CDRImportFilter.cxx             |   17 ++------
 writerperfect/source/draw/CDRImportFilter.hxx             |    3 -
 writerperfect/source/draw/CMXImportFilter.cxx             |   17 ++------
 writerperfect/source/draw/CMXImportFilter.hxx             |    3 -
 writerperfect/source/draw/MSPUBImportFilter.cxx           |   17 ++------
 writerperfect/source/draw/MSPUBImportFilter.hxx           |    3 -
 writerperfect/source/draw/VisioImportFilter.cxx           |   17 ++------
 writerperfect/source/draw/VisioImportFilter.hxx           |    3 -
 writerperfect/source/draw/WPGImportFilter.cxx             |   17 ++------
 writerperfect/source/draw/WPGImportFilter.hxx             |    3 -
 writerperfect/source/writer/MSWorksImportFilter.cxx       |   14 ++-----
 writerperfect/source/writer/MSWorksImportFilter.hxx       |    3 -
 writerperfect/source/writer/MWAWImportFilter.cxx          |   16 ++------
 writerperfect/source/writer/MWAWImportFilter.hxx          |    3 -
 writerperfect/source/writer/WordPerfectImportFilter.cxx   |   28 +++-----------
 27 files changed, 61 insertions(+), 189 deletions(-)

New commits:
commit 0865c446c2ac3facd75f03020e934e71403429e1
Author: Marcos Paulo de Souza <marcos.souza.org at gmail.com>
Date:   Sat Oct 26 14:22:21 2013 -0200

    fdo#54938: Convert package, writerfilter and writerperfect
    
    Change-Id: I5220e172bf9722ad86eef3bc557c30779f07201c
    Signed-off-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/package/source/manifest/ManifestReader.cxx b/package/source/manifest/ManifestReader.cxx
index 2e2b6a0..ac8d75b 100644
--- a/package/source/manifest/ManifestReader.cxx
+++ b/package/source/manifest/ManifestReader.cxx
@@ -21,6 +21,7 @@
 #include <ManifestImport.hxx>
 #include <comphelper/processfactory.hxx>
 #include <cppuhelper/factory.hxx>
+#include <cppuhelper/supportsservice.hxx>
 #include <com/sun/star/xml/sax/XDocumentHandler.hpp>
 #include <com/sun/star/xml/sax/SAXParseException.hpp>
 #include <com/sun/star/xml/sax/Parser.hpp>
@@ -92,11 +93,6 @@ OUString ManifestReader::static_getImplementationName()
     return OUString( "com.sun.star.packages.manifest.comp.ManifestReader" );
 }
 
-sal_Bool SAL_CALL ManifestReader::static_supportsService(OUString const & rServiceName)
-{
-    return rServiceName == getSupportedServiceNames()[0];
-}
-
 Sequence < OUString > ManifestReader::static_getSupportedServiceNames()
 {
     Sequence < OUString > aNames(1);
@@ -113,7 +109,7 @@ OUString ManifestReader::getImplementationName()
 sal_Bool SAL_CALL ManifestReader::supportsService(OUString const & rServiceName)
     throw (RuntimeException)
 {
-    return static_supportsService ( rServiceName );
+    return cppu::supportsService(this, rServiceName );
 }
 
 Sequence < OUString > ManifestReader::getSupportedServiceNames()
diff --git a/package/source/manifest/ManifestReader.hxx b/package/source/manifest/ManifestReader.hxx
index d050405..72fe473 100644
--- a/package/source/manifest/ManifestReader.hxx
+++ b/package/source/manifest/ManifestReader.hxx
@@ -56,7 +56,6 @@ public:
     // Component constructor
     static OUString static_getImplementationName();
     static ::com::sun::star::uno::Sequence < OUString > static_getSupportedServiceNames();
-    sal_Bool SAL_CALL static_supportsService(OUString const & rServiceName);
     static ::com::sun::star::uno::Reference < com::sun::star::lang::XSingleServiceFactory > createServiceFactory( com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory > const & rServiceFactory );
 };
 #endif
diff --git a/package/source/manifest/ManifestWriter.cxx b/package/source/manifest/ManifestWriter.cxx
index eaf6794..7d69b37 100644
--- a/package/source/manifest/ManifestWriter.cxx
+++ b/package/source/manifest/ManifestWriter.cxx
@@ -21,6 +21,7 @@
 #include <ManifestExport.hxx>
 #include <comphelper/processfactory.hxx>
 #include <cppuhelper/factory.hxx>
+#include <cppuhelper/supportsservice.hxx>
 #include <com/sun/star/io/XActiveDataSource.hpp>
 #include <com/sun/star/xml/sax/Writer.hpp>
 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
@@ -74,10 +75,6 @@ OUString ManifestWriter::static_getImplementationName()
     return OUString ( "com.sun.star.packages.manifest.comp.ManifestWriter" );
 }
 
-sal_Bool SAL_CALL ManifestWriter::static_supportsService(OUString const & rServiceName)
-{
-    return rServiceName == getSupportedServiceNames()[0];
-}
 Sequence < OUString > ManifestWriter::static_getSupportedServiceNames()
 {
     Sequence < OUString > aNames(1);
@@ -94,7 +91,7 @@ OUString ManifestWriter::getImplementationName()
 sal_Bool SAL_CALL ManifestWriter::supportsService(OUString const & rServiceName)
     throw (RuntimeException)
 {
-    return static_supportsService ( rServiceName );
+    return cppu::supportsService(this, rServiceName);
 }
 Sequence < OUString > ManifestWriter::getSupportedServiceNames()
     throw (RuntimeException)
diff --git a/package/source/manifest/ManifestWriter.hxx b/package/source/manifest/ManifestWriter.hxx
index 4b7e773..f4b77a0 100644
--- a/package/source/manifest/ManifestWriter.hxx
+++ b/package/source/manifest/ManifestWriter.hxx
@@ -57,7 +57,6 @@ public:
     static OUString static_getImplementationName();
     static ::com::sun::star::uno::Sequence < OUString > static_getSupportedServiceNames();
     static ::com::sun::star::uno::Reference < com::sun::star::lang::XSingleServiceFactory > createServiceFactory( com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory > const & rServiceFactory );
-    sal_Bool SAL_CALL static_supportsService(OUString const & rServiceName);
 };
 #endif
 
diff --git a/package/source/zippackage/ZipPackage.cxx b/package/source/zippackage/ZipPackage.cxx
index 3f6a0f5..34068ec 100644
--- a/package/source/zippackage/ZipPackage.cxx
+++ b/package/source/zippackage/ZipPackage.cxx
@@ -77,6 +77,7 @@
 #include <comphelper/ofopxmlhelper.hxx>
 #include <comphelper/documentconstants.hxx>
 #include <comphelper/sequenceashashmap.hxx>
+#include <cppuhelper/supportsservice.hxx>
 
 using namespace std;
 using namespace osl;
@@ -1591,7 +1592,7 @@ Sequence< OUString > ZipPackage::static_getSupportedServiceNames()
 
 sal_Bool SAL_CALL ZipPackage::static_supportsService( OUString const & rServiceName )
 {
-    return rServiceName == getSupportedServiceNames()[0];
+    return cppu::supportsService(this, rServiceName);
 }
 
 OUString ZipPackage::getImplementationName()
diff --git a/package/source/zippackage/ZipPackageFolder.cxx b/package/source/zippackage/ZipPackageFolder.cxx
index 0c46959..ca441b0 100644
--- a/package/source/zippackage/ZipPackageFolder.cxx
+++ b/package/source/zippackage/ZipPackageFolder.cxx
@@ -27,6 +27,7 @@
 #include <ZipPackageFolderEnumeration.hxx>
 #include <com/sun/star/packages/zip/ZipConstants.hpp>
 #include <com/sun/star/embed/StorageFormats.hpp>
+#include <cppuhelper/supportsservice.hxx>
 #include <osl/diagnose.h>
 #include <osl/time.h>
 #include <rtl/digest.h>
@@ -833,10 +834,11 @@ uno::Sequence< OUString > ZipPackageFolder::getSupportedServiceNames()
     aNames[0] = "com.sun.star.packages.PackageFolder";
     return aNames;
 }
+
 sal_Bool SAL_CALL ZipPackageFolder::supportsService( OUString const & rServiceName )
     throw (uno::RuntimeException)
 {
-    return rServiceName == getSupportedServiceNames()[0];
+    return cppu::supportsService(this, rServiceName);
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/package/source/zippackage/ZipPackageFolderEnumeration.cxx b/package/source/zippackage/ZipPackageFolderEnumeration.cxx
index e3b1676..64b48b3 100644
--- a/package/source/zippackage/ZipPackageFolderEnumeration.cxx
+++ b/package/source/zippackage/ZipPackageFolderEnumeration.cxx
@@ -19,6 +19,7 @@
 
 #include <ZipPackageFolderEnumeration.hxx>
 #include <ContentInfo.hxx>
+#include <cppuhelper/supportsservice.hxx>
 
 using namespace com::sun::star;
 
@@ -61,10 +62,11 @@ uno::Sequence< OUString > ZipPackageFolderEnumeration::getSupportedServiceNames(
     aNames[0] = "com.sun.star.packages.PackageFolderEnumeration";
     return aNames;
 }
+
 sal_Bool SAL_CALL ZipPackageFolderEnumeration::supportsService( OUString const & rServiceName )
     throw (uno::RuntimeException)
 {
-    return rServiceName == getSupportedServiceNames()[0];
+    return cppu::supportsService(this, rServiceName);
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/package/source/zippackage/ZipPackageStream.cxx b/package/source/zippackage/ZipPackageStream.cxx
index bb96203..c4f7d3a 100644
--- a/package/source/zippackage/ZipPackageStream.cxx
+++ b/package/source/zippackage/ZipPackageStream.cxx
@@ -41,6 +41,7 @@
 #include <comphelper/processfactory.hxx>
 #include <comphelper/seekableinput.hxx>
 #include <comphelper/storagehelper.hxx>
+#include <cppuhelper/supportsservice.hxx>
 
 #include <rtl/instance.hxx>
 
@@ -920,7 +921,7 @@ Sequence< OUString > ZipPackageStream::getSupportedServiceNames()
 sal_Bool SAL_CALL ZipPackageStream::supportsService( OUString const & rServiceName )
     throw ( RuntimeException )
 {
-    return rServiceName == getSupportedServiceNames()[0];
+    return cppu::supportsService(this, rServiceName);
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/package/source/zippackage/zipfileaccess.cxx b/package/source/zippackage/zipfileaccess.cxx
index afce398..17c5cf2 100644
--- a/package/source/zippackage/zipfileaccess.cxx
+++ b/package/source/zippackage/zipfileaccess.cxx
@@ -24,6 +24,7 @@
 #include <com/sun/star/io/XStream.hpp>
 #include <com/sun/star/io/XSeekable.hpp>
 #include <comphelper/processfactory.hxx>
+#include <cppuhelper/supportsservice.hxx>
 #include <zipfileaccess.hxx>
 #include <ZipEnumeration.hxx>
 #include <ZipPackageSink.hxx>
@@ -446,13 +447,7 @@ OUString SAL_CALL OZipFileAccess::getImplementationName()
 sal_Bool SAL_CALL OZipFileAccess::supportsService( const OUString& ServiceName )
     throw ( uno::RuntimeException )
 {
-    uno::Sequence< OUString > aSeq = impl_staticGetSupportedServiceNames();
-
-    for ( sal_Int32 nInd = 0; nInd < aSeq.getLength(); nInd++ )
-        if ( ServiceName == aSeq[nInd] )
-            return sal_True;
-
-    return sal_False;
+    return cppu::supportsService(this, ServiceName);
 }
 
 uno::Sequence< OUString > SAL_CALL OZipFileAccess::getSupportedServiceNames()
diff --git a/writerfilter/source/filter/ImportFilter.cxx b/writerfilter/source/filter/ImportFilter.cxx
index 784a18a..94a98a9 100644
--- a/writerfilter/source/filter/ImportFilter.cxx
+++ b/writerfilter/source/filter/ImportFilter.cxx
@@ -24,6 +24,7 @@
 #include <com/sun/star/io/XInputStream.hpp>
 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
 #include <comphelper/mediadescriptor.hxx>
+#include <cppuhelper/supportsservice.hxx>
 #include <oox/core/filterdetect.hxx>
 #include <dmapper/DomainMapper.hxx>
 #include <WriterFilter.hxx>
@@ -254,28 +255,14 @@ OUString WriterFilter_getImplementationName () throw (uno::RuntimeException)
    return OUString ( "com.sun.star.comp.Writer.WriterFilter" );
 }
 
-#define SERVICE_NAME1 "com.sun.star.document.ImportFilter"
-#define SERVICE_NAME2 "com.sun.star.document.ExportFilter"
-
-
-sal_Bool WriterFilter_supportsService( const OUString& ServiceName ) throw (uno::RuntimeException)
-{
-   return (ServiceName == SERVICE_NAME1 || ServiceName == SERVICE_NAME2 );
-}
-
-
 uno::Sequence< OUString > WriterFilter_getSupportedServiceNames(  ) throw (uno::RuntimeException)
 {
    uno::Sequence < OUString > aRet(2);
    OUString* pArray = aRet.getArray();
-   pArray[0] =  SERVICE_NAME1;
-   pArray[1] =  SERVICE_NAME2;
+   pArray[0] = "com.sun.star.document.ImportFilter";
+   pArray[1] = "com.sun.star.document.ExportFilter";
    return aRet;
 }
-#undef SERVICE_NAME1
-#undef SERVICE_NAME2
-
-
 
 uno::Reference< uno::XInterface > WriterFilter_createInstance( const uno::Reference< uno::XComponentContext >& xContext)
                 throw( uno::Exception )
@@ -293,7 +280,7 @@ OUString WriterFilter::getImplementationName(  ) throw (uno::RuntimeException)
 
 sal_Bool WriterFilter::supportsService( const OUString& rServiceName ) throw (uno::RuntimeException)
 {
-    return WriterFilter_supportsService( rServiceName );
+    return cppu::supportsService( this, rServiceName );
 }
 
 
diff --git a/writerfilter/source/filter/RtfFilter.cxx b/writerfilter/source/filter/RtfFilter.cxx
index 466afd6..ee78bf1 100644
--- a/writerfilter/source/filter/RtfFilter.cxx
+++ b/writerfilter/source/filter/RtfFilter.cxx
@@ -23,6 +23,7 @@
 #include <tools/solar.h>
 #include <RtfFilter.hxx>
 #include <comphelper/mediadescriptor.hxx>
+#include <cppuhelper/supportsservice.hxx>
 #include <dmapper/DomainMapper.hxx>
 #include <rtftok/RTFDocument.hxx>
 #include <com/sun/star/frame/XFrame.hpp>
@@ -174,11 +175,9 @@ OUString RtfFilter::getImplementationName(  ) throw (uno::RuntimeException)
    return RtfFilter_getImplementationName();
 }
 
-#define SERVICE_NAME1 "com.sun.star.document.ImportFilter"
-#define SERVICE_NAME2 "com.sun.star.document.ExportFilter"
 sal_Bool RtfFilter::supportsService( const OUString& rServiceName ) throw (uno::RuntimeException)
 {
-    return ( rServiceName == SERVICE_NAME1 || rServiceName == SERVICE_NAME2 );
+    return cppu::supportsService(this, rServiceName);
 }
 
 uno::Sequence< OUString > RtfFilter::getSupportedServiceNames(  ) throw (uno::RuntimeException)
@@ -187,7 +186,6 @@ uno::Sequence< OUString > RtfFilter::getSupportedServiceNames(  ) throw (uno::Ru
 }
 
 /* Helpers, used by shared lib exports. */
-
 OUString RtfFilter_getImplementationName () throw (uno::RuntimeException)
 {
    return OUString ( "com.sun.star.comp.Writer.RtfFilter" );
@@ -197,12 +195,10 @@ uno::Sequence< OUString > RtfFilter_getSupportedServiceNames(  ) throw (uno::Run
 {
    uno::Sequence < OUString > aRet(2);
    OUString* pArray = aRet.getArray();
-   pArray[0] =  SERVICE_NAME1;
-   pArray[1] =  SERVICE_NAME2;
+   pArray[0] = "com.sun.star.document.ImportFilter";
+   pArray[1] = "com.sun.star.document.ExportFilter";
    return aRet;
 }
-#undef SERVICE_NAME1
-#undef SERVICE_NAME2
 
 uno::Reference< uno::XInterface > RtfFilter_createInstance( const uno::Reference< uno::XComponentContext >& xContext)
                 throw( uno::Exception )
diff --git a/writerfilter/source/filter/WriterFilterDetection.cxx b/writerfilter/source/filter/WriterFilterDetection.cxx
index 926c7c0..50dcacc 100644
--- a/writerfilter/source/filter/WriterFilterDetection.cxx
+++ b/writerfilter/source/filter/WriterFilterDetection.cxx
@@ -18,6 +18,7 @@
  */
 
 #include <cppuhelper/implementationentry.hxx>
+#include <cppuhelper/supportsservice.hxx>
 #include <WriterFilterDetection.hxx>
 #include <comphelper/storagehelper.hxx>
 #include <com/sun/star/io/XInputStream.hpp>
@@ -47,7 +48,6 @@ OUString WriterFilterDetection_getImplementationName () throw (uno::RuntimeExcep
    return OUString ( "com.sun.star.comp.Writer.WriterFilterDetector"  );
 }
 
-#define SERVICE_NAME1 "com.sun.star.document.ExtendedTypeDetection"
 
 
 OUString WriterFilterDetection::detect( uno::Sequence< beans::PropertyValue >& rDescriptor )
@@ -132,20 +132,13 @@ OUString WriterFilterDetection::detect( uno::Sequence< beans::PropertyValue >& r
 }
 
 
-sal_Bool WriterFilterDetection_supportsService( const OUString& ServiceName ) throw (uno::RuntimeException)
-{
-   return ServiceName == SERVICE_NAME1;
-}
-
-
 uno::Sequence< OUString > WriterFilterDetection_getSupportedServiceNames(  ) throw (uno::RuntimeException)
 {
    uno::Sequence < OUString > aRet(1);
    OUString* pArray = aRet.getArray();
-   pArray[0] =  OUString ( SERVICE_NAME1  );
+   pArray[0] =  OUString ( "com.sun.star.document.ExtendedTypeDetection" );
    return aRet;
 }
-#undef SERVICE_NAME1
 
 
 uno::Reference< uno::XInterface > WriterFilterDetection_createInstance( const uno::Reference< uno::XComponentContext >& xContext)
@@ -163,7 +156,7 @@ OUString WriterFilterDetection::getImplementationName(  ) throw (uno::RuntimeExc
 
 sal_Bool WriterFilterDetection::supportsService( const OUString& rServiceName ) throw (uno::RuntimeException)
 {
-    return WriterFilterDetection_supportsService( rServiceName );
+    return cppu::supportsService( this, rServiceName );
 }
 
 
diff --git a/writerperfect/source/draw/CDRImportFilter.cxx b/writerperfect/source/draw/CDRImportFilter.cxx
index 650a773..44e2283 100644
--- a/writerperfect/source/draw/CDRImportFilter.cxx
+++ b/writerperfect/source/draw/CDRImportFilter.cxx
@@ -21,6 +21,7 @@
 #include <com/sun/star/xml/sax/XParser.hpp>
 #include <com/sun/star/io/XSeekable.hpp>
 #include <com/sun/star/uno/Reference.h>
+#include <cppuhelper/supportsservice.hxx>
 
 #include <xmloff/attrlist.hxx>
 
@@ -174,26 +175,16 @@ throw (RuntimeException)
     return OUString ( "com.sun.star.comp.Draw.CDRImportFilter" );
 }
 
-#define SERVICE_NAME1 "com.sun.star.document.ImportFilter"
-#define SERVICE_NAME2 "com.sun.star.document.ExtendedTypeDetection"
-sal_Bool SAL_CALL CDRImportFilter_supportsService( const OUString &ServiceName )
-throw (RuntimeException)
-{
-    SAL_INFO("writerperfect", "CDRImportFilter_supportsService");
-    return ( ServiceName == SERVICE_NAME1 || ServiceName == SERVICE_NAME2 );
-}
 Sequence< OUString > SAL_CALL CDRImportFilter_getSupportedServiceNames(  )
 throw (RuntimeException)
 {
     SAL_INFO("writerperfect", "CDRImportFilter_getSupportedServiceNames");
     Sequence < OUString > aRet(2);
     OUString *pArray = aRet.getArray();
-    pArray[0] =  OUString ( SERVICE_NAME1 );
-    pArray[1] =  OUString ( SERVICE_NAME2 );
+    pArray[0] =  OUString ( "com.sun.star.document.ImportFilter" );
+    pArray[1] =  OUString ( "com.sun.star.document.ExtendedTypeDetection" );
     return aRet;
 }
-#undef SERVICE_NAME2
-#undef SERVICE_NAME1
 
 Reference< XInterface > SAL_CALL CDRImportFilter_createInstance( const Reference< XComponentContext > & rContext)
 throw( Exception )
@@ -213,7 +204,7 @@ sal_Bool SAL_CALL CDRImportFilter::supportsService( const OUString &rServiceName
 throw (RuntimeException)
 {
     SAL_INFO("writerperfect", "CDRImportFilter::supportsService");
-    return CDRImportFilter_supportsService( rServiceName );
+    return cppu::supportsService( this, rServiceName );
 }
 Sequence< OUString > SAL_CALL CDRImportFilter::getSupportedServiceNames(  )
 throw (RuntimeException)
diff --git a/writerperfect/source/draw/CDRImportFilter.hxx b/writerperfect/source/draw/CDRImportFilter.hxx
index efdfae8..e0e318f 100644
--- a/writerperfect/source/draw/CDRImportFilter.hxx
+++ b/writerperfect/source/draw/CDRImportFilter.hxx
@@ -77,9 +77,6 @@ public:
 OUString CDRImportFilter_getImplementationName()
 throw ( ::com::sun::star::uno::RuntimeException );
 
-sal_Bool SAL_CALL CDRImportFilter_supportsService( const OUString &ServiceName )
-throw ( ::com::sun::star::uno::RuntimeException );
-
 ::com::sun::star::uno::Sequence< OUString > SAL_CALL CDRImportFilter_getSupportedServiceNames(  )
 throw ( ::com::sun::star::uno::RuntimeException );
 
diff --git a/writerperfect/source/draw/CMXImportFilter.cxx b/writerperfect/source/draw/CMXImportFilter.cxx
index d73b505..7efdb8a 100644
--- a/writerperfect/source/draw/CMXImportFilter.cxx
+++ b/writerperfect/source/draw/CMXImportFilter.cxx
@@ -21,6 +21,7 @@
 #include <com/sun/star/xml/sax/XParser.hpp>
 #include <com/sun/star/io/XSeekable.hpp>
 #include <com/sun/star/uno/Reference.h>
+#include <cppuhelper/supportsservice.hxx>
 
 #include <xmloff/attrlist.hxx>
 
@@ -174,26 +175,16 @@ throw (RuntimeException)
     return OUString ( "com.sun.star.comp.Draw.CMXImportFilter" );
 }
 
-#define SERVICE_NAME1 "com.sun.star.document.ImportFilter"
-#define SERVICE_NAME2 "com.sun.star.document.ExtendedTypeDetection"
-sal_Bool SAL_CALL CMXImportFilter_supportsService( const OUString &ServiceName )
-throw (RuntimeException)
-{
-    SAL_INFO("writerperfect", "CMXImportFilter_supportsService");
-    return ( ServiceName == SERVICE_NAME1 || ServiceName == SERVICE_NAME2 );
-}
 Sequence< OUString > SAL_CALL CMXImportFilter_getSupportedServiceNames(  )
 throw (RuntimeException)
 {
     SAL_INFO("writerperfect", "CMXImportFilter_getSupportedServiceNames");
     Sequence < OUString > aRet(2);
     OUString *pArray = aRet.getArray();
-    pArray[0] =  OUString ( SERVICE_NAME1 );
-    pArray[1] =  OUString ( SERVICE_NAME2 );
+    pArray[0] =  OUString ( "com.sun.star.document.ImportFilter" );
+    pArray[1] =  OUString ( "com.sun.star.document.ExtendedTypeDetection" );
     return aRet;
 }
-#undef SERVICE_NAME2
-#undef SERVICE_NAME1
 
 Reference< XInterface > SAL_CALL CMXImportFilter_createInstance( const Reference< XComponentContext > & rContext)
 throw( Exception )
@@ -213,7 +204,7 @@ sal_Bool SAL_CALL CMXImportFilter::supportsService( const OUString &rServiceName
 throw (RuntimeException)
 {
     SAL_INFO("writerperfect", "CMXImportFilter::supportsService");
-    return CMXImportFilter_supportsService( rServiceName );
+    return cppu::supportsService( this, rServiceName );
 }
 Sequence< OUString > SAL_CALL CMXImportFilter::getSupportedServiceNames(  )
 throw (RuntimeException)
diff --git a/writerperfect/source/draw/CMXImportFilter.hxx b/writerperfect/source/draw/CMXImportFilter.hxx
index a218ff8..309bfb4 100644
--- a/writerperfect/source/draw/CMXImportFilter.hxx
+++ b/writerperfect/source/draw/CMXImportFilter.hxx
@@ -77,9 +77,6 @@ public:
 OUString CMXImportFilter_getImplementationName()
 throw ( ::com::sun::star::uno::RuntimeException );
 
-sal_Bool SAL_CALL CMXImportFilter_supportsService( const OUString &ServiceName )
-throw ( ::com::sun::star::uno::RuntimeException );
-
 ::com::sun::star::uno::Sequence< OUString > SAL_CALL CMXImportFilter_getSupportedServiceNames(  )
 throw ( ::com::sun::star::uno::RuntimeException );
 
diff --git a/writerperfect/source/draw/MSPUBImportFilter.cxx b/writerperfect/source/draw/MSPUBImportFilter.cxx
index 6076888..ed09f0a 100644
--- a/writerperfect/source/draw/MSPUBImportFilter.cxx
+++ b/writerperfect/source/draw/MSPUBImportFilter.cxx
@@ -17,6 +17,7 @@
 #include <com/sun/star/xml/sax/XParser.hpp>
 #include <com/sun/star/io/XSeekable.hpp>
 #include <com/sun/star/uno/Reference.h>
+#include <cppuhelper/supportsservice.hxx>
 
 #include <xmloff/attrlist.hxx>
 
@@ -170,26 +171,16 @@ throw (RuntimeException)
     return OUString ( "com.sun.star.comp.Draw.MSPUBImportFilter" );
 }
 
-#define SERVICE_NAME1 "com.sun.star.document.ImportFilter"
-#define SERVICE_NAME2 "com.sun.star.document.ExtendedTypeDetection"
-sal_Bool SAL_CALL MSPUBImportFilter_supportsService( const OUString &ServiceName )
-throw (RuntimeException)
-{
-    SAL_INFO("writerperfect", "MSPUBImportFilter_supportsService");
-    return ( ServiceName == SERVICE_NAME1 || ServiceName == SERVICE_NAME2 );
-}
 Sequence< OUString > SAL_CALL MSPUBImportFilter_getSupportedServiceNames(  )
 throw (RuntimeException)
 {
     SAL_INFO("writerperfect", "MSPUBImportFilter_getSupportedServiceNames");
     Sequence < OUString > aRet(2);
     OUString *pArray = aRet.getArray();
-    pArray[0] =  OUString ( SERVICE_NAME1 );
-    pArray[1] =  OUString ( SERVICE_NAME2 );
+    pArray[0] =  OUString ( "com.sun.star.document.ImportFilter" );
+    pArray[1] =  OUString ( "com.sun.star.document.ExtendedTypeDetection" );
     return aRet;
 }
-#undef SERVICE_NAME2
-#undef SERVICE_NAME1
 
 Reference< XInterface > SAL_CALL MSPUBImportFilter_createInstance( const Reference< XComponentContext > & rContext)
 throw( Exception )
@@ -209,7 +200,7 @@ sal_Bool SAL_CALL MSPUBImportFilter::supportsService( const OUString &rServiceNa
 throw (RuntimeException)
 {
     SAL_INFO("writerperfect", "MSPUBImportFilter::supportsService");
-    return MSPUBImportFilter_supportsService( rServiceName );
+    return cppu::supportsService( this, rServiceName );
 }
 Sequence< OUString > SAL_CALL MSPUBImportFilter::getSupportedServiceNames(  )
 throw (RuntimeException)
diff --git a/writerperfect/source/draw/MSPUBImportFilter.hxx b/writerperfect/source/draw/MSPUBImportFilter.hxx
index 90bb2aa..4a7fb80 100644
--- a/writerperfect/source/draw/MSPUBImportFilter.hxx
+++ b/writerperfect/source/draw/MSPUBImportFilter.hxx
@@ -74,9 +74,6 @@ public:
 OUString MSPUBImportFilter_getImplementationName()
 throw ( ::com::sun::star::uno::RuntimeException );
 
-sal_Bool SAL_CALL MSPUBImportFilter_supportsService( const OUString &ServiceName )
-throw ( ::com::sun::star::uno::RuntimeException );
-
 ::com::sun::star::uno::Sequence< OUString > SAL_CALL MSPUBImportFilter_getSupportedServiceNames(  )
 throw ( ::com::sun::star::uno::RuntimeException );
 
diff --git a/writerperfect/source/draw/VisioImportFilter.cxx b/writerperfect/source/draw/VisioImportFilter.cxx
index 5565dd3..2c38c45 100644
--- a/writerperfect/source/draw/VisioImportFilter.cxx
+++ b/writerperfect/source/draw/VisioImportFilter.cxx
@@ -17,6 +17,7 @@
 #include <com/sun/star/xml/sax/XParser.hpp>
 #include <com/sun/star/io/XSeekable.hpp>
 #include <com/sun/star/uno/Reference.h>
+#include <cppuhelper/supportsservice.hxx>
 
 #include <xmloff/attrlist.hxx>
 
@@ -170,26 +171,16 @@ throw (RuntimeException)
     return OUString ( "com.sun.star.comp.Draw.VisioImportFilter" );
 }
 
-#define SERVICE_NAME1 "com.sun.star.document.ImportFilter"
-#define SERVICE_NAME2 "com.sun.star.document.ExtendedTypeDetection"
-sal_Bool SAL_CALL VisioImportFilter_supportsService( const OUString &ServiceName )
-throw (RuntimeException)
-{
-    SAL_INFO("writerperfect", "VisioImportFilter_supportsService");
-    return ( ServiceName == SERVICE_NAME1 || ServiceName == SERVICE_NAME2 );
-}
 Sequence< OUString > SAL_CALL VisioImportFilter_getSupportedServiceNames(  )
 throw (RuntimeException)
 {
     SAL_INFO("writerperfect", "VisioImportFilter_getSupportedServiceNames");
     Sequence < OUString > aRet(2);
     OUString *pArray = aRet.getArray();
-    pArray[0] =  OUString ( SERVICE_NAME1 );
-    pArray[1] =  OUString ( SERVICE_NAME2 );
+    pArray[0] =  OUString ( "com.sun.star.document.ImportFilter" );
+    pArray[1] =  OUString ( "com.sun.star.document.ExtendedTypeDetection" );
     return aRet;
 }
-#undef SERVICE_NAME2
-#undef SERVICE_NAME1
 
 Reference< XInterface > SAL_CALL VisioImportFilter_createInstance( const Reference< XComponentContext > & rContext)
 throw( Exception )
@@ -209,7 +200,7 @@ sal_Bool SAL_CALL VisioImportFilter::supportsService( const OUString &rServiceNa
 throw (RuntimeException)
 {
     SAL_INFO("writerperfect", "VisioImportFilter::supportsService");
-    return VisioImportFilter_supportsService( rServiceName );
+    return cppu::supportsService( this, rServiceName );
 }
 Sequence< OUString > SAL_CALL VisioImportFilter::getSupportedServiceNames(  )
 throw (RuntimeException)
diff --git a/writerperfect/source/draw/VisioImportFilter.hxx b/writerperfect/source/draw/VisioImportFilter.hxx
index b001865..699e2c6 100644
--- a/writerperfect/source/draw/VisioImportFilter.hxx
+++ b/writerperfect/source/draw/VisioImportFilter.hxx
@@ -74,9 +74,6 @@ public:
 OUString VisioImportFilter_getImplementationName()
 throw ( ::com::sun::star::uno::RuntimeException );
 
-sal_Bool SAL_CALL VisioImportFilter_supportsService( const OUString &ServiceName )
-throw ( ::com::sun::star::uno::RuntimeException );
-
 ::com::sun::star::uno::Sequence< OUString > SAL_CALL VisioImportFilter_getSupportedServiceNames(  )
 throw ( ::com::sun::star::uno::RuntimeException );
 
diff --git a/writerperfect/source/draw/WPGImportFilter.cxx b/writerperfect/source/draw/WPGImportFilter.cxx
index 0772915..5636650 100644
--- a/writerperfect/source/draw/WPGImportFilter.cxx
+++ b/writerperfect/source/draw/WPGImportFilter.cxx
@@ -23,6 +23,7 @@
 #include <com/sun/star/xml/sax/XParser.hpp>
 #include <com/sun/star/io/XSeekable.hpp>
 #include <com/sun/star/uno/Reference.h>
+#include <cppuhelper/supportsservice.hxx>
 
 #include <xmloff/attrlist.hxx>
 
@@ -176,26 +177,16 @@ throw (RuntimeException)
     return OUString (  "com.sun.star.comp.Draw.WPGImportFilter"  );
 }
 
-#define SERVICE_NAME1 "com.sun.star.document.ImportFilter"
-#define SERVICE_NAME2 "com.sun.star.document.ExtendedTypeDetection"
-sal_Bool SAL_CALL WPGImportFilter_supportsService( const OUString &ServiceName )
-throw (RuntimeException)
-{
-    SAL_INFO("writerperfect", "WPGImportFilter_supportsService");
-    return ( ServiceName == SERVICE_NAME1 || ServiceName == SERVICE_NAME2 );
-}
 Sequence< OUString > SAL_CALL WPGImportFilter_getSupportedServiceNames(  )
 throw (RuntimeException)
 {
     SAL_INFO("writerperfect", "WPGImportFilter_getSupportedServiceNames");
     Sequence < OUString > aRet(2);
     OUString *pArray = aRet.getArray();
-    pArray[0] =  OUString (  SERVICE_NAME1  );
-    pArray[1] =  OUString (  SERVICE_NAME2  );
+    pArray[0] =  OUString ( "com.sun.star.document.ImportFilter" );
+    pArray[1] =  OUString ( "com.sun.star.document.ExtendedTypeDetection" );
     return aRet;
 }
-#undef SERVICE_NAME2
-#undef SERVICE_NAME1
 
 Reference< XInterface > SAL_CALL WPGImportFilter_createInstance( const Reference< XComponentContext > & rContext)
 throw( Exception )
@@ -215,7 +206,7 @@ sal_Bool SAL_CALL WPGImportFilter::supportsService( const OUString &rServiceName
 throw (RuntimeException)
 {
     SAL_INFO("writerperfect", "WPGImportFilter::supportsService");
-    return WPGImportFilter_supportsService( rServiceName );
+    return cppu::supportsService( this, rServiceName );
 }
 Sequence< OUString > SAL_CALL WPGImportFilter::getSupportedServiceNames(  )
 throw (RuntimeException)
diff --git a/writerperfect/source/draw/WPGImportFilter.hxx b/writerperfect/source/draw/WPGImportFilter.hxx
index 12bbf58..9598b33 100644
--- a/writerperfect/source/draw/WPGImportFilter.hxx
+++ b/writerperfect/source/draw/WPGImportFilter.hxx
@@ -79,9 +79,6 @@ public:
 OUString WPGImportFilter_getImplementationName()
 throw ( ::com::sun::star::uno::RuntimeException );
 
-sal_Bool SAL_CALL WPGImportFilter_supportsService( const OUString &ServiceName )
-throw ( ::com::sun::star::uno::RuntimeException );
-
 ::com::sun::star::uno::Sequence< OUString > SAL_CALL WPGImportFilter_getSupportedServiceNames(  )
 throw ( ::com::sun::star::uno::RuntimeException );
 
diff --git a/writerperfect/source/writer/MSWorksImportFilter.cxx b/writerperfect/source/writer/MSWorksImportFilter.cxx
index f37b808..d6af1b4 100644
--- a/writerperfect/source/writer/MSWorksImportFilter.cxx
+++ b/writerperfect/source/writer/MSWorksImportFilter.cxx
@@ -19,6 +19,7 @@
 #include <com/sun/star/xml/sax/XParser.hpp>
 #include <com/sun/star/io/XSeekable.hpp>
 #include <com/sun/star/uno/Reference.h>
+#include <cppuhelper/supportsservice.hxx>
 
 #include <xmloff/attrlist.hxx>
 #include <ucbhelper/content.hxx>
@@ -187,20 +188,13 @@ throw (RuntimeException)
     return OUString (  "com.sun.star.comp.Writer.MSWorksImportFilter"  );
 }
 
-#define SERVICE_NAME1 "com.sun.star.document.ImportFilter"
-#define SERVICE_NAME2 "com.sun.star.document.ExtendedTypeDetection"
-sal_Bool SAL_CALL MSWorksImportFilter_supportsService( const OUString &ServiceName )
-throw (RuntimeException)
-{
-    return ( ServiceName == SERVICE_NAME1 || ServiceName == SERVICE_NAME2 );
-}
 Sequence< OUString > SAL_CALL MSWorksImportFilter_getSupportedServiceNames(  )
 throw (RuntimeException)
 {
     Sequence < OUString > aRet(2);
     OUString *pArray = aRet.getArray();
-    pArray[0] =  OUString (  SERVICE_NAME1  );
-    pArray[1] =  OUString (  SERVICE_NAME2  );
+    pArray[0] =  OUString ( "com.sun.star.document.ImportFilter" );
+    pArray[1] =  OUString ( "com.sun.star.document.ExtendedTypeDetection" );
     return aRet;
 }
 #undef SERVICE_NAME2
@@ -221,7 +215,7 @@ throw (RuntimeException)
 sal_Bool SAL_CALL MSWorksImportFilter::supportsService( const OUString &rServiceName )
 throw (RuntimeException)
 {
-    return MSWorksImportFilter_supportsService( rServiceName );
+    return cppu::supportsService( this, rServiceName );
 }
 Sequence< OUString > SAL_CALL MSWorksImportFilter::getSupportedServiceNames(  )
 throw (RuntimeException)
diff --git a/writerperfect/source/writer/MSWorksImportFilter.hxx b/writerperfect/source/writer/MSWorksImportFilter.hxx
index 5a107e5..08ff231 100644
--- a/writerperfect/source/writer/MSWorksImportFilter.hxx
+++ b/writerperfect/source/writer/MSWorksImportFilter.hxx
@@ -76,9 +76,6 @@ public:
 OUString MSWorksImportFilter_getImplementationName()
 throw ( ::com::sun::star::uno::RuntimeException );
 
-sal_Bool SAL_CALL MSWorksImportFilter_supportsService( const OUString &ServiceName )
-throw ( ::com::sun::star::uno::RuntimeException );
-
 ::com::sun::star::uno::Sequence< OUString > SAL_CALL MSWorksImportFilter_getSupportedServiceNames(  )
 throw ( ::com::sun::star::uno::RuntimeException );
 
diff --git a/writerperfect/source/writer/MWAWImportFilter.cxx b/writerperfect/source/writer/MWAWImportFilter.cxx
index 50f5e11..ff4d7af 100644
--- a/writerperfect/source/writer/MWAWImportFilter.cxx
+++ b/writerperfect/source/writer/MWAWImportFilter.cxx
@@ -19,6 +19,7 @@
 #include <com/sun/star/xml/sax/XParser.hpp>
 #include <com/sun/star/io/XSeekable.hpp>
 #include <com/sun/star/uno/Reference.h>
+#include <cppuhelper/supportsservice.hxx>
 
 #include <xmloff/attrlist.hxx>
 #include <ucbhelper/content.hxx>
@@ -1030,24 +1031,15 @@ throw (RuntimeException)
     return OUString (  "com.sun.star.comp.Writer.MWAWImportFilter"  );
 }
 
-#define SERVICE_NAME1 "com.sun.star.document.ImportFilter"
-#define SERVICE_NAME2 "com.sun.star.document.ExtendedTypeDetection"
-sal_Bool SAL_CALL MWAWImportFilter_supportsService( const OUString &ServiceName )
-throw (RuntimeException)
-{
-    return ( ServiceName == SERVICE_NAME1 || ServiceName == SERVICE_NAME2 );
-}
 Sequence< OUString > SAL_CALL MWAWImportFilter_getSupportedServiceNames(  )
 throw (RuntimeException)
 {
     Sequence < OUString > aRet(2);
     OUString *pArray = aRet.getArray();
-    pArray[0] =  OUString (  SERVICE_NAME1  );
-    pArray[1] =  OUString (  SERVICE_NAME2  );
+    pArray[0] =  OUString ( "com.sun.star.document.ImportFilter" );
+    pArray[1] =  OUString ( "com.sun.star.document.ExtendedTypeDetection" );
     return aRet;
 }
-#undef SERVICE_NAME2
-#undef SERVICE_NAME1
 
 Reference< XInterface > SAL_CALL MWAWImportFilter_createInstance( const Reference< XComponentContext > &rContext)
 throw( Exception )
@@ -1064,7 +1056,7 @@ throw (RuntimeException)
 sal_Bool SAL_CALL MWAWImportFilter::supportsService( const OUString &rServiceName )
 throw (RuntimeException)
 {
-    return MWAWImportFilter_supportsService( rServiceName );
+    return cppu::supportsService( this, rServiceName );
 }
 Sequence< OUString > SAL_CALL MWAWImportFilter::getSupportedServiceNames(  )
 throw (RuntimeException)
diff --git a/writerperfect/source/writer/MWAWImportFilter.hxx b/writerperfect/source/writer/MWAWImportFilter.hxx
index 0ccccb1..ca28db7 100644
--- a/writerperfect/source/writer/MWAWImportFilter.hxx
+++ b/writerperfect/source/writer/MWAWImportFilter.hxx
@@ -76,9 +76,6 @@ public:
 OUString MWAWImportFilter_getImplementationName()
 throw ( ::com::sun::star::uno::RuntimeException );
 
-sal_Bool SAL_CALL MWAWImportFilter_supportsService( const OUString &ServiceName )
-throw ( ::com::sun::star::uno::RuntimeException );
-
 ::com::sun::star::uno::Sequence< OUString > SAL_CALL MWAWImportFilter_getSupportedServiceNames(  )
 throw ( ::com::sun::star::uno::RuntimeException );
 
diff --git a/writerperfect/source/writer/WordPerfectImportFilter.cxx b/writerperfect/source/writer/WordPerfectImportFilter.cxx
index 3141b45..589125c 100644
--- a/writerperfect/source/writer/WordPerfectImportFilter.cxx
+++ b/writerperfect/source/writer/WordPerfectImportFilter.cxx
@@ -19,6 +19,7 @@
 #include <com/sun/star/io/XSeekable.hpp>
 #include <com/sun/star/uno/Reference.h>
 #include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
+#include <cppuhelper/supportsservice.hxx>
 
 #include <xmloff/attrlist.hxx>
 #include <sfx2/passwd.hxx>
@@ -240,24 +241,15 @@ throw (RuntimeException)
     return OUString (  "com.sun.star.comp.Writer.WordPerfectImportFilter"  );
 }
 
-#define SERVICE_NAME1 "com.sun.star.document.ImportFilter"
-#define SERVICE_NAME2 "com.sun.star.document.ExtendedTypeDetection"
-sal_Bool SAL_CALL WordPerfectImportFilter_supportsService( const OUString &ServiceName )
-throw (RuntimeException)
-{
-    return ( ServiceName == SERVICE_NAME1 || ServiceName == SERVICE_NAME2 );
-}
 Sequence< OUString > SAL_CALL WordPerfectImportFilter_getSupportedServiceNames(  )
 throw (RuntimeException)
 {
     Sequence < OUString > aRet(2);
     OUString *pArray = aRet.getArray();
-    pArray[0] =  OUString (  SERVICE_NAME1  );
-    pArray[1] =  OUString (  SERVICE_NAME2  );
+    pArray[0] =  OUString ( "com.sun.star.document.ImportFilter" );
+    pArray[1] =  OUString ( "com.sun.star.document.ExtendedTypeDetection" );
     return aRet;
 }
-#undef SERVICE_NAME2
-#undef SERVICE_NAME1
 
 Reference< XInterface > SAL_CALL WordPerfectImportFilter_createInstance( const Reference< XComponentContext > & rContext)
 throw( Exception )
@@ -274,7 +266,7 @@ throw (RuntimeException)
 sal_Bool SAL_CALL WordPerfectImportFilter::supportsService( const OUString &rServiceName )
 throw (RuntimeException)
 {
-    return WordPerfectImportFilter_supportsService( rServiceName );
+    return cppu::supportsService( this, rServiceName );
 }
 Sequence< OUString > SAL_CALL WordPerfectImportFilter::getSupportedServiceNames(  )
 throw (RuntimeException)
@@ -366,7 +358,7 @@ throw (RuntimeException)
 sal_Bool SAL_CALL WordPerfectImportFilterDialog::supportsService( const OUString &rServiceName )
 throw (RuntimeException)
 {
-    return WordPerfectImportFilterDialog_supportsService( rServiceName );
+    return cppu::supportsService( this, rServiceName );
 }
 
 Sequence< OUString > SAL_CALL WordPerfectImportFilterDialog::getSupportedServiceNames(  )
@@ -381,22 +373,14 @@ throw (RuntimeException)
     return OUString (  "com.sun.star.comp.Writer.WordPerfectImportFilterDialog"  );
 }
 
-#define SERVICE_NAME "com.sun.star.ui.dialogs.FilterOptionsDialog"
-sal_Bool SAL_CALL WordPerfectImportFilterDialog_supportsService( const OUString &ServiceName )
-throw (RuntimeException)
-{
-    return ( ServiceName == SERVICE_NAME );
-}
-
 Sequence< OUString > SAL_CALL WordPerfectImportFilterDialog_getSupportedServiceNames(  )
 throw (RuntimeException)
 {
     Sequence < OUString > aRet(1);
     OUString *pArray = aRet.getArray();
-    pArray[0] =  OUString (  SERVICE_NAME  );
+    pArray[0] =  OUString ( "com.sun.star.ui.dialogs.FilterOptionsDialog" );
     return aRet;
 }
-#undef SERVICE_NAME
 
 Reference< XInterface > SAL_CALL WordPerfectImportFilterDialog_createInstance( const Reference< XComponentContext > & rContext)
 throw( Exception )


More information about the Libreoffice-commits mailing list