diff options
author | Noel Grandin <noel@peralex.com> | 2012-09-04 11:42:03 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-09-04 16:41:37 +0200 |
commit | 197a79e57131c976a489882479a679ba2ab61b82 (patch) | |
tree | a97c4d81a9a2549b9463ad9a06ba5ebf10cf02bc /uui/source | |
parent | ba425a1788421b63caa84ac364341bac2f88f103 (diff) |
fdo#46808, Adapt DocumentDigitalSignatures UNO service to new style
Rename service from "Decryptor" to "DocumentDigitalSignatures" to be consistent
with the other UNO services, and with it's own header file name.
Add service constructor for passing in arguments.
Change-Id: Iaca0c40bb2f1a1af2ef9ca29361bfd023ade2678
Diffstat (limited to 'uui/source')
-rw-r--r-- | uui/source/secmacrowarnings.cxx | 25 | ||||
-rw-r--r-- | uui/source/sslwarndlg.cxx | 6 | ||||
-rw-r--r-- | uui/source/unknownauthdlg.cxx | 5 |
3 files changed, 17 insertions, 19 deletions
diff --git a/uui/source/secmacrowarnings.cxx b/uui/source/secmacrowarnings.cxx index 14e5c3d199e0..12ff096200fc 100644 --- a/uui/source/secmacrowarnings.cxx +++ b/uui/source/secmacrowarnings.cxx @@ -19,7 +19,7 @@ #include <com/sun/star/xml/crypto/XSecurityEnvironment.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> -#include <com/sun/star/security/XDocumentDigitalSignatures.hpp> +#include <com/sun/star/security/DocumentDigitalSignatures.hpp> #include <comphelper/sequence.hxx> #include "comphelper/documentconstants.hxx" #include <comphelper/processfactory.hxx> @@ -116,7 +116,7 @@ IMPL_LINK_NOARG(MacroWarning, ViewSignsBtnHdl) uno::Sequence< uno::Any > aArgs( 1 ); aArgs[0] = uno::makeAny( maODFVersion ); uno::Reference< security::XDocumentDigitalSignatures > xD( - comphelper::getProcessServiceFactory()->createInstanceWithArguments( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.security.DocumentDigitalSignatures" ) ), aArgs ), uno::UNO_QUERY ); + security::DocumentDigitalSignatures::createDefault(comphelper::getProcessComponentContext()) ); if( xD.is() ) { if( mxCert.is() ) @@ -135,19 +135,16 @@ IMPL_LINK_NOARG(MacroWarning, EnableBtnHdl) uno::Sequence< uno::Any > aArgs( 1 ); aArgs[0] = uno::makeAny( maODFVersion ); uno::Reference< security::XDocumentDigitalSignatures > xD( - comphelper::getProcessServiceFactory()->createInstanceWithArguments( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.security.DocumentDigitalSignatures" ) ), aArgs ), uno::UNO_QUERY ); - if( xD.is() ) + security::DocumentDigitalSignatures::createDefault(comphelper::getProcessComponentContext()) ); + if( mxCert.is() ) + xD->addAuthorToTrustedSources( mxCert ); + else if( mxStore.is() ) { - if( mxCert.is() ) - xD->addAuthorToTrustedSources( mxCert ); - else if( mxStore.is() ) - { - DBG_ASSERT( mpInfos, "-MacroWarning::EnableBtnHdl(): no infos, search in nirvana..." ); - - sal_Int32 nCnt = mpInfos->getLength(); - for( sal_Int32 i = 0 ; i < nCnt ; ++i ) - xD->addAuthorToTrustedSources( (*mpInfos)[ i ].Signer ); - } + DBG_ASSERT( mpInfos, "-MacroWarning::EnableBtnHdl(): no infos, search in nirvana..." ); + + sal_Int32 nCnt = mpInfos->getLength(); + for( sal_Int32 i = 0 ; i < nCnt ; ++i ) + xD->addAuthorToTrustedSources( (*mpInfos)[ i ].Signer ); } } diff --git a/uui/source/sslwarndlg.cxx b/uui/source/sslwarndlg.cxx index 172b11df91f6..eba78e197b47 100644 --- a/uui/source/sslwarndlg.cxx +++ b/uui/source/sslwarndlg.cxx @@ -23,7 +23,8 @@ #include <sslwarndlg.hrc> #include <sslwarndlg.hxx> -#include <com/sun/star/security/XDocumentDigitalSignatures.hpp> +#include <comphelper/componentcontext.hxx> +#include <com/sun/star/security/DocumentDigitalSignatures.hpp> // ----------------------------------------------------------------------- @@ -39,8 +40,7 @@ IMPL_LINK_NOARG(SSLWarnDialog, ViewCertHdl_Impl) { uno::Reference< ::com::sun::star::security::XDocumentDigitalSignatures > xDocumentDigitalSignatures; - xDocumentDigitalSignatures = uno::Reference< ::com::sun::star::security::XDocumentDigitalSignatures >( - getServiceFactory().get()->createInstance( rtl::OUString( "com.sun.star.security.DocumentDigitalSignatures" )), uno::UNO_QUERY ); + xDocumentDigitalSignatures = ::com::sun::star::security::DocumentDigitalSignatures::createDefault( comphelper::ComponentContext(getServiceFactory()).getUNOContext() ); xDocumentDigitalSignatures.get()->showCertificate(getCert()); diff --git a/uui/source/unknownauthdlg.cxx b/uui/source/unknownauthdlg.cxx index 17f1464a1e07..c53e5bb8d0bf 100644 --- a/uui/source/unknownauthdlg.cxx +++ b/uui/source/unknownauthdlg.cxx @@ -22,8 +22,9 @@ #include <ids.hrc> #include <unknownauthdlg.hrc> #include <unknownauthdlg.hxx> +#include <comphelper/componentcontext.hxx> -#include <com/sun/star/security/XDocumentDigitalSignatures.hpp> +#include <com/sun/star/security/DocumentDigitalSignatures.hpp> // ----------------------------------------------------------------------- @@ -47,7 +48,7 @@ IMPL_LINK_NOARG(UnknownAuthDialog, ViewCertHdl_Impl) uno::Reference< ::com::sun::star::security::XDocumentDigitalSignatures > xDocumentDigitalSignatures; xDocumentDigitalSignatures = uno::Reference< ::com::sun::star::security::XDocumentDigitalSignatures >( - getServiceFactory().get()->createInstance( rtl::OUString( "com.sun.star.security.DocumentDigitalSignatures" )), uno::UNO_QUERY ); + ::com::sun::star::security::DocumentDigitalSignatures::createDefault(comphelper::ComponentContext(getServiceFactory()).getUNOContext()) ); xDocumentDigitalSignatures.get()->showCertificate(getCert()); |