diff options
author | Andreas Bregas <ab@openoffice.org> | 2001-06-28 12:02:07 +0000 |
---|---|---|
committer | Andreas Bregas <ab@openoffice.org> | 2001-06-28 12:02:07 +0000 |
commit | edbd798c9da568f02d1cbe34d61edc61a4bd30d4 (patch) | |
tree | b4a3a28412e98dc00f1b68f95c8748d72263b86b /basic/source/runtime/methods.cxx | |
parent | d09f0f0b0364d6bb2e8a01484e48270b2d7b6031 (diff) |
#88843# DIR command, OSL implementation: Special code for links to directories
Diffstat (limited to 'basic/source/runtime/methods.cxx')
-rw-r--r-- | basic/source/runtime/methods.cxx | 50 |
1 files changed, 34 insertions, 16 deletions
diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx index ba322f5f46ae..88ad2392ff7f 100644 --- a/basic/source/runtime/methods.cxx +++ b/basic/source/runtime/methods.cxx @@ -2,9 +2,9 @@ * * $RCSfile: methods.cxx,v $ * - * $Revision: 1.27 $ + * $Revision: 1.28 $ * - * last change: $Author: ab $ $Date: 2001-06-20 16:52:58 $ + * last change: $Author: ab $ $Date: 2001-06-28 13:02:07 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1975,6 +1975,35 @@ RTLFUNC(IsMissing) // ToDo: Library-globaler Datenbereich fuer Dir-Objekt und Flags +String getDirectoryPath( String aPathStr ) +{ + String aRetStr; + + DirectoryItem aItem; + FileBase::RC nRet = DirectoryItem::get( aPathStr, aItem ); + if( nRet == FileBase::E_None ) + { + FileStatus aFileStatus( FileStatusMask_Type ); + nRet = aItem.getFileStatus( aFileStatus ); + if( nRet == FileBase::E_None ) + { + FileStatus::Type aType = aFileStatus.getFileType(); + if( aType == FileStatus::Directory ) + { + aRetStr = aPathStr; + } + else if( aType == FileStatus::Link ) + { + FileStatus aFileStatus( FileStatusMask_LinkTargetURL ); + nRet = aItem.getFileStatus( aFileStatus ); + if( nRet == FileBase::E_None ) + aRetStr = getDirectoryPath( aFileStatus.getLinkTargetURL() ); + } + } + } + return aRetStr; +} + // #80200 HACK to provide minimum wildcard functionality (finally solution in UCB) // Function looks for wildcards, removes them and always returns the pure path String implSetupWildcard( const String& rFileParam, SbiRTLData* pRTLData, sal_Bool bHasUno ) @@ -2008,20 +2037,9 @@ String implSetupWildcard( const String& rFileParam, SbiRTLData* pRTLData, sal_Bo { if( aPathStr.Len() ) { - DirectoryItem aItem; - FileBase::RC nRet = DirectoryItem::get( aPathStr, aItem ); - if( nRet == FileBase::E_None ) - { - FileStatus aFileStatus( FileStatusMask_Type ); - nRet = aItem.getFileStatus( aFileStatus ); - if( nRet == FileBase::E_None ) - { - FileStatus::Type aType = aFileStatus.getFileType(); - sal_Bool bFolder = (aType == FileStatus::Directory); - if( bFolder ) - return aPathStr; - } - } + String aDirStr = getDirectoryPath( aPathStr ); + if( aDirStr.Len() ) + return aDirStr; } } } |