convert Link<> to typed
Change-Id: I2a149a0a2a189ca84ce8e71f32d0f3696a0bb50d
This commit is contained in:
@@ -93,7 +93,7 @@ private:
|
||||
DECL_LINK_TYPED(RemoveButtonHdl, Button*, void);
|
||||
DECL_LINK_TYPED(SignatureHighlightHdl, SvTreeListBox*, void );
|
||||
DECL_LINK_TYPED(SignatureSelectHdl, SvTreeListBox*, bool );
|
||||
DECL_LINK( StartVerifySignatureHdl, void* );
|
||||
DECL_LINK_TYPED(StartVerifySignatureHdl, LinkParamNone*, bool );
|
||||
DECL_LINK_TYPED(OKButtonHdl, Button*, void );
|
||||
|
||||
void ImplGetSignatureInformations(bool bUseTempStream);
|
||||
|
@@ -105,12 +105,12 @@ private:
|
||||
XSecController* mpXSecController;
|
||||
bool mbError;
|
||||
bool mbODFPre1_2;
|
||||
Link<> maStartVerifySignatureHdl;
|
||||
Link<LinkParamNone*,bool> maStartVerifySignatureHdl;
|
||||
|
||||
private:
|
||||
DECL_LINK( SignatureCreationResultListener, XMLSignatureCreationResult*);
|
||||
DECL_LINK( SignatureVerifyResultListener, XMLSignatureVerifyResult* );
|
||||
DECL_LINK( StartVerifySignatureElement, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >* );
|
||||
DECL_LINK_TYPED( SignatureCreationResultListener, XMLSignatureCreationResult&, void );
|
||||
DECL_LINK_TYPED( SignatureVerifyResultListener, XMLSignatureVerifyResult&, void );
|
||||
DECL_LINK_TYPED( StartVerifySignatureElement, LinkParamNone*, void );
|
||||
|
||||
XMLSignatureHelper(const XMLSignatureHelper&) SAL_DELETED_FUNCTION;
|
||||
|
||||
@@ -130,7 +130,7 @@ public:
|
||||
// Argument for the Link is a uno::Reference< xml::sax::XAttributeList >*
|
||||
// Return 1 to verify, 0 to skip.
|
||||
// Default handler will verify all.
|
||||
void SetStartVerifySignatureHdl( const Link<>& rLink );
|
||||
void SetStartVerifySignatureHdl( const Link<LinkParamNone*,bool>& rLink );
|
||||
|
||||
// Get the security environment
|
||||
::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment > GetSecurityEnvironment();
|
||||
|
@@ -565,9 +565,9 @@ IMPL_LINK_NOARG_TYPED(DigitalSignaturesDialog, RemoveButtonHdl, Button*, void)
|
||||
}
|
||||
}
|
||||
|
||||
IMPL_LINK_NOARG(DigitalSignaturesDialog, StartVerifySignatureHdl)
|
||||
IMPL_LINK_NOARG_TYPED(DigitalSignaturesDialog, StartVerifySignatureHdl, LinkParamNone*, bool)
|
||||
{
|
||||
return mbVerifySignatures ? 1 : 0;
|
||||
return mbVerifySignatures;
|
||||
}
|
||||
|
||||
void DigitalSignaturesDialog::ImplFillSignaturesBox()
|
||||
|
@@ -85,7 +85,7 @@ void XMLSignatureHelper::SetStorage(
|
||||
}
|
||||
|
||||
|
||||
void XMLSignatureHelper::SetStartVerifySignatureHdl( const Link<>& rLink )
|
||||
void XMLSignatureHelper::SetStartVerifySignatureHdl( const Link<LinkParamNone*,bool>& rLink )
|
||||
{
|
||||
maStartVerifySignatureHdl = rLink;
|
||||
}
|
||||
@@ -311,31 +311,27 @@ uno::Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment > XMLSignatu
|
||||
return (mxSecurityContext.is()?(mxSecurityContext->getSecurityEnvironment()): uno::Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment >());
|
||||
}
|
||||
|
||||
IMPL_LINK( XMLSignatureHelper, SignatureCreationResultListener, XMLSignatureCreationResult*, pResult )
|
||||
IMPL_LINK_TYPED( XMLSignatureHelper, SignatureCreationResultListener, XMLSignatureCreationResult&, rResult, void )
|
||||
{
|
||||
maCreationResults.insert( maCreationResults.begin() + maCreationResults.size(), *pResult );
|
||||
if ( pResult->nSignatureCreationResult != com::sun::star::xml::crypto::SecurityOperationStatus_OPERATION_SUCCEEDED )
|
||||
maCreationResults.insert( maCreationResults.begin() + maCreationResults.size(), rResult );
|
||||
if ( rResult.nSignatureCreationResult != com::sun::star::xml::crypto::SecurityOperationStatus_OPERATION_SUCCEEDED )
|
||||
mbError = true;
|
||||
return 0;
|
||||
}
|
||||
|
||||
IMPL_LINK( XMLSignatureHelper, SignatureVerifyResultListener, XMLSignatureVerifyResult*, pResult )
|
||||
IMPL_LINK_TYPED( XMLSignatureHelper, SignatureVerifyResultListener, XMLSignatureVerifyResult&, rResult, void )
|
||||
{
|
||||
maVerifyResults.insert( maVerifyResults.begin() + maVerifyResults.size(), *pResult );
|
||||
if ( pResult->nSignatureVerifyResult != com::sun::star::xml::crypto::SecurityOperationStatus_OPERATION_SUCCEEDED )
|
||||
maVerifyResults.insert( maVerifyResults.begin() + maVerifyResults.size(), rResult );
|
||||
if ( rResult.nSignatureVerifyResult != com::sun::star::xml::crypto::SecurityOperationStatus_OPERATION_SUCCEEDED )
|
||||
mbError = true;
|
||||
return 0;
|
||||
}
|
||||
|
||||
IMPL_LINK( XMLSignatureHelper, StartVerifySignatureElement, const uno::Reference< com::sun::star::xml::sax::XAttributeList >*, pAttrs )
|
||||
IMPL_LINK_NOARG_TYPED( XMLSignatureHelper, StartVerifySignatureElement, LinkParamNone*, void )
|
||||
{
|
||||
if ( !maStartVerifySignatureHdl.IsSet() || maStartVerifySignatureHdl.Call( const_cast<css::uno::Reference<css::xml::sax::XAttributeList> *>(pAttrs) ) )
|
||||
if ( !maStartVerifySignatureHdl.IsSet() || maStartVerifySignatureHdl.Call(nullptr) )
|
||||
{
|
||||
sal_Int32 nSignatureId = mpXSecController->getNewSecurityId();
|
||||
mpXSecController->addSignature( nSignatureId );
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||
|
@@ -32,13 +32,15 @@
|
||||
|
||||
using namespace com::sun::star;
|
||||
|
||||
ImplXMLSignatureListener::ImplXMLSignatureListener(const Link<>& rCreationResultListenerListener, const Link<>& rVerifyResultListenerListener, const Link<>& rStartSignatureElement)
|
||||
ImplXMLSignatureListener::ImplXMLSignatureListener(const Link<XMLSignatureCreationResult&,void>& rCreationResultListenerListener,
|
||||
const Link<XMLSignatureVerifyResult&,void>& rVerifyResultListenerListener,
|
||||
const Link<LinkParamNone*,void>& rStartSignatureElement)
|
||||
{
|
||||
maCreationResultListenerListener = rCreationResultListenerListener;
|
||||
maVerifyResultListenerListener = rVerifyResultListenerListener;
|
||||
maStartVerifySignatureElementListener = rStartSignatureElement;
|
||||
|
||||
}
|
||||
|
||||
ImplXMLSignatureListener::~ImplXMLSignatureListener()
|
||||
{
|
||||
}
|
||||
@@ -53,14 +55,14 @@ void SAL_CALL ImplXMLSignatureListener::signatureCreated( sal_Int32 securityId,
|
||||
throw (com::sun::star::uno::RuntimeException, std::exception)
|
||||
{
|
||||
XMLSignatureCreationResult aResult( securityId, nResult );
|
||||
maCreationResultListenerListener.Call( &aResult );
|
||||
maCreationResultListenerListener.Call( aResult );
|
||||
}
|
||||
|
||||
void SAL_CALL ImplXMLSignatureListener::signatureVerified( sal_Int32 securityId, com::sun::star::xml::crypto::SecurityOperationStatus nResult )
|
||||
throw (com::sun::star::uno::RuntimeException, std::exception)
|
||||
{
|
||||
XMLSignatureVerifyResult aResult( securityId, nResult );
|
||||
maVerifyResultListenerListener.Call( &aResult );
|
||||
maVerifyResultListenerListener.Call( aResult );
|
||||
}
|
||||
|
||||
// XDocumentHandler
|
||||
@@ -82,12 +84,12 @@ void SAL_CALL ImplXMLSignatureListener::endDocument( )
|
||||
}
|
||||
}
|
||||
|
||||
void SAL_CALL ImplXMLSignatureListener::startElement( const OUString& aName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttribs )
|
||||
void SAL_CALL ImplXMLSignatureListener::startElement( const OUString& aName, const css::uno::Reference< css::xml::sax::XAttributeList >& xAttribs )
|
||||
throw (com::sun::star::xml::sax::SAXException, com::sun::star::uno::RuntimeException, std::exception)
|
||||
{
|
||||
if ( aName == "Signature" )
|
||||
{
|
||||
maStartVerifySignatureElementListener.Call( const_cast<css::uno::Reference<css::xml::sax::XAttributeList> *>(&xAttribs) );
|
||||
maStartVerifySignatureElementListener.Call( nullptr );
|
||||
}
|
||||
|
||||
if (m_xNextHandler.is())
|
||||
|
@@ -48,15 +48,17 @@ class ImplXMLSignatureListener : public cppu::WeakImplHelper
|
||||
>
|
||||
{
|
||||
private:
|
||||
Link<> maCreationResultListenerListener;
|
||||
Link<> maVerifyResultListenerListener;
|
||||
Link<> maStartVerifySignatureElementListener;
|
||||
Link<XMLSignatureCreationResult&,void> maCreationResultListenerListener;
|
||||
Link<XMLSignatureVerifyResult&,void> maVerifyResultListenerListener;
|
||||
Link<LinkParamNone*,void> maStartVerifySignatureElementListener;
|
||||
|
||||
com::sun::star::uno::Reference<
|
||||
com::sun::star::xml::sax::XDocumentHandler > m_xNextHandler;
|
||||
|
||||
public:
|
||||
ImplXMLSignatureListener(const Link<>& rCreationResultListenerListener, const Link<>& rVerifyResultListenerListener, const Link<>& rStartVerifySignatureElement);
|
||||
ImplXMLSignatureListener(const Link<XMLSignatureCreationResult&,void>& rCreationResultListenerListener,
|
||||
const Link<XMLSignatureVerifyResult&,void>& rVerifyResultListenerListener,
|
||||
const Link<LinkParamNone*, void>& rStartVerifySignatureElement);
|
||||
virtual ~ImplXMLSignatureListener();
|
||||
|
||||
void setNextHandler(com::sun::star::uno::Reference<
|
||||
|
Reference in New Issue
Block a user