summaryrefslogtreecommitdiff
path: root/padmin
diff options
context:
space:
mode:
authorRĂ¼diger Timm <rt@openoffice.org>2004-03-30 12:46:06 +0000
committerRĂ¼diger Timm <rt@openoffice.org>2004-03-30 12:46:06 +0000
commit1f063e4618be365715ad0d24f365868c1ea3c269 (patch)
treeb7839dc65c3a104900a0143f703be98b168b8f2c /padmin
parent1fdd8dbb1a60803e737e6fc1d3460fd7820b5deb (diff)
INTEGRATION: CWS vcl20 (1.12.74); FILE MERGED
2004/02/20 14:57:26 pl 1.12.74.1: #i20934# search in subdirectories for fonts, too
Diffstat (limited to 'padmin')
-rw-r--r--padmin/source/helper.cxx29
1 files changed, 25 insertions, 4 deletions
diff --git a/padmin/source/helper.cxx b/padmin/source/helper.cxx
index 41ff12be2dd4..6c7dd5ff280b 100644
--- a/padmin/source/helper.cxx
+++ b/padmin/source/helper.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: helper.cxx,v $
*
- * $Revision: 1.13 $
+ * $Revision: 1.14 $
*
- * last change: $Author: obo $ $Date: 2004-03-17 10:44:38 $
+ * last change: $Author: rt $ $Date: 2004-03-30 13:46:06 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -113,6 +113,9 @@
#ifndef _ISOLANG_HXX
#include <tools/isolang.hxx>
#endif
+#ifndef _RTL_USTRBUF_HXX_
+#include <rtl/ustrbuf.hxx>
+#endif
using namespace osl;
@@ -162,14 +165,15 @@ ResId padmin::PaResId( ULONG nId )
* FindFiles
*/
-void padmin::FindFiles( const String& rDirectory, ::std::list< String >& rResult, const String& rSuffixes )
+void padmin::FindFiles( const String& rDirectory, ::std::list< String >& rResult, const String& rSuffixes, bool bRecursive )
{
rResult.clear();
OUString aDirPath;
::osl::FileBase::getFileURLFromSystemPath( rDirectory, aDirPath );
Directory aDir( aDirPath );
- aDir.open();
+ if( aDir.open() != FileBase::E_None )
+ return;
DirectoryItem aItem;
while( aDir.getNextItem( aItem ) == FileBase::E_None )
{
@@ -197,6 +201,23 @@ void padmin::FindFiles( const String& rDirectory, ::std::list< String >& rResult
}
}
}
+ else if( bRecursive &&
+ ( aStatus.getFileType() == FileStatus::Directory ||
+ aStatus.getFileType() == FileStatus::Link ) )
+ {
+ OUStringBuffer aSubDir( rDirectory );
+ aSubDir.appendAscii( "/", 1 );
+ aSubDir.append( aStatus.getFileName() );
+ std::list< String > subfiles;
+ FindFiles( aSubDir.makeStringAndClear(), subfiles, rSuffixes, bRecursive );
+ for( std::list< String >::const_iterator it = subfiles.begin(); it != subfiles.end(); ++it )
+ {
+ OUStringBuffer aSubFile( aStatus.getFileName() );
+ aSubFile.appendAscii( "/", 1 );
+ aSubFile.append( *it );
+ rResult.push_back( aSubFile.makeStringAndClear() );
+ }
+ }
}
aDir.close();
}