diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-01-31 15:29:36 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-01-31 16:29:38 +0000 |
commit | edeb3af5d42475292fe890f1872bf3c456530033 (patch) | |
tree | 3e336a397bff491e6a157b1f7c32fe9e04d4965c | |
parent | 94644aa76acd22ac4f9cdd5374c1e1262f382c03 (diff) |
adapt bmpmaker
-rw-r--r-- | svtools/bmpmaker/bmpsum.cxx | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/svtools/bmpmaker/bmpsum.cxx b/svtools/bmpmaker/bmpsum.cxx index 223f76d79b63..c57273708503 100644 --- a/svtools/bmpmaker/bmpsum.cxx +++ b/svtools/bmpmaker/bmpsum.cxx @@ -298,7 +298,7 @@ void BmpSum::ProcessFileList( const String& rInFileList, if( aIStm.IsOpen() && aOStm.IsOpen() ) { rtl::OString aReadLine; - ::std::set< ByteString > aFileNameSet; + ::std::set<rtl::OString> aFileNameSet; while( aIStm.ReadLine( aReadLine ) ) { @@ -345,13 +345,13 @@ void BmpSum::ProcessFileList( const String& rInFileList, aIStm.Close(); - ::std::set< ByteString >::iterator aIter( aFileNameSet.begin() ); - ::std::map< sal_uInt64, ::std::vector< ByteString > > aFileNameMap; + ::std::set< rtl::OString >::iterator aIter( aFileNameSet.begin() ); + ::std::map< sal_uInt64, ::std::vector< rtl::OString > > aFileNameMap; while( aIter != aFileNameSet.end() ) { - ByteString aStr( *aIter++ ); - SvFileStream aBmpStm( String( aStr.GetBuffer(), RTL_TEXTENCODING_ASCII_US ), STREAM_READ ); + rtl::OString aStr( *aIter++ ); + SvFileStream aBmpStm(rtl::OStringToOUString(aStr, RTL_TEXTENCODING_ASCII_US), STREAM_READ); sal_uInt64 nCRC = 0; if( aBmpStm.IsOpen() ) @@ -375,7 +375,7 @@ void BmpSum::ProcessFileList( const String& rInFileList, nCRC = GetCRC( aBmpEx ); else - fprintf( stderr, "%s could not be opened\n", aStr.GetBuffer() ); + fprintf( stderr, "%s could not be opened\n", aStr.getStr() ); } aBmpStm.Close(); @@ -383,36 +383,36 @@ void BmpSum::ProcessFileList( const String& rInFileList, if( nCRC ) { - ::std::map< sal_uInt64, ::std::vector< ByteString > >::iterator aFound( aFileNameMap.find( nCRC ) ); + ::std::map< sal_uInt64, ::std::vector< rtl::OString > >::iterator aFound( aFileNameMap.find( nCRC ) ); if( aFound != aFileNameMap.end() ) (*aFound).second.push_back( aStr ); else { - ::std::vector< ByteString > aVector( 1, aStr ); + ::std::vector< rtl::OString > aVector( 1, aStr ); aFileNameMap[ nCRC ] = aVector; } } else { - ::std::vector< ByteString > aVector( 1, aStr ); + ::std::vector< rtl::OString > aVector( 1, aStr ); aFileNameMap[ nCRC ] = aVector; } } - ::std::map< sal_uInt64, ::std::vector< ByteString > >::iterator aMapIter( aFileNameMap.begin() ); + ::std::map< sal_uInt64, ::std::vector< rtl::OString > >::iterator aMapIter( aFileNameMap.begin() ); sal_uInt32 nFileCount = 0; while( aMapIter != aFileNameMap.end() ) { - ::std::pair< const sal_uInt64, ::std::vector< ByteString > > aPair( *aMapIter++ ); - ::std::vector< ByteString > aFileNameVector( aPair.second ); + ::std::pair< const sal_uInt64, ::std::vector< rtl::OString > > aPair( *aMapIter++ ); + ::std::vector< rtl::OString > aFileNameVector( aPair.second ); // write new entries for( sal_uInt32 i = 0; i < aFileNameVector.size(); ++i ) { - ByteString aFileName( aFileNameVector[ i ] ); + rtl::OString aFileName( aFileNameVector[ i ] ); DirEntry aSrcFile( aFileName ); rtl::OStringBuffer aStr; @@ -423,10 +423,11 @@ void BmpSum::ProcessFileList( const String& rInFileList, // copy bitmap if( rOutPath.Len() ) { - if( aFileName.Search( ":\\" ) != STRING_NOTFOUND ) - aFileName.Erase( 0, aFileName.Search( ":\\" ) + 2 ); + sal_Int32 nIndex = aFileName.indexOf(":\\"); + if (nIndex != -1) + aFileName = aFileName.copy(nIndex + 2); - aFileName.SearchAndReplaceAll( '\\', '/' ); + aFileName = aFileName.replace('\\', '/'); sal_Int32 nTokenCount = comphelper::string::getTokenCount(aFileName, '/'); DirEntry aNewDir( aBaseDir ); |