summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiuseppe Castagno <giuseppe.castagno@acca-esse.eu>2016-03-17 11:09:32 +0100
committerjan iversen <jani@documentfoundation.org>2016-04-15 10:04:36 +0000
commit70bb8c257e7fc402da60fa70109cece1fe4c69d1 (patch)
tree12b47367ef2b1969719f1ccca1f030a8e8f57cf4
parentc5f7d39ccc54869a19b0e5f65a94b2b5919ca014 (diff)
Related tdf#88502 Add default XCommandEnvironment to ...
... Content::getResourceType During WebDAV operation the css::ucb::XCommandEnvironment is almost always needed. Depending on the operation, sometimes the client doesn't set it, in order to disable the exception processing that takes part in ucbhelper::cancelCommandExecution. Change-Id: Ib4bf6a7ca3a902437cab9050c3e310342c655ff2 Reviewed-on: https://gerrit.libreoffice.org/23327 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: jan iversen <jani@documentfoundation.org>
-rw-r--r--ucb/source/ucp/webdav-neon/webdavcontent.cxx24
1 files changed, 23 insertions, 1 deletions
diff --git a/ucb/source/ucp/webdav-neon/webdavcontent.cxx b/ucb/source/ucp/webdav-neon/webdavcontent.cxx
index 50dc91cccfe0..50dce422bb68 100644
--- a/ucb/source/ucp/webdav-neon/webdavcontent.cxx
+++ b/ucb/source/ucp/webdav-neon/webdavcontent.cxx
@@ -51,6 +51,7 @@
#include <com/sun/star/io/XOutputStream.hpp>
#include <com/sun/star/lang/IllegalAccessException.hpp>
#include <com/sun/star/task/PasswordContainerInteractionHandler.hpp>
+#include <com/sun/star/task/InteractionHandler.hpp>
#include <com/sun/star/ucb/CommandEnvironment.hpp>
#include <com/sun/star/ucb/CommandFailedException.hpp>
#include <com/sun/star/ucb/ContentInfoAttribute.hpp>
@@ -3436,6 +3437,27 @@ Content::ResourceType Content::getResourceType(
}
else
{
+ // In case xEnv is present, uses the interaction handler provided
+ // in xEnv.
+ // In case xEnv is not present, supply a command env to PROPFIND()
+ // that contains an interaction handler in order to activate the
+ // credential dialog if the server request them.
+ // The command env is needed by lower level function for examples as
+ // NeonSession_CertificationNotify where it is used to check the server
+ // certificate or ask the user for a manual confirmation if the certificate
+ // needs the user visual check.
+ // xEnv is still used in cancelCommandExecution(), so the cancelling operates
+ // as the client application (e.g. framework) requested.
+ css::uno::Reference< css::ucb::XCommandEnvironment > xAuthEnv( xEnv );
+ if( !xAuthEnv.is() )
+ {
+ css:: uno::Reference< task::XInteractionHandler > xIH(
+ css::task::InteractionHandler::createWithParent( m_xContext, nullptr ), css::uno::UNO_QUERY_THROW );
+
+ xAuthEnv = css::ucb::CommandEnvironment::create(
+ m_xContext, xIH, css::uno::Reference< ucb::XProgressHandler >() ) ;
+ }
+
try
{
// Try to fetch some frequently used property value, e.g. those
@@ -3452,7 +3474,7 @@ Content::ResourceType Content::getResourceType(
ContentProperties::UCBNamesToDAVNames( aProperties, aPropNames );
- rResAccess->PROPFIND( DAVZERO, aPropNames, resources, xEnv );
+ rResAccess->PROPFIND( DAVZERO, aPropNames, resources, xAuthEnv );
if ( resources.size() == 1 )
{