sfx2/source/doc/guisaveas.cxx | 5 ++- xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.cxx | 24 +++++++++-------- 2 files changed, 16 insertions(+), 13 deletions(-)
New commits: commit 40d52cfe3b64e6bac035caed825486546bba5280 Author: Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk> AuthorDate: Thu Nov 29 22:06:02 2018 +0100 Commit: Tomaž Vajngerl <qui...@gmail.com> CommitDate: Sat Dec 1 09:07:49 2018 +0100 xmlsecurity: clean-up code a bit Change-Id: I4a43f1f33f73919f56150310e7d05244d81b7510 Reviewed-on: https://gerrit.libreoffice.org/64294 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <qui...@gmail.com> diff --git a/xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.cxx index 1dc7b735c94e..311ce6aeb69f 100644 --- a/xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.cxx +++ b/xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.cxx @@ -135,7 +135,7 @@ SAL_CALL XMLSignature_NssImpl::generate( if( pSecEnv == nullptr ) throw RuntimeException() ; - setErrorRecorder(); + setErrorRecorder(); std::unique_ptr<xmlSecKeysMngr> pMngr(pSecEnv->createKeysManager()); if( !pMngr ) { @@ -283,25 +283,27 @@ SAL_CALL XMLSignature_NssImpl::validate( } /* XServiceInfo */ -OUString SAL_CALL XMLSignature_NssImpl::getImplementationName() { +OUString SAL_CALL XMLSignature_NssImpl::getImplementationName() +{ return OUString("com.sun.star.xml.crypto.XMLSignature"); } /* XServiceInfo */ -sal_Bool SAL_CALL XMLSignature_NssImpl::supportsService( const OUString& serviceName) { - Sequence< OUString > seqServiceNames = getSupportedServiceNames() ; - const OUString* pArray = seqServiceNames.getConstArray() ; - for( sal_Int32 i = 0 ; i < seqServiceNames.getLength() ; i ++ ) { - if( *( pArray + i ) == serviceName ) - return true ; +sal_Bool SAL_CALL XMLSignature_NssImpl::supportsService(const OUString& rServiceName) +{ + for (OUString const & rCurrentServiceName : getSupportedServiceNames()) + { + if (rCurrentServiceName == rServiceName) + return true; } - return false ; + return false; } /* XServiceInfo */ -Sequence< OUString > SAL_CALL XMLSignature_NssImpl::getSupportedServiceNames() { +Sequence<OUString> SAL_CALL XMLSignature_NssImpl::getSupportedServiceNames() +{ Sequence<OUString> seqServiceNames { "com.sun.star.xml.crypto.XMLSignature" }; - return seqServiceNames ; + return seqServiceNames; } extern "C" SAL_DLLPUBLIC_EXPORT uno::XInterface* commit c2ee336288dcee103f297a55287fbca596a6c7a1 Author: Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk> AuthorDate: Thu Nov 29 21:58:57 2018 +0100 Commit: Tomaž Vajngerl <qui...@gmail.com> CommitDate: Sat Dec 1 09:07:42 2018 +0100 lokit: disable triggering of GUI when changing a signed doc When a signed document is changed and saved, the dialog pops up on the GUI to warn that the signature will be removed. When saving over the lokit this dialog isn't shown and assumes that we don't want to save (throws an exception) which means we can't save the document ever. This changes the behavior so that we allow removal of the signature and saving can proceed. Change-Id: I52e4a53f0cd3a326c767daee6301a78122af09d4 Reviewed-on: https://gerrit.libreoffice.org/64293 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <qui...@gmail.com> diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx index c9692ca90d8c..0e78de6ff18e 100644 --- a/sfx2/source/doc/guisaveas.cxx +++ b/sfx2/source/doc/guisaveas.cxx @@ -67,6 +67,7 @@ #include <comphelper/propertysequence.hxx> #include <comphelper/sequenceashashmap.hxx> #include <comphelper/mimeconfighelper.hxx> +#include <comphelper/lok.hxx> #include <vcl/weld.hxx> #include <vcl/window.hxx> #include <toolkit/awt/vclxwindow.hxx> @@ -1369,7 +1370,7 @@ bool SfxStoringHelper::GUIStoreModel( const uno::Reference< frame::XModel >& xMo } } - if ( !( nStoreMode & EXPORT_REQUESTED ) ) + if (!comphelper::LibreOfficeKit::isActive() && !( nStoreMode & EXPORT_REQUESTED ) ) { // if it is no export, warn user that the signature will be removed if ( SignatureState::OK == nDocumentSignatureState @@ -1383,7 +1384,7 @@ bool SfxStoringHelper::GUIStoreModel( const uno::Reference< frame::XModel >& xMo { // the user has decided not to store the document throw task::ErrorCodeIOException( - "SfxStoringHelper::GUIStoreModel: ERRCODE_IO_ABORT", + "SfxStoringHelper::GUIStoreModel: ERRCODE_IO_ABORT (Preserve Signature)", uno::Reference< uno::XInterface >(), sal_uInt32(ERRCODE_IO_ABORT)); } } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits