diff options
author | Matúš Kukan <matus.kukan@collabora.com> | 2014-06-23 10:39:49 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2014-07-11 10:47:55 +0000 |
commit | d2001cad7f117de66837a884ec5185cb473216e3 (patch) | |
tree | 8a61dd578efcd8db119daea03bd7847dc2d7d350 /ucb/source | |
parent | e4ef020b7e7c4d97136dc69f97ddfee44c8fdae5 (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
(cherry picked from commit 96e23564e95d2ecc5483e55b022c8a4db04d116b)
Reviewed-on: https://gerrit.libreoffice.org/9888
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'ucb/source')
-rw-r--r-- | ucb/source/ucp/webdav/webdavcontent.cxx | 16 | ||||
-rw-r--r-- | ucb/source/ucp/webdav/webdavcontent.hxx | 3 |
2 files changed, 12 insertions, 7 deletions
diff --git a/ucb/source/ucp/webdav/webdavcontent.cxx b/ucb/source/ucp/webdav/webdavcontent.cxx index 3d720b718077..8cc72bbbc3c8 100644 --- a/ucb/source/ucp/webdav/webdavcontent.cxx +++ b/ucb/source/ucp/webdav/webdavcontent.cxx @@ -1375,14 +1375,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 ) { @@ -3327,15 +3325,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 { @@ -3378,6 +3376,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 daa948cff897..f6e06394ab33 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" |