summaryrefslogtreecommitdiff
path: root/comphelper
diff options
context:
space:
mode:
authorGiuseppe Castagno <giuseppe.castagno@acca-esse.eu>2015-07-18 18:29:13 +0200
committerMichael Meeks <michael.meeks@collabora.com>2015-07-22 16:17:04 +0000
commitbc9a8ddbb7081f79e915c841e56fd1c40f0df6f9 (patch)
tree952e65dd815f91b23689251da794d1ff2a609119 /comphelper
parent786573068dce1f71c53057f98b5822c401c9f3ff (diff)
tdf#82744: fix WebDAV lock/unlock behaviour - part 2
Changes done to the code in framework, comphelper and unotools, in no particular order - add an interaction handler dedicated to WebDAV The stock interaction handler can be missing depending on the need of the framework performing its tasks, so a dedicated handler is provided, this one is always present. - force opening of a WebDAV file. A WebDAV file sould be open r/o even if explicitly requested to open as r/w. This is a limitation of current WebDAV implementation, not of the standard. This change is needed in order to reopen correctly a file as requested by a 'Edit Mode' GUI command. Change-Id: I5368fa2c0511f1630e6d6139c6a986d33aa19082 Reviewed-on: https://gerrit.libreoffice.org/17182 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'comphelper')
-rw-r--r--comphelper/source/misc/stillreadwriteinteraction.cxx26
1 files changed, 25 insertions, 1 deletions
diff --git a/comphelper/source/misc/stillreadwriteinteraction.cxx b/comphelper/source/misc/stillreadwriteinteraction.cxx
index 1ad24fa2fed2..2dbe73cbf4e8 100644
--- a/comphelper/source/misc/stillreadwriteinteraction.cxx
+++ b/comphelper/source/misc/stillreadwriteinteraction.cxx
@@ -23,14 +23,20 @@
#include <com/sun/star/task/XInteractionAbort.hpp>
+#include <com/sun/star/task/XInteractionApprove.hpp>
+
#include <com/sun/star/ucb/UnsupportedDataSinkException.hpp>
+#include <com/sun/star/ucb/AuthenticationRequest.hpp>
+
namespace comphelper{
-StillReadWriteInteraction::StillReadWriteInteraction(const css::uno::Reference< css::task::XInteractionHandler >& xHandler)
+StillReadWriteInteraction::StillReadWriteInteraction(const css::uno::Reference< css::task::XInteractionHandler >& xHandler,
+ const css::uno::Reference< css::task::XInteractionHandler >& xAuthenticationHandler)
: m_bUsed (false)
, m_bHandledByMySelf (false)
, m_bHandledByInternalHandler(false)
+ , m_xAuthenticationHandler(xAuthenticationHandler)
{
::std::vector< ::ucbhelper::InterceptedInteraction::InterceptedRequest > lInterceptions;
::ucbhelper::InterceptedInteraction::InterceptedRequest aInterceptedRequest;
@@ -47,6 +53,12 @@ StillReadWriteInteraction::StillReadWriteInteraction(const css::uno::Reference<
aInterceptedRequest.MatchExact = false;
lInterceptions.push_back(aInterceptedRequest);
+ aInterceptedRequest.Handle = HANDLE_AUTHENTICATIONREQUESTEXCEPTION;
+ aInterceptedRequest.Request <<= css::ucb::AuthenticationRequest();
+ aInterceptedRequest.Continuation = cppu::UnoType<css::task::XInteractionApprove>::get();
+ aInterceptedRequest.MatchExact = false;
+ lInterceptions.push_back(aInterceptedRequest);
+
setInterceptedHandler(xHandler);
setInterceptions(lInterceptions);
}
@@ -96,6 +108,18 @@ ucbhelper::InterceptedInteraction::EInterceptionState StillReadWriteInteraction:
bAbort = true;
}
break;
+ case HANDLE_AUTHENTICATIONREQUESTEXCEPTION:
+ {
+//use internal authentication dedicated handler and return
+ if (m_xAuthenticationHandler.is())
+ {
+ m_xAuthenticationHandler->handle(xRequest);
+ return ::ucbhelper::InterceptedInteraction::E_INTERCEPTED;
+ }
+ else //simply abort
+ bAbort = true;
+ }
+ break;
}
// handle interaction by ourself