summaryrefslogtreecommitdiff
path: root/xmlsecurity
diff options
context:
space:
mode:
authorMarcos Paulo de Souza <marcos.souza.org@gmail.com>2014-03-04 08:41:53 -0300
committerMarcos Paulo de Souza <marcos.souza.org@gmail.com>2014-03-04 07:30:02 -0600
commit4d6560f5066d143552cba861aaadc2f49b4357d4 (patch)
tree34c7cfba1a7cd2fce5f9bfde5d4d06910e1ac774 /xmlsecurity
parent8f210c26c53cf5480819d983e57977d531422ff1 (diff)
fdo#54938: Convert some places to use cppu::supportsService
The last cases are non obvious, so it's pratically done Change-Id: Icae1da8e238f516eaed0f7fbdf96fff778eac547 Reviewed-on: https://gerrit.libreoffice.org/8445 Reviewed-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com> Tested-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
Diffstat (limited to 'xmlsecurity')
-rw-r--r--xmlsecurity/source/component/certificatecontainer.cxx6
-rw-r--r--xmlsecurity/source/xmlsec/mscrypt/seinitializer_mscryptimpl.cxx9
-rw-r--r--xmlsecurity/source/xmlsec/nss/seinitializer_nssimpl.cxx12
-rw-r--r--xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.cxx14
-rw-r--r--xmlsecurity/source/xmlsec/xmlelementwrapper_xmlsecimpl.cxx13
5 files changed, 13 insertions, 41 deletions
diff --git a/xmlsecurity/source/component/certificatecontainer.cxx b/xmlsecurity/source/component/certificatecontainer.cxx
index c021e3060e10..c65202d8e053 100644
--- a/xmlsecurity/source/component/certificatecontainer.cxx
+++ b/xmlsecurity/source/component/certificatecontainer.cxx
@@ -18,6 +18,7 @@
*/
#include <certificatecontainer.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include <sal/config.h>
@@ -96,10 +97,7 @@ sal_Bool SAL_CALL
CertificateContainer::supportsService( const OUString& ServiceName )
throw(::com::sun::star::uno::RuntimeException, std::exception)
{
- if ( ServiceName.equalsAscii("com.sun.star.security.CertificateContainer") )
- return sal_True;
- else
- return sal_False;
+ return cppu::supportsService( this, ServiceName );
}
Sequence< OUString > SAL_CALL
diff --git a/xmlsecurity/source/xmlsec/mscrypt/seinitializer_mscryptimpl.cxx b/xmlsecurity/source/xmlsec/mscrypt/seinitializer_mscryptimpl.cxx
index 277222caa128..411b48246db9 100644
--- a/xmlsecurity/source/xmlsec/mscrypt/seinitializer_mscryptimpl.cxx
+++ b/xmlsecurity/source/xmlsec/mscrypt/seinitializer_mscryptimpl.cxx
@@ -27,6 +27,7 @@
#include "com/sun/star/xml/crypto/SecurityEnvironment.hpp"
#include "com/sun/star/xml/crypto/XMLSecurityContext.hpp"
#include "comphelper/processfactory.hxx"
+#include <cppuhelper/supportsservice.hxx>
namespace cssu = com::sun::star::uno;
namespace cssl = com::sun::star::lang;
@@ -152,12 +153,6 @@ OUString SEInitializer_MSCryptImpl_getImplementationName()
return OUString( "com.sun.star.xml.security.bridge.xmlsec.SEInitializer_MSCryptImpl" );
}
-sal_Bool SAL_CALL SEInitializer_MSCryptImpl_supportsService( const OUString& rServiceName )
- throw (cssu::RuntimeException)
-{
- return rServiceName == "com.sun.star.xml.crypto.SEInitializer";
-}
-
cssu::Sequence< OUString > SAL_CALL SEInitializer_MSCryptImpl_getSupportedServiceNames()
throw (cssu::RuntimeException)
{
@@ -183,7 +178,7 @@ OUString SAL_CALL SEInitializer_MSCryptImpl::getImplementationName()
sal_Bool SAL_CALL SEInitializer_MSCryptImpl::supportsService( const OUString& rServiceName )
throw (cssu::RuntimeException)
{
- return SEInitializer_MSCryptImpl_supportsService( rServiceName );
+ return cppu::supportsService( this, rServiceName );
}
cssu::Sequence< OUString > SAL_CALL SEInitializer_MSCryptImpl::getSupportedServiceNames()
diff --git a/xmlsecurity/source/xmlsec/nss/seinitializer_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/seinitializer_nssimpl.cxx
index 6e5ead471df7..bac83e4050be 100644
--- a/xmlsecurity/source/xmlsec/nss/seinitializer_nssimpl.cxx
+++ b/xmlsecurity/source/xmlsec/nss/seinitializer_nssimpl.cxx
@@ -34,6 +34,7 @@
#include <osl/thread.h>
#include <com/sun/star/xml/crypto/SecurityEnvironment.hpp>
#include <com/sun/star/xml/crypto/XMLSecurityContext.hpp>
+#include <cppuhelper/supportsservice.hxx>
#include "seinitializer_nssimpl.hxx"
#include "securityenvironment_nssimpl.hxx"
@@ -51,7 +52,6 @@ namespace cssxc = css::xml::crypto;
using namespace com::sun::star;
-#define SE_SERVICE_NAME "com.sun.star.xml.crypto.SEInitializer"
SEInitializer_NssImpl::SEInitializer_NssImpl( const css::uno::Reference< css::uno::XComponentContext > &rxContext )
{
@@ -117,18 +117,12 @@ OUString SEInitializer_NssImpl_getImplementationName ()
return OUString ("com.sun.star.xml.security.bridge.xmlsec.SEInitializer_NssImpl" );
}
-sal_Bool SAL_CALL SEInitializer_NssImpl_supportsService( const OUString& ServiceName )
- throw (uno::RuntimeException)
-{
- return ( ServiceName == SE_SERVICE_NAME || ServiceName == NSS_SERVICE_NAME );
-}
-
uno::Sequence< OUString > SAL_CALL SEInitializer_NssImpl_getSupportedServiceNames( )
throw (uno::RuntimeException)
{
uno::Sequence < OUString > aRet(2);
OUString* pArray = aRet.getArray();
- pArray[0] = OUString ( SE_SERVICE_NAME );
+ pArray[0] = "com.sun.star.xml.crypto.SEInitializer";
pArray[1] = OUString ( NSS_SERVICE_NAME );
return aRet;
}
@@ -148,7 +142,7 @@ OUString SAL_CALL SEInitializer_NssImpl::getImplementationName( )
sal_Bool SAL_CALL SEInitializer_NssImpl::supportsService( const OUString& rServiceName )
throw (uno::RuntimeException, std::exception)
{
- return SEInitializer_NssImpl_supportsService( rServiceName );
+ return cppu::supportsService( this, rServiceName );
}
uno::Sequence< OUString > SAL_CALL SEInitializer_NssImpl::getSupportedServiceNames( )
throw (uno::RuntimeException, std::exception)
diff --git a/xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.cxx b/xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.cxx
index 1e6e8cbc365e..02f9d9b0883b 100644
--- a/xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.cxx
+++ b/xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.cxx
@@ -17,7 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-
+#include <cppuhelper/supportsservice.hxx>
#include "xmldocumentwrapper_xmlsecimpl.hxx"
#include <xmloff/attrlist.hxx>
@@ -43,7 +43,6 @@ namespace cssxcsax = com::sun::star::xml::csax;
namespace cssxs = com::sun::star::xml::sax;
namespace cssxw = com::sun::star::xml::wrapper;
-#define SERVICE_NAME "com.sun.star.xml.wrapper.XMLDocumentWrapper"
#define IMPLEMENTATION_NAME "com.sun.star.xml.security.bridge.xmlsec.XMLDocumentWrapper_XmlSecImpl"
#define STRXMLNS "xmlns"
@@ -1061,21 +1060,14 @@ OUString XMLDocumentWrapper_XmlSecImpl_getImplementationName ()
return OUString ( IMPLEMENTATION_NAME );
}
-sal_Bool SAL_CALL XMLDocumentWrapper_XmlSecImpl_supportsService( const OUString& ServiceName )
- throw (cssu::RuntimeException)
-{
- return ServiceName == SERVICE_NAME;
-}
-
cssu::Sequence< OUString > SAL_CALL XMLDocumentWrapper_XmlSecImpl_getSupportedServiceNames( )
throw (cssu::RuntimeException)
{
cssu::Sequence < OUString > aRet(1);
OUString* pArray = aRet.getArray();
- pArray[0] = OUString ( SERVICE_NAME );
+ pArray[0] = "com.sun.star.xml.wrapper.XMLDocumentWrapper";
return aRet;
}
-#undef SERVICE_NAME
cssu::Reference< cssu::XInterface > SAL_CALL XMLDocumentWrapper_XmlSecImpl_createInstance(
const cssu::Reference< cssu::XComponentContext > &)
@@ -1093,7 +1085,7 @@ OUString SAL_CALL XMLDocumentWrapper_XmlSecImpl::getImplementationName( )
sal_Bool SAL_CALL XMLDocumentWrapper_XmlSecImpl::supportsService( const OUString& rServiceName )
throw (cssu::RuntimeException, std::exception)
{
- return XMLDocumentWrapper_XmlSecImpl_supportsService( rServiceName );
+ return cppu::supportsService( this, rServiceName );
}
cssu::Sequence< OUString > SAL_CALL XMLDocumentWrapper_XmlSecImpl::getSupportedServiceNames( )
throw (cssu::RuntimeException, std::exception)
diff --git a/xmlsecurity/source/xmlsec/xmlelementwrapper_xmlsecimpl.cxx b/xmlsecurity/source/xmlsec/xmlelementwrapper_xmlsecimpl.cxx
index afaf1efde62d..fb4a35f85fa9 100644
--- a/xmlsecurity/source/xmlsec/xmlelementwrapper_xmlsecimpl.cxx
+++ b/xmlsecurity/source/xmlsec/xmlelementwrapper_xmlsecimpl.cxx
@@ -20,11 +20,11 @@
#include <string.h>
#include "xmlelementwrapper_xmlsecimpl.hxx"
+#include <cppuhelper/supportsservice.hxx>
#include <cppuhelper/typeprovider.hxx>
namespace cssu = com::sun::star::uno;
-#define SERVICE_NAME "com.sun.star.xml.wrapper.XMLElementWrapper"
#define IMPLEMENTATION_NAME "com.sun.star.xml.security.bridge.xmlsec.XMLElementWrapper_XmlSecImpl"
XMLElementWrapper_XmlSecImpl::XMLElementWrapper_XmlSecImpl(const xmlNodePtr pNode)
@@ -76,21 +76,14 @@ OUString XMLElementWrapper_XmlSecImpl_getImplementationName ()
return OUString ( IMPLEMENTATION_NAME );
}
-sal_Bool SAL_CALL XMLElementWrapper_XmlSecImpl_supportsService( const OUString& ServiceName )
- throw (cssu::RuntimeException)
-{
- return ServiceName == SERVICE_NAME;
-}
-
cssu::Sequence< OUString > SAL_CALL XMLElementWrapper_XmlSecImpl_getSupportedServiceNames( )
throw (cssu::RuntimeException)
{
cssu::Sequence < OUString > aRet(1);
OUString* pArray = aRet.getArray();
- pArray[0] = OUString ( SERVICE_NAME );
+ pArray[0] = "com.sun.star.xml.wrapper.XMLElementWrapper";
return aRet;
}
-#undef SERVICE_NAME
cssu::Reference< cssu::XInterface > SAL_CALL
XMLElementWrapper_XmlSecImpl_createInstance(
@@ -109,7 +102,7 @@ OUString SAL_CALL XMLElementWrapper_XmlSecImpl::getImplementationName( )
sal_Bool SAL_CALL XMLElementWrapper_XmlSecImpl::supportsService( const OUString& rServiceName )
throw (cssu::RuntimeException, std::exception)
{
- return XMLElementWrapper_XmlSecImpl_supportsService( rServiceName );
+ return cppu::supportsService( this, rServiceName );
}
cssu::Sequence< OUString > SAL_CALL XMLElementWrapper_XmlSecImpl::getSupportedServiceNames( )
throw (cssu::RuntimeException, std::exception)