summaryrefslogtreecommitdiff
path: root/ucb
diff options
context:
space:
mode:
authorMatúš Kukan <matus.kukan@collabora.com>2014-06-23 10:39:49 +0200
committerMatúš Kukan <matus.kukan@collabora.com>2014-06-24 17:32:01 +0200
commita794701a672b7fbb092f42124cbf83439a88288e (patch)
tree17a15601690f5e981fa3822602fd726641f0f2d5 /ucb
parent15dd69fbee91427931243bdd71f8d388280c97f2 (diff)
webdav: Do not throw when saving new document.
Propagate information about !shouldAccessNetworkAfterException from getResourceType out to getPropertyValues, to avoid further calls which would result in cancelCommandExecution, when trying get properties of document which does not exist yet, but we want to create it. This was done in webdav-neon for other reasons as part of 0c3500115c4fd86284a027fc32be704afcf77061. (cherry picked from commit 96e23564e95d2ecc5483e55b022c8a4db04d116b) Conflicts: ucb/source/ucp/webdav/webdavcontent.cxx Change-Id: Ia434a707d2946a6982075f9bf53904b78dc07a5e
Diffstat (limited to 'ucb')
-rw-r--r--ucb/source/ucp/webdav/webdavcontent.cxx15
-rw-r--r--ucb/source/ucp/webdav/webdavcontent.hxx3
2 files changed, 12 insertions, 6 deletions
diff --git a/ucb/source/ucp/webdav/webdavcontent.cxx b/ucb/source/ucp/webdav/webdavcontent.cxx
index c1ac9f94e4c0..f6de8ae77159 100644
--- a/ucb/source/ucp/webdav/webdavcontent.cxx
+++ b/ucb/source/ucp/webdav/webdavcontent.cxx
@@ -1399,9 +1399,8 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues(
/////////////////////////////////////////////////////////////////////
// First, identify whether resource is DAV or not
- const ResourceType & rType = getResourceType( xEnv, xResAccess );
-
bool bNetworkAccessAllowed = true;
+ const ResourceType & rType = getResourceType( xEnv, xResAccess, &bNetworkAccessAllowed );
if ( DAV == rType )
{
@@ -3364,15 +3363,15 @@ Content::getBaseURI( const boost::scoped_ptr< DAVResourceAccess > & rResAccess )
//=========================================================================
const Content::ResourceType & Content::getResourceType(
const uno::Reference< ucb::XCommandEnvironment >& xEnv,
- const boost::scoped_ptr< DAVResourceAccess > & rResAccess )
+ const boost::scoped_ptr< DAVResourceAccess > & rResAccess,
+ bool * networkAccessAllowed )
throw ( uno::Exception )
{
if ( m_eResourceType == UNKNOWN )
{
osl::Guard< osl::Mutex > aGuard( m_aMutex );
- ResourceType eResourceType;
- eResourceType = m_eResourceType;
+ ResourceType eResourceType = UNKNOWN;
try
{
@@ -3420,6 +3419,12 @@ const Content::ResourceType & Content::getResourceType(
// resource is NON_DAV
eResourceType = NON_DAV;
}
+ else if (networkAccessAllowed != 0)
+ {
+ *networkAccessAllowed = *networkAccessAllowed
+ && shouldAccessNetworkAfterException(e);
+ }
+
// cancel command execution is case that no user authentication data has been provided.
if ( e.getError() == DAVException::DAV_HTTP_NOAUTH )
{
diff --git a/ucb/source/ucp/webdav/webdavcontent.hxx b/ucb/source/ucp/webdav/webdavcontent.hxx
index 32801be77a5b..b36d88d359fb 100644
--- a/ucb/source/ucp/webdav/webdavcontent.hxx
+++ b/ucb/source/ucp/webdav/webdavcontent.hxx
@@ -133,7 +133,8 @@ private:
const ResourceType &
getResourceType( const ::com::sun::star::uno::Reference<
::com::sun::star::ucb::XCommandEnvironment >& xEnv,
- const boost::scoped_ptr< DAVResourceAccess > & rResAccess )
+ const boost::scoped_ptr< DAVResourceAccess > & rResAccess,
+ bool * networkAccessAllowed = 0 )
throw ( ::com::sun::star::uno::Exception );
// Command "open"