summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiuseppe Castagno <giuseppe.castagno@acca-esse.eu>2015-12-27 11:19:39 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-01-14 13:36:49 +0000
commit7704b0bd61b622d0186aca43626b37fdf364d397 (patch)
treeb5f894eac6f90560363815f4aa04bf799053bb4a
parent55062c4d358ae94a35ac0454d24c39b39ba4e489 (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> (cherry picked from commit 5fc2910fc872bbd1184aaab7c842dff593d2449b) Reviewed-on: https://gerrit.libreoffice.org/21258 Reviewed-by: Giuseppe Castagno <giuseppe.castagno@acca-esse.eu> Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
-rw-r--r--ucb/source/ucp/webdav-neon/webdavcontent.cxx26
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(