diff options
author | Andreas Bregas <ab@openoffice.org> | 2001-09-07 11:40:09 +0000 |
---|---|---|
committer | Andreas Bregas <ab@openoffice.org> | 2001-09-07 11:40:09 +0000 |
commit | 296a4cb012ba5abae824c0c4363fa6bda8c39844 (patch) | |
tree | e34ddeb8c4e062290fd862568de3c8736043966a /basic/source/runtime/methods.cxx | |
parent | 27ae25530f584ccb1a1a3f8aca70cc2359bd4e81 (diff) |
#91908# Accept also volume as directory
Diffstat (limited to 'basic/source/runtime/methods.cxx')
-rw-r--r-- | basic/source/runtime/methods.cxx | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx index 301037a60219..55758b7fea27 100644 --- a/basic/source/runtime/methods.cxx +++ b/basic/source/runtime/methods.cxx @@ -2,9 +2,9 @@ * * $RCSfile: methods.cxx,v $ * - * $Revision: 1.34 $ + * $Revision: 1.35 $ * - * last change: $Author: ab $ $Date: 2001-09-06 14:32:21 $ + * last change: $Author: ab $ $Date: 2001-09-07 12:40:09 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -254,6 +254,11 @@ static CharClass& GetCharClass( void ) return aCharClass; } +static inline BOOL isFolder( FileStatus::Type aType ) +{ + return ( aType == FileStatus::Directory || aType == FileStatus::Volume ); +} + //*** UCB file access *** @@ -861,7 +866,7 @@ void implRemoveDirRecursive( const String& aDirPath ) FileStatus aFileStatus( FileStatusMask_Type ); nRet = aItem.getFileStatus( aFileStatus ); FileStatus::Type aType = aFileStatus.getFileType(); - sal_Bool bFolder = (aType == FileStatus::Directory); + sal_Bool bFolder = isFolder( aType ); if( !bExists || !bFolder ) { @@ -891,7 +896,7 @@ void implRemoveDirRecursive( const String& aDirPath ) // Directory? FileStatus::Type aType = aFileStatus.getFileType(); - sal_Bool bFolder = (aType == FileStatus::Directory); + sal_Bool bFolder = isFolder( aType ); if( bFolder ) { implRemoveDirRecursive( aPath ); @@ -1993,7 +1998,7 @@ String getDirectoryPath( String aPathStr ) if( nRet == FileBase::E_None ) { FileStatus::Type aType = aFileStatus.getFileType(); - if( aType == FileStatus::Directory ) + if( isFolder( aType ) ) { aRetStr = aPathStr; } @@ -2528,7 +2533,7 @@ RTLFUNC(Dir) if( bOnlyFolders ) { FileStatus::Type aType = aFileStatus.getFileType(); - sal_Bool bFolder = (aType == FileStatus::Directory); + sal_Bool bFolder = isFolder( aType ); if( !bFolder ) continue; } @@ -2645,7 +2650,7 @@ RTLFUNC(GetAttr) sal_Bool bReadOnly = (nAttributes & Attribute_ReadOnly) != 0; FileStatus::Type aType = aFileStatus.getFileType(); - sal_Bool bDirectory = (aType == FileStatus::Directory); + sal_Bool bDirectory = isFolder( aType ); if( bReadOnly ) nFlags |= 0x0001; // ATTR_READONLY if( bDirectory ) |