diff options
author | Hennes Rohling <hro@openoffice.org> | 2000-12-20 11:22:58 +0000 |
---|---|---|
committer | Hennes Rohling <hro@openoffice.org> | 2000-12-20 11:22:58 +0000 |
commit | 84be17b3b1b484373ffe43cfd7f1bda9ea70cdbc (patch) | |
tree | 7f29eefb3ff4cd8933ff5f32affea3e0ef3abe56 /ucb/source/ucp | |
parent | 91480223cbf15c16ef6d8f3cc7f2a9e80ce01dce (diff) |
#82359# Cut trailing slashes of mountpoint directories, do not resolve symbolic aliases, sort
mount points by directory length, longest first
Diffstat (limited to 'ucb/source/ucp')
-rw-r--r-- | ucb/source/ucp/file/prov.cxx | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/ucb/source/ucp/file/prov.cxx b/ucb/source/ucp/file/prov.cxx index beb577b39d5a..3c8d4d12c71f 100644 --- a/ucb/source/ucp/file/prov.cxx +++ b/ucb/source/ucp/file/prov.cxx @@ -2,9 +2,9 @@ * * $RCSfile: prov.cxx,v $ * - * $Revision: 1.10 $ + * $Revision: 1.11 $ * - * last change: $Author: sb $ $Date: 2000-12-15 08:29:59 $ + * last change: $Author: hro $ $Date: 2000-12-20 12:22:58 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -210,6 +210,11 @@ extern "C" void * SAL_CALL component_getFactory( extern "C" oslFileError osl_getRealPath(rtl_uString* strPath, rtl_uString** strRealPath); #endif +static bool moreLength( const shell::MountPoint& m1, const shell::MountPoint& m2 ) +{ + return m1.m_aDirectory.getLength() > m2.m_aDirectory.getLength(); +} + FileProvider::FileProvider( const uno::Reference< lang::XMultiServiceFactory >& xMultiServiceFactory ) : m_xMultiServiceFactory( xMultiServiceFactory ), m_pMyShell( 0 ) @@ -336,7 +341,11 @@ FileProvider::FileProvider( const uno::Reference< lang::XMultiServiceFactory >& rtl::OUString aRealUnqAlias; osl_getRealPath( aUnqDir.pData, &aRealUnqDir.pData ); +#if 0 osl_getRealPath( aUnqAl.pData, &aRealUnqAlias.pData ); +#else + aRealUnqAlias = aUnqAl; +#endif if ( !aRealUnqAlias.getLength() ) aRealUnqAlias = aUnqAl; @@ -357,6 +366,20 @@ FileProvider::FileProvider( const uno::Reference< lang::XMultiServiceFactory >& #endif } + + // Cut trailing slashes + + for ( sal_uInt32 j = 0; j < m_pMyShell->m_vecMountPoint.size(); j++ ) + { + sal_Int32 nLen = m_pMyShell->m_vecMountPoint[j].m_aDirectory.getLength(); + + if ( m_pMyShell->m_vecMountPoint[j].m_aDirectory.lastIndexOf( '/' ) == nLen - 1 ) + m_pMyShell->m_vecMountPoint[j].m_aDirectory = m_pMyShell->m_vecMountPoint[j].m_aDirectory.copy( 0, nLen - 1 ); + } + + // Now sort the mount point entries according to the length + + std::stable_sort( m_pMyShell->m_vecMountPoint.begin(), m_pMyShell->m_vecMountPoint.end(), moreLength ); } } catch( ... ) |