diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-09-20 23:01:16 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-09-21 09:47:37 +0100 |
commit | 0577f19870453e7bc707b59d57c5331df7bde14d (patch) | |
tree | 3ab5310218ca1bea96dec5fb03eef8e69ad88760 /rsc | |
parent | 59cb0469897b1d2c57386510ad321a72e5477ad4 (diff) |
ByteString->rtl::OString[Buffer]
Diffstat (limited to 'rsc')
-rw-r--r-- | rsc/source/parser/rscibas.cxx | 24 | ||||
-rw-r--r-- | rsc/source/res/rscmgr.cxx | 21 | ||||
-rw-r--r-- | rsc/source/res/rscstr.cxx | 8 | ||||
-rw-r--r-- | rsc/source/rsc/rsc.cxx | 18 |
4 files changed, 33 insertions, 38 deletions
diff --git a/rsc/source/parser/rscibas.cxx b/rsc/source/parser/rscibas.cxx index 057c809d8f3d..4cf1c94fda74 100644 --- a/rsc/source/parser/rscibas.cxx +++ b/rsc/source/parser/rscibas.cxx @@ -99,7 +99,6 @@ void RscLangEnum::Init( RscNameTable& rNames ) mnLangId = 0x400; // stay away from selfdefined... char csep = '-'; const MsLangId::IsoLangEntry* pLangEntry; - ByteString aCountry, aLang; while ( NULL != ( pLangEntry = MsLangId::getIsoLangEntry( nIndex )) && ( pLangEntry->mnLang != LANGUAGE_DONTKNOW )) { @@ -109,41 +108,38 @@ void RscLangEnum::Init( RscNameTable& rNames ) pLangEntry->mnLang, MsLangId::convertLanguageToIsoByteString( pLangEntry->mnLang ).getStr() ); #endif - aLang = pLangEntry->maLangStr; - aCountry = pLangEntry->maCountry; - if ( aLang.EqualsIgnoreCaseAscii( aCountry ) || ! aCountry.Len() ) + rtl::OString aLang = pLangEntry->maLangStr; + rtl::OString aCountry = pLangEntry->maCountry; + if ( aCountry.isEmpty() || aLang.equalsIgnoreAsciiCase(aCountry) ) { - SetConstant( rNames.Put( aLang.GetBuffer(), CONSTNAME, mnLangId ), mnLangId ); + SetConstant( rNames.Put( aLang.getStr(), CONSTNAME, mnLangId ), mnLangId ); if ( ! GetLangId( aLang )) ULong_Iso_map[ aLang ] = mnLangId; #if OSL_DEBUG_LEVEL > 2 - fprintf( stderr, "ISO Language out: %s 0x%lx\n", aLang.GetBuffer(), mnLangId ); + fprintf( stderr, "ISO Language out: %s 0x%lx\n", aLang.getStr(), mnLangId ); #endif mnLangId++; } else { - SetConstant( rNames.Put( aLang.GetBuffer(), CONSTNAME, mnLangId ), mnLangId ); + SetConstant( rNames.Put( aLang.getStr(), CONSTNAME, mnLangId ), mnLangId ); if ( ! GetLangId( aLang )) ULong_Iso_map[ aLang ] = mnLangId; #if OSL_DEBUG_LEVEL > 2 fprintf( stderr, "ISO Language out: %s 0x%lx", aLang.GetBuffer(), mnLangId ); #endif mnLangId++; - aLang += csep; - aLang += aCountry.ToUpperAscii(); - SetConstant( rNames.Put( aLang.GetBuffer(), CONSTNAME, mnLangId ), mnLangId ); + aLang = aLang + csep + aCountry.toAsciiUpperCase(); + SetConstant( rNames.Put( aLang.getStr(), CONSTNAME, mnLangId ), mnLangId ); if ( ! GetLangId( aLang )) ULong_Iso_map[ aLang ] = mnLangId; #if OSL_DEBUG_LEVEL > 2 - fprintf( stderr, " %s 0x%lx\n", aLang.GetBuffer(), mnLangId ); + fprintf( stderr, " %s 0x%lx\n", aLang.getStr(), mnLangId ); #endif mnLangId++; // hack - survive "x-no-translate" - if ( aLang == "en-US" ) + if (aLang.equalsL(RTL_CONSTASCII_STRINGPARAM("en-US"))) { -// SetConstant( rNames.Put( "x-no-translate", CONSTNAME, mnLangId ), mnLangId ); -// mnLangId++; SetConstant( rNames.Put( "x-comment", CONSTNAME, mnLangId ), mnLangId ); mnLangId++; } diff --git a/rsc/source/res/rscmgr.cxx b/rsc/source/res/rscmgr.cxx index 663ab351318b..33b08d0fd582 100644 --- a/rsc/source/res/rscmgr.cxx +++ b/rsc/source/res/rscmgr.cxx @@ -234,11 +234,10 @@ ERRTYPE RscMgr::WriteRcHeader( const RSCINST & rInst, RscWriteRc & rMem, GetObjNode( pClassData->aRefId ); if( !pObjNode && pTC ) { - ByteString aMsg( pHS->getString( rInst.pClass->GetId() ).getStr() ); - aMsg += ' '; - aMsg += pClassData->aRefId.GetName(); + rtl::OStringBuffer aMsg(pHS->getString(rInst.pClass->GetId())); + aMsg.append(' ').append(pClassData->aRefId.GetName()); aError = WRN_MGR_REFNOTFOUND; - pTC->pEH->Error( aError, rInst.pClass, rId, aMsg.GetBuffer() ); + pTC->pEH->Error(aError, rInst.pClass, rId, aMsg.getStr()); } } @@ -370,11 +369,10 @@ ERRTYPE RscMgr::WriteHxxHeader( const RSCINST & rInst, FILE * fOutput, pObjNode = rInst.pClass->GetObjNode( pClassData->aRefId ); if( !pObjNode && pTC ) { - ByteString aMsg( pHS->getString( rInst.pClass->GetId() ).getStr() ); - aMsg += ' '; - aMsg += pClassData->aRefId.GetName(); + rtl::OStringBuffer aMsg(pHS->getString(rInst.pClass->GetId())); + aMsg.append(' ').append(pClassData->aRefId.GetName()); aError = WRN_MGR_REFNOTFOUND; - pTC->pEH->Error( aError, rInst.pClass, rId, aMsg.GetBuffer() ); + pTC->pEH->Error(aError, rInst.pClass, rId, aMsg.getStr()); } } @@ -450,11 +448,10 @@ ERRTYPE RscMgr::WriteCxxHeader( const RSCINST & rInst, FILE * fOutput, pObjNode = rInst.pClass->GetObjNode( pClassData->aRefId ); if( !pObjNode && pTC ) { - ByteString aMsg( pHS->getString( rInst.pClass->GetId() ).getStr() ); - aMsg += ' '; - aMsg += pClassData->aRefId.GetName(); + rtl::OStringBuffer aMsg(pHS->getString(rInst.pClass->GetId())); + aMsg.append(' ').append(pClassData->aRefId.GetName()); aError = WRN_MGR_REFNOTFOUND; - pTC->pEH->Error( aError, rInst.pClass, rId, aMsg.GetBuffer() ); + pTC->pEH->Error( aError, rInst.pClass, rId, aMsg.getStr() ); } } diff --git a/rsc/source/res/rscstr.cxx b/rsc/source/res/rscstr.cxx index 9126823b5f76..87c1e9240e63 100644 --- a/rsc/source/res/rscstr.cxx +++ b/rsc/source/res/rscstr.cxx @@ -305,12 +305,12 @@ ERRTYPE RscString::WriteRc( const RSCINST & rInst, RscWriteRc & rMem, { if( pTC ) { - ByteString aMsg( pHS->getString( pRefClass->GetId() ).getStr() ); - aMsg += ' '; - aMsg += aId.GetName(); + rtl::OStringBuffer aMsg(pHS->getString( + pRefClass->GetId())); + aMsg.append(' ').append(aId.GetName()); aError = WRN_STR_REFNOTFOUND; pTC->pEH->Error( aError, rInst.pClass, - RscId(), aMsg.GetBuffer() ); + RscId(), aMsg.getStr() ); } break; } diff --git a/rsc/source/rsc/rsc.cxx b/rsc/source/rsc/rsc.cxx index 967026616dff..649c96b62210 100644 --- a/rsc/source/rsc/rsc.cxx +++ b/rsc/source/rsc/rsc.cxx @@ -1202,13 +1202,15 @@ void RscCompiler::PreprocessSrsFile( const RscCmdLine::OutputFile& rOutputFile, if (comphelper::string::isdigitAsciiString(aLine)) { - ByteString aBaseFileName( aPrefix ); - sal_Int32 nNumber = atoi( aLine.GetBuffer() ); + sal_Int32 nNumber = atoi( aLine.GetBuffer() ); + rtl::OStringBuffer aBuf(aPrefix); if( nNumber < 10000 ) - aBaseFileName += '0'; + aBuf.append('0'); + aBuf.append(aLine); + rtl::OString aBaseFileName = aBuf.makeStringAndClear(); - if( GetImageFilePath( rOutputFile, rContext, aBaseFileName += aLine , aFilePath, pSysListFile ) ) + if( GetImageFilePath( rOutputFile, rContext, aBaseFileName, aFilePath, pSysListFile ) ) aEntryVector.push_back( ::std::pair< ByteString, sal_Int32 >( aFilePath, nNumber ) ); else aMissingImages.push_back( aBaseFileName ); @@ -1257,17 +1259,17 @@ void RscCompiler::PreprocessSrsFile( const RscCmdLine::OutputFile& rOutputFile, if( aMissingImages.size() > 0 ) { - ByteString aImagesStr; + rtl::OStringBuffer aImagesStr; for( sal_uInt32 i = 0; i < aMissingImages.size(); ++i ) { if( i ) - aImagesStr += ' '; + aImagesStr.append(' '); - aImagesStr += aMissingImages[ i ]; + aImagesStr.append(aMissingImages[i]); } - pTC->pEH->FatalError( ERR_NOIMAGE, RscId(), aImagesStr.GetBuffer() ); + pTC->pEH->FatalError( ERR_NOIMAGE, RscId(), aImagesStr.getStr() ); } if( pSysListFile ) |