diff options
author | Kai Sommerfeld <kso@openoffice.org> | 2001-08-29 11:28:55 +0000 |
---|---|---|
committer | Kai Sommerfeld <kso@openoffice.org> | 2001-08-29 11:28:55 +0000 |
commit | c58455a5eb653bcd5ea5f420b724617229e137ce (patch) | |
tree | ec09dc5fdf025f68e6acfc79596e7138a10682ce /ucb/source | |
parent | b3b894be722f9aad6d8a05bc2455ba9af490f9e2 (diff) |
#91127# - Fixed DataSupplier::getData() to not expect data of parent folder
at the end of the vector< DAVResource > filled by PROPFIND.
Diffstat (limited to 'ucb/source')
-rw-r--r-- | ucb/source/ucp/webdav/webdavdatasupplier.cxx | 41 |
1 files changed, 35 insertions, 6 deletions
diff --git a/ucb/source/ucp/webdav/webdavdatasupplier.cxx b/ucb/source/ucp/webdav/webdavdatasupplier.cxx index 403bf357a5ee..132d5d1e0781 100644 --- a/ucb/source/ucp/webdav/webdavdatasupplier.cxx +++ b/ucb/source/ucp/webdav/webdavdatasupplier.cxx @@ -2,9 +2,9 @@ * * $RCSfile: webdavdatasupplier.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: kso $ $Date: 2001-06-25 08:51:54 $ + * last change: $Author: kso $ $Date: 2001-08-29 12:28:55 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -92,6 +92,9 @@ #ifndef _WEBDAV_SESSION_HXX #include "DAVSession.hxx" #endif +#ifndef _NEONURI_HXX_ +#include "NeonUri.hxx" +#endif using namespace com::sun::star; using namespace webdav_ucp; @@ -428,7 +431,8 @@ sal_Bool DataSupplier::getData() std::vector< DAVResource > resources; try { - // propfind depth 1, get property values for each child + // propfind depth 1, get property values for parent AND for each + // child m_pImpl->m_xContent->getResourceAccess() .PROPFIND( ONE, propertyNames, @@ -441,11 +445,36 @@ sal_Bool DataSupplier::getData() return sal_False; } - // Note: Last elem of resources contains data for the folder itself. - for ( sal_uInt32 n = 0; n < resources.size() - 1 ; ++n ) + NeonUri aURI( + m_pImpl->m_xContent->getIdentifier()->getContentIdentifier() ); + rtl::OUString aPath = aURI.GetPath(); + if ( aPath.getStr()[ aPath.getLength() - 1 ] == sal_Unicode( '/' ) ) + aPath = aPath.copy( 0, aPath.getLength() - 1 ); + + bool bFoundParent = false; + + for ( sal_uInt32 n = 0; n < resources.size(); ++n ) { + const DAVResource & rRes = resources[ n ]; + + // Filter out parent, which is contained somewhere(!) in the vector. + if ( !bFoundParent ) + { + NeonUri aCurrURI( rRes.uri ); + rtl::OUString aCurrPath = aCurrURI.GetPath(); + if ( aCurrPath.getStr()[ + aCurrPath.getLength() - 1 ] == sal_Unicode( '/' ) ) + aCurrPath = aCurrPath.copy( 0, aCurrPath.getLength() - 1 ); + + if ( aPath == aCurrPath ) + { + bFoundParent = true; + continue; + } + } + ContentProperties* pContentProperties - = new ContentProperties( resources[ n ] ); + = new ContentProperties( rRes ); // Check resource against open mode. switch ( m_pImpl->m_nOpenMode ) |