diff options
author | Giuseppe Castagno <giuseppe.castagno@acca-esse.eu> | 2015-12-27 11:19:39 +0100 |
---|---|---|
committer | jan iversen <jani@documentfoundation.org> | 2016-01-08 10:50:14 +0000 |
commit | 5fc2910fc872bbd1184aaab7c842dff593d2449b (patch) | |
tree | 461c3c8e6d36753eafe2bae09bb9cd63b4753188 /ucb | |
parent | faa767dbef7ee9a0a7ab80bf4ad0fb529cec54a8 (diff) |
tdf#96669: IsDocument should be true only if the document exists
Fixes a problem with Save to remote server dialog.
Change-Id: I4ef2dbf12bb786f5617cb57ff021012e4d884230
Reviewed-on: https://gerrit.libreoffice.org/21010
Reviewed-by: jan iversen <jani@documentfoundation.org>
Tested-by: jan iversen <jani@documentfoundation.org>
Diffstat (limited to 'ucb')
-rw-r--r-- | ucb/source/ucp/webdav-neon/webdavcontent.cxx | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/ucb/source/ucp/webdav-neon/webdavcontent.cxx b/ucb/source/ucp/webdav-neon/webdavcontent.cxx index d7fe64451b89..85ef1ed9eaef 100644 --- a/ucb/source/ucp/webdav-neon/webdavcontent.cxx +++ b/ucb/source/ucp/webdav-neon/webdavcontent.cxx @@ -865,6 +865,7 @@ void Content::addProperty( const ucb::PropertyCommandArgument& aCmdArg, switch ( eType ) { case UNKNOWN: + case NOT_FOUND: case DAV: throw lang::IllegalArgumentException(); @@ -953,6 +954,7 @@ void Content::removeProperty( const OUString& Name, switch ( eType ) { case UNKNOWN: + case NOT_FOUND: case DAV: throw beans::UnknownPropertyException(); @@ -1439,7 +1441,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( NeonUri aUri( xResAccess->getURL() ); aUnescapedTitle = aUri.GetPathBaseNameUnescaped(); - if ( eType == UNKNOWN ) + if ( eType == UNKNOWN || eType == NOT_FOUND ) { xProps.reset( new ContentProperties( aUnescapedTitle ) ); } @@ -1470,10 +1472,20 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( "IsFolder", uno::makeAny( false ), true ); - xProps->addProperty( + if ( eType == NOT_FOUND ) + { + xProps->addProperty( + "IsDocument", + uno::makeAny( false ), + true ); + } + else + { + xProps->addProperty( "IsDocument", uno::makeAny( true ), true ); + } } } else @@ -2897,7 +2909,7 @@ Content::ResourceType Content::resourceTypeForLocks( } } osl::MutexGuard g(m_aMutex); - if (m_eResourceTypeForLocks == UNKNOWN) + if ( m_eResourceTypeForLocks == UNKNOWN || m_eResourceTypeForLocks == NOT_FOUND ) { m_eResourceTypeForLocks = eResourceTypeForLocks; } @@ -3435,7 +3447,7 @@ Content::ResourceType Content::getResourceType( { { osl::MutexGuard g(m_aMutex); - if (m_eResourceType != UNKNOWN) { + if ( m_eResourceType != UNKNOWN && m_eResourceType != NOT_FOUND ) { return m_eResourceType; } } @@ -3484,6 +3496,10 @@ Content::ResourceType Content::getResourceType( { rResAccess->resetUri(); + if ( e.getStatus() == SC_NOT_FOUND ) + { + eResourceType = NOT_FOUND; + } if ( e.getStatus() == SC_METHOD_NOT_ALLOWED ) { // Status SC_METHOD_NOT_ALLOWED is a safe indicator that the @@ -3507,7 +3523,7 @@ Content::ResourceType Content::getResourceType( } osl::MutexGuard g(m_aMutex); - if (m_eResourceType == UNKNOWN) { + if ( m_eResourceType == UNKNOWN || m_eResourceType == NOT_FOUND ) { m_eResourceType = eResourceType; } else { SAL_WARN_IF( |