fdo#46808, Convert XMLSignatureTemplate service to new style

Change-Id: I80530f84ad5a86eccc794f9ddd14f939d093a20d
This commit is contained in:
Noel Grandin
2013-06-05 11:56:40 +02:00
parent 73e686725e
commit 6a12e13870
3 changed files with 4 additions and 15 deletions

View File

@@ -452,6 +452,7 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/xforms,\
$(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/xml/crypto,\ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/xml/crypto,\
NSSInitializer \ NSSInitializer \
SEInitializer \ SEInitializer \
XMLSignatureTemplate \
)) ))
$(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/xml/dom,\ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/xml/dom,\
DocumentBuilder \ DocumentBuilder \
@@ -1586,7 +1587,6 @@ $(eval $(call gb_UnoApi_add_idlfiles_noheader,offapi,offapi/com/sun/star/xml/cry
XMLEncryptionTemplate \ XMLEncryptionTemplate \
XMLSecurityContext \ XMLSecurityContext \
XMLSignature \ XMLSignature \
XMLSignatureTemplate \
)) ))
$(eval $(call gb_UnoApi_add_idlfiles_noheader,offapi,offapi/com/sun/star/xml/crypto/sax,\ $(eval $(call gb_UnoApi_add_idlfiles_noheader,offapi,offapi/com/sun/star/xml/crypto/sax,\
Decryptor \ Decryptor \

View File

@@ -24,20 +24,14 @@
#ifndef __com_sun_star_xml_crypto_xmlsignaturetemplate_idl_ #ifndef __com_sun_star_xml_crypto_xmlsignaturetemplate_idl_
#define __com_sun_star_xml_crypto_xmlsignaturetemplate_idl_ #define __com_sun_star_xml_crypto_xmlsignaturetemplate_idl_
#include <com/sun/star/uno/XInterface.idl>
#include <com/sun/star/uno/Exception.idl>
#include <com/sun/star/xml/crypto/XXMLSignatureTemplate.idl> #include <com/sun/star/xml/crypto/XXMLSignatureTemplate.idl>
#include <com/sun/star/lang/XInitialization.idl>
module com { module sun { module star { module xml { module crypto { module com { module sun { module star { module xml { module crypto {
/** /**
* Service of XMLSignatureTemplate * Service of XMLSignatureTemplate
*/ */
service XMLSignatureTemplate { service XMLSignatureTemplate : com::sun::star::xml::crypto::XXMLSignatureTemplate ;
interface com::sun::star::xml::crypto::XXMLSignatureTemplate ;
interface com::sun::star::lang::XInitialization ;
} ;
} ; } ; } ; } ; } ; } ; } ; } ; } ; } ;

View File

@@ -19,7 +19,7 @@
#include "signatureengine.hxx" #include "signatureengine.hxx"
#include <com/sun/star/xml/crypto/XXMLSignatureTemplate.hpp> #include <com/sun/star/xml/crypto/XMLSignatureTemplate.hpp>
#include <com/sun/star/xml/wrapper/XXMLElementWrapper.hpp> #include <com/sun/star/xml/wrapper/XXMLElementWrapper.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp>
@@ -29,8 +29,6 @@ namespace cssl = com::sun::star::lang;
namespace cssxc = com::sun::star::xml::crypto; namespace cssxc = com::sun::star::xml::crypto;
namespace cssxw = com::sun::star::xml::wrapper; namespace cssxw = com::sun::star::xml::wrapper;
#define SIGNATURE_TEMPLATE "com.sun.star.xml.crypto.XMLSignatureTemplate"
SignatureEngine::SignatureEngine( const Reference<XComponentContext> & xContext) SignatureEngine::SignatureEngine( const Reference<XComponentContext> & xContext)
: m_xContext(xContext), m_nTotalReferenceNumber(-1) : m_xContext(xContext), m_nTotalReferenceNumber(-1)
{ {
@@ -114,11 +112,8 @@ void SignatureEngine::tryToPerform( )
{ {
if (checkReady()) if (checkReady())
{ {
const OUString ouSignatureTemplate ( SIGNATURE_TEMPLATE );
cssu::Reference < cssxc::XXMLSignatureTemplate > cssu::Reference < cssxc::XXMLSignatureTemplate >
xSignatureTemplate( m_xContext->getServiceManager()->createInstanceWithContext( ouSignatureTemplate, m_xContext ), cssu::UNO_QUERY ); xSignatureTemplate = cssxc::XMLSignatureTemplate::create( m_xContext );
OSL_ASSERT( xSignatureTemplate.is() );
cssu::Reference< cssxw::XXMLElementWrapper > cssu::Reference< cssxw::XXMLElementWrapper >
xXMLElement = m_xSAXEventKeeper->getElement( m_nIdOfTemplateEC ); xXMLElement = m_xSAXEventKeeper->getElement( m_nIdOfTemplateEC );