summaryrefslogtreecommitdiff
path: root/uui/source/iahndl.cxx
diff options
context:
space:
mode:
authorIvo Hinkelmann <ihi@openoffice.org>2007-11-21 15:23:17 +0000
committerIvo Hinkelmann <ihi@openoffice.org>2007-11-21 15:23:17 +0000
commit85bb3366a7910375f08cc2a3bcbd7c0179ced850 (patch)
tree754d46516f605fed1c776eebc739abf6427a5b5e /uui/source/iahndl.cxx
parent4172f35bfefd828622c9055273855baf41fcf165 (diff)
INTEGRATION: CWS dba24c (1.62.14); FILE MERGED
2007/10/10 13:13:27 fs 1.62.14.1: in preparation of #i73705#/#i52527#: Macro Warning dialog is now available at the default interaction handler
Diffstat (limited to 'uui/source/iahndl.cxx')
-rw-r--r--uui/source/iahndl.cxx64
1 files changed, 62 insertions, 2 deletions
diff --git a/uui/source/iahndl.cxx b/uui/source/iahndl.cxx
index 564187dbda..ce2a1f2595 100644
--- a/uui/source/iahndl.cxx
+++ b/uui/source/iahndl.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: iahndl.cxx,v $
*
- * $Revision: 1.64 $
+ * $Revision: 1.65 $
*
- * last change: $Author: rt $ $Date: 2007-11-13 14:19:44 $
+ * last change: $Author: ihi $ $Date: 2007-11-21 16:23:17 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -59,6 +59,7 @@
#include "com/sun/star/lang/XMultiServiceFactory.hpp"
#include "com/sun/star/script/ModuleSizeExceededRequest.hpp"
#include "com/sun/star/sync2/BadPartnershipException.hpp"
+#include "com/sun/star/task/DocumentMacroConfirmationRequest.hpp"
#include "com/sun/star/task/DocumentPasswordRequest.hpp"
#include "com/sun/star/task/ErrorCodeIOException.hpp"
#include "com/sun/star/task/ErrorCodeRequest.hpp"
@@ -114,6 +115,7 @@
#include "ids.hrc"
#include "cookiedg.hxx"
+#include "secmacrowarnings.hxx"
#include "masterpasscrtdlg.hxx"
#include "masterpassworddlg.hxx"
#include "logindlg.hxx"
@@ -1172,6 +1174,16 @@ void UUIInteractionHelper::handleErrorHandlerRequests(
rErrorString);
return;
}
+
+ star::task::DocumentMacroConfirmationRequest aMacroConfirmRequest;
+ if (aAnyRequest >>= aMacroConfirmRequest)
+ {
+ handleMacroConfirmRequest(
+ aMacroConfirmRequest,
+ rRequest->getContinuations()
+ );
+ return;
+ }
star::task::ErrorCodeIOException aErrorCodeIOException;
if (aAnyRequest >>= aErrorCodeIOException)
@@ -2778,6 +2790,54 @@ UUIInteractionHelper::handleGenericErrorRequest(
}
void
+UUIInteractionHelper::handleMacroConfirmRequest(
+ const star::task::DocumentMacroConfirmationRequest& _rRequest,
+ star::uno::Sequence< star::uno::Reference<
+ star::task::XInteractionContinuation > > const & rContinuations
+)
+ SAL_THROW((star::uno::RuntimeException))
+{
+ star::uno::Reference< star::task::XInteractionAbort > xAbort;
+ star::uno::Reference< star::task::XInteractionApprove > xApprove;
+
+ sal_Int32 nCount = rContinuations.getLength();
+ for( sal_Int32 nStep=0; nStep<nCount; ++nStep )
+ {
+ if( !xAbort.is() )
+ xAbort = star::uno::Reference< star::task::XInteractionAbort >( rContinuations[nStep], star::uno::UNO_QUERY );
+
+ if( !xApprove.is() )
+ xApprove = star::uno::Reference< star::task::XInteractionApprove >( rContinuations[nStep], star::uno::UNO_QUERY );
+ }
+
+ bool bApprove = false;
+
+ std::auto_ptr< ResMgr > pResMgr( ResMgr::CreateResMgr( CREATEVERSIONRESMGR_NAME( uui ) ) );
+ if ( pResMgr.get() )
+ {
+ bool bShowSignatures = _rRequest.DocumentSignatureInformation.getLength() > 0;
+ MacroWarning aWarning( getParentProperty(), bShowSignatures, *pResMgr.get() );
+
+ aWarning.SetDocumentURL( _rRequest.DocumentURL );
+ if ( _rRequest.DocumentSignatureInformation.getLength() > 1 )
+ {
+ aWarning.SetStorage( _rRequest.DocumentStorage, _rRequest.DocumentSignatureInformation );
+ }
+ else if ( _rRequest.DocumentSignatureInformation.getLength() == 1 )
+ {
+ aWarning.SetCertificate( _rRequest.DocumentSignatureInformation[ 0 ].Signer );
+ }
+
+ bApprove = aWarning.Execute() == RET_OK;
+ }
+
+ if ( bApprove && xApprove.is() )
+ xApprove->select();
+ else if ( xAbort.is() )
+ xAbort->select();
+}
+
+void
UUIInteractionHelper::handleFilterOptionsRequest(
star::document::FilterOptionsRequest const & rRequest,
star::uno::Sequence< star::uno::Reference<