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 /sfx2/source/doc/docmacromode.cxx | |
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 'sfx2/source/doc/docmacromode.cxx')
-rw-r--r-- | sfx2/source/doc/docmacromode.cxx | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/sfx2/source/doc/docmacromode.cxx b/sfx2/source/doc/docmacromode.cxx index dc6395ef294a..47547569f58b 100644 --- a/sfx2/source/doc/docmacromode.cxx +++ b/sfx2/source/doc/docmacromode.cxx @@ -26,7 +26,7 @@ #include <com/sun/star/task/ErrorCodeRequest.hpp> #include <com/sun/star/task/DocumentMacroConfirmationRequest.hpp> #include <com/sun/star/task/InteractionClassification.hpp> -#include <com/sun/star/security/XDocumentDigitalSignatures.hpp> +#include <com/sun/star/security/DocumentDigitalSignatures.hpp> #include <com/sun/star/script/XLibraryQueryExecutable.hpp> #include <com/sun/star/script/vba/XVBACompatibility.hpp> @@ -56,6 +56,7 @@ namespace sfx2 using ::com::sun::star::task::DocumentMacroConfirmationRequest; using ::com::sun::star::task::ErrorCodeRequest; using ::com::sun::star::uno::Exception; + using ::com::sun::star::security::DocumentDigitalSignatures; using ::com::sun::star::security::XDocumentDigitalSignatures; using ::com::sun::star::security::DocumentSignatureInformation; using ::com::sun::star::embed::XStorage; @@ -224,20 +225,16 @@ namespace sfx2 // get document location from medium name and check whether it is a trusted one // the service is created ohne document version, since it is not of interest here - ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() ); - Reference< XDocumentDigitalSignatures > xSignatures; - if ( aContext.createComponent( "com.sun.star.security.DocumentDigitalSignatures", xSignatures ) ) - { - INetURLObject aURLReferer( sReferrer ); + Reference< XDocumentDigitalSignatures > xSignatures(DocumentDigitalSignatures::createDefault(::comphelper::getProcessComponentContext())); + INetURLObject aURLReferer( sReferrer ); - ::rtl::OUString aLocation; - if ( aURLReferer.removeSegment() ) - aLocation = aURLReferer.GetMainURL( INetURLObject::NO_DECODE ); + ::rtl::OUString aLocation; + if ( aURLReferer.removeSegment() ) + aLocation = aURLReferer.GetMainURL( INetURLObject::NO_DECODE ); - if ( !aLocation.isEmpty() && xSignatures->isLocationTrusted( aLocation ) ) - { - return allowMacroExecution(); - } + if ( !aLocation.isEmpty() && xSignatures->isLocationTrusted( aLocation ) ) + { + return allowMacroExecution(); } // at this point it is clear that the document is not in the secure location |