diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-11-27 20:37:42 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-11-28 09:55:03 +0000 |
commit | 6f33482f8f4329b6c9874397bdb67c1b958b69c2 (patch) | |
tree | ba19bc4bff6ddbd87354f90a61615cf5f4892c5a /svtools/bmpmaker | |
parent | no need for super-convoluted empty string as far as I can see (diff) | |
download | core-6f33482f8f4329b6c9874397bdb67c1b958b69c2.tar.gz core-6f33482f8f4329b6c9874397bdb67c1b958b69c2.zip |
ByteString->rtl::OUStringToOString
Diffstat (limited to 'svtools/bmpmaker')
-rw-r--r-- | svtools/bmpmaker/bmp.cxx | 18 | ||||
-rw-r--r-- | svtools/bmpmaker/bmpcore.cxx | 3 | ||||
-rw-r--r-- | svtools/bmpmaker/bmpsum.cxx | 6 | ||||
-rw-r--r-- | svtools/bmpmaker/g2g.cxx | 20 |
4 files changed, 24 insertions, 23 deletions
diff --git a/svtools/bmpmaker/bmp.cxx b/svtools/bmpmaker/bmp.cxx index 7b02684b7b01..b33ebd889d2a 100644 --- a/svtools/bmpmaker/bmp.cxx +++ b/svtools/bmpmaker/bmp.cxx @@ -28,6 +28,7 @@ #include <rtl/math.hxx> +#include <rtl/strbuf.hxx> #include <math.h> #include <stdio.h> @@ -155,9 +156,9 @@ void BmpApp::Message( const String& rText, sal_uInt8 cExit ) if( EXIT_NOERROR != cExit ) SetExitCode( cExit ); - ByteString aText( rText, RTL_TEXTENCODING_UTF8 ); - aText.Append( "\r\n" ); - fprintf( stderr, "%s", aText.GetBuffer() ); + rtl::OStringBuffer aText(rtl::OUStringToOString(rText, RTL_TEXTENCODING_UTF8)); + aText.append(RTL_CONSTASCII_STRINGPARAM("\r\n")); + fprintf(stderr, "%s", aText.getStr()); } // ----------------------------------------------------------------------------- @@ -187,14 +188,13 @@ int BmpApp::Start( const ::std::vector< String >& rArgs ) sal_uInt16 nCurCmd = 0; const String aSrsName( rArgs[ nCurCmd++ ] ); ::std::vector< String > aInDirVector; - ByteString aLangDir; aOutName = rArgs[ nCurCmd++ ]; - aLangDir = ByteString( rArgs[ nCurCmd++ ], RTL_TEXTENCODING_ASCII_US ); + rtl::OString aLangDir(rtl::OUStringToOString(rArgs[nCurCmd++], RTL_TEXTENCODING_ASCII_US)); aLangInfo.mnLangNum = static_cast< sal_uInt16 >( rArgs[ nCurCmd++ ].ToInt32() ); - memcpy( aLangInfo.maLangDir, aLangDir.GetBuffer(), aLangDir.Len() + 1 ); + memcpy( aLangInfo.maLangDir, aLangDir.getStr(), aLangDir.getLength() + 1 ); GetCommandOption( rArgs, 'f', aOutputFileName ); GetCommandOptions( rArgs, 'i', aInDirVector ); @@ -210,9 +210,9 @@ int BmpApp::Start( const ::std::vector< String >& rArgs ) if( ( EXIT_NOERROR == cExitCode ) && aOutputFileName.Len() && aOutName.Len() ) { SvFileStream aOStm( aOutputFileName, STREAM_WRITE | STREAM_TRUNC ); - ByteString aStr( "Successfully generated ImageList(s) in: " ); - - aOStm.WriteLine( aStr.Append( ByteString( aOutName, RTL_TEXTENCODING_UTF8 ) ) ); + rtl::OStringBuffer aStr(RTL_CONSTASCII_STRINGPARAM("Successfully generated ImageList(s) in: ")); + aStr.append(rtl::OUStringToOString(aOutName, RTL_TEXTENCODING_UTF8)); + aOStm.WriteLine(aStr.makeStringAndClear()); aOStm.Close(); } diff --git a/svtools/bmpmaker/bmpcore.cxx b/svtools/bmpmaker/bmpcore.cxx index 4414e161f998..fd438ce980cb 100644 --- a/svtools/bmpmaker/bmpcore.cxx +++ b/svtools/bmpmaker/bmpcore.cxx @@ -196,7 +196,8 @@ void BmpCreator::ImplCreate( const ::std::vector< DirEntry >& rInDirs, if( pCollectStm && !aBmpEx.IsEmpty() ) { - const ByteString aCollectString( aFileName, RTL_TEXTENCODING_ASCII_US ); + const rtl::OString aCollectString(rtl::OUStringToOString( + aFileName, RTL_TEXTENCODING_ASCII_US)); pCollectStm->WriteLine( aCollectString ); } } diff --git a/svtools/bmpmaker/bmpsum.cxx b/svtools/bmpmaker/bmpsum.cxx index 9169f40b5d4e..6426e52654a7 100644 --- a/svtools/bmpmaker/bmpsum.cxx +++ b/svtools/bmpmaker/bmpsum.cxx @@ -133,9 +133,9 @@ void BmpSum::Message( const String& rText, sal_uInt8 nExitCode ) if( EXIT_NOERROR != nExitCode ) SetExitCode( nExitCode ); - ByteString aText( rText, RTL_TEXTENCODING_UTF8 ); - aText.Append( "\r\n" ); - fprintf( stderr, "%s", aText.GetBuffer() ); + rtl::OStringBuffer aText(rtl::OUStringToOString(rText, RTL_TEXTENCODING_UTF8)); + aText.append(RTL_CONSTASCII_STRINGPARAM("\r\n")); + fprintf(stderr, "%s", aText.getStr()); } // ----------------------------------------------------------------------------- diff --git a/svtools/bmpmaker/g2g.cxx b/svtools/bmpmaker/g2g.cxx index bcf930553900..6773a0f5d3ac 100644 --- a/svtools/bmpmaker/g2g.cxx +++ b/svtools/bmpmaker/g2g.cxx @@ -31,6 +31,7 @@ #include <signal.h> #include <ctype.h> +#include <rtl/strbuf.hxx> #include <tools/fsys.hxx> #include <tools/stream.hxx> #include <vcl/svapp.hxx> @@ -120,9 +121,9 @@ void G2GApp::Message( const String& rText, sal_uInt8 nExitCode ) if( EXIT_NOERROR != nExitCode ) SetExitCode( nExitCode ); - ByteString aText( rText, RTL_TEXTENCODING_UTF8 ); - aText.Append( "\r\n" ); - fprintf( stderr, "%s", aText.GetBuffer() ); + rtl::OStringBuffer aText(rtl::OUStringToOString(rText, RTL_TEXTENCODING_UTF8)); + aText.append(RTL_CONSTASCII_STRINGPARAM("\r\n")); + fprintf(stderr, "%s", aText.getStr()); } // ----------------------------------------------------------------------------- @@ -184,20 +185,19 @@ int G2GApp::Start( const ::std::vector< String >& rArgs ) if( ( aTransColStr.Len() == 6 ) && aFilter.IsExportPixelFormat( nExportFilter ) ) { - ByteString aHexStr( aTransColStr, RTL_TEXTENCODING_ASCII_US ); + rtl::OString aHexStr(rtl::OUStringToOString(aTransColStr, RTL_TEXTENCODING_ASCII_US). + toAsciiLowerCase()); sal_Bool bHex = sal_True; - aHexStr.ToLowerAscii(); - for( sal_uInt16 i = 0; ( i < 6 ) && bHex; i++ ) - if( !isxdigit( aHexStr.GetChar( i ) ) ) + if( !isxdigit( aHexStr[i] ) ) bHex = sal_False; if( bHex ) { - const sal_uInt8 cTransR = ( LOWERHEXTONUM( aHexStr.GetChar( 0 ) ) << 4 ) | LOWERHEXTONUM( aHexStr.GetChar( 1 ) ); - const sal_uInt8 cTransG = ( LOWERHEXTONUM( aHexStr.GetChar( 2 ) ) << 4 ) | LOWERHEXTONUM( aHexStr.GetChar( 3 ) ); - const sal_uInt8 cTransB = ( LOWERHEXTONUM( aHexStr.GetChar( 4 ) ) << 4 ) | LOWERHEXTONUM( aHexStr.GetChar( 5 ) ); + const sal_uInt8 cTransR = ( LOWERHEXTONUM( aHexStr[0] ) << 4 ) | LOWERHEXTONUM( aHexStr[1] ); + const sal_uInt8 cTransG = ( LOWERHEXTONUM( aHexStr[2] ) << 4 ) | LOWERHEXTONUM( aHexStr[3] ); + const sal_uInt8 cTransB = ( LOWERHEXTONUM( aHexStr[4] ) << 4 ) | LOWERHEXTONUM( aHexStr[5] ); BitmapEx aBmpEx( aGraphic.GetBitmapEx() ); Bitmap aOldBmp( aBmpEx.GetBitmap() ); |