summaryrefslogtreecommitdiff
path: root/ucb/source
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-23 10:47:35 +0200
commit96e23564e95d2ecc5483e55b022c8a4db04d116b (patch)
tree9d6f5afcab1a8ddec1c654588813c4abadc2609c /ucb/source
parente787a84c69b1e557f32de348d2efd5879c7ca222 (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. Change-Id: Ia434a707d2946a6982075f9bf53904b78dc07a5e
Diffstat (limited to 'ucb/source')
-rw-r--r--ucb/source/ucp/webdav/webdavcontent.cxx16
-rw-r--r--ucb/source/ucp/webdav/webdavcontent.hxx3
2 files changed, 12 insertions, 7 deletions
diff --git a/ucb/source/ucp/webdav/webdavcontent.cxx b/ucb/source/ucp/webdav/webdavcontent.cxx
index b783e166a52a..dbc13b74b9a2 100644
--- a/ucb/source/ucp/webdav/webdavcontent.cxx
+++ b/ucb/source/ucp/webdav/webdavcontent.cxx
@@ -1371,14 +1371,12 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues(
if ( !m_bTransient && !bHasAll )
{
-
// Obtain values from server...
// 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 )
{
@@ -3321,15 +3319,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
{
@@ -3372,6 +3370,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 f9daf3d78ea7..04a115bfdea3 100644
--- a/ucb/source/ucp/webdav/webdavcontent.hxx
+++ b/ucb/source/ucp/webdav/webdavcontent.hxx
@@ -132,7 +132,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"