summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rsc/inc/rscdef.hxx3
-rw-r--r--rsc/source/misc/rscdbl.cxx2
-rw-r--r--rsc/source/parser/erscerr.cxx4
-rw-r--r--rsc/source/parser/rscyacc.cxx7
-rw-r--r--rsc/source/rsc/rsc.cxx15
-rw-r--r--rsc/source/tools/rscdef.cxx65
6 files changed, 45 insertions, 51 deletions
diff --git a/rsc/inc/rscdef.hxx b/rsc/inc/rscdef.hxx
index 4ff5e2201dd6..c5973e4a9bc8 100644
--- a/rsc/inc/rscdef.hxx
+++ b/rsc/inc/rscdef.hxx
@@ -30,6 +30,7 @@
#include <tools/unqidx.hxx>
#include <rsctree.hxx>
+#include <rtl/strbuf.hxx>
#include <vector>
/****************** C L A S S E S ****************************************/
@@ -70,7 +71,7 @@ public:
((sal_Int32)aExp.aLong.nHi << 16);
}
sal_Bool Evaluate( sal_Int32 * pValue ) const;
- void GetMacro( ByteString & ) const;
+ void AppendMacro( rtl::OStringBuffer & ) const;
};
/*********** R s c I d ***************************************************/
diff --git a/rsc/source/misc/rscdbl.cxx b/rsc/source/misc/rscdbl.cxx
index 5e6faeb47c22..da2106366f9f 100644
--- a/rsc/source/misc/rscdbl.cxx
+++ b/rsc/source/misc/rscdbl.cxx
@@ -52,7 +52,7 @@ REResourceList * InsertList( Atom nClassName, const RscId& rId,
if( pStrClass )
aStrClass = pStrClass;
else
- aStrClass = ByteString::CreateFromInt32( (long)nClassName );
+ aStrClass = rtl::OString::valueOf(static_cast<sal_Int32>(nClassName));
pSubList = new REResourceList( pList, aStrClass, rId );
diff --git a/rsc/source/parser/erscerr.cxx b/rsc/source/parser/erscerr.cxx
index 23337514b2c5..d323e5229d7b 100644
--- a/rsc/source/parser/erscerr.cxx
+++ b/rsc/source/parser/erscerr.cxx
@@ -123,9 +123,9 @@ void RscError::WriteError( const ERRTYPE& rError, const char * pMessage )
case ERR_ERROR: {
StdLstErr( "!! " );
if( 1 == nErrors )
- StdLstErr( ByteString::CreateFromInt32( nErrors ).GetBuffer() );
+ StdLstErr(rtl::OString::valueOf(static_cast<sal_Int32>(nErrors )).getStr());
else
- StdLstErr( ByteString::CreateFromInt32( (nErrors -1) ).GetBuffer() );
+ StdLstErr(rtl::OString::valueOf(static_cast<sal_Int32>(nErrors -1)).getStr());
StdLstErr( " Error" );
StdLstErr( " found!!" );
}
diff --git a/rsc/source/parser/rscyacc.cxx b/rsc/source/parser/rscyacc.cxx
index c795abcc1fc9..f812523d9dc1 100644
--- a/rsc/source/parser/rscyacc.cxx
+++ b/rsc/source/parser/rscyacc.cxx
@@ -111,15 +111,16 @@ void SetString( const RSCINST & rInst, const char * pVarName, const char * pStr
RscId MakeRscId( RscExpType aExpType )
{
- if( !aExpType.IsNothing() ){
- sal_Int32 lValue;
+ if( !aExpType.IsNothing() )
+ {
+ sal_Int32 lValue(0);
if( !aExpType.Evaluate( &lValue ) )
pTC->pEH->Error( ERR_ZERODIVISION, NULL, RscId() );
if( lValue < 1 || lValue > (sal_Int32)0x7FFF )
{
pTC->pEH->Error( ERR_IDRANGE, NULL, RscId(),
- ByteString::CreateFromInt32( lValue ).GetBuffer() );
+ rtl::OString::valueOf(lValue).getStr() );
}
if( aExpType.IsDefinition() )
diff --git a/rsc/source/rsc/rsc.cxx b/rsc/source/rsc/rsc.cxx
index f8e308a7a47f..6fbc6976aedc 100644
--- a/rsc/source/rsc/rsc.cxx
+++ b/rsc/source/rsc/rsc.cxx
@@ -1248,7 +1248,7 @@ void RscCompiler::PreprocessSrsFile( const RscCmdLine::OutputFile& rOutputFile,
sal_Int32 nNumber = atoi( aLine.GetBuffer() );
if( nNumber < 10000 )
- aBaseFileName += ByteString::CreateFromInt32( 0 );
+ aBaseFileName += '0';
if( GetImageFilePath( rOutputFile, rContext, aBaseFileName += aLine , aFilePath, pSysListFile ) )
aEntryVector.push_back( ::std::pair< ByteString, sal_Int32 >( aFilePath, nNumber ) );
@@ -1276,14 +1276,15 @@ void RscCompiler::PreprocessSrsFile( const RscCmdLine::OutputFile& rOutputFile,
for( sal_uInt32 i = 0; i < aEntryVector.size(); ++i )
{
- ByteString aEntryString( "< \"" );
+ rtl::OStringBuffer aEntryString(
+ RTL_CONSTASCII_STRINGPARAM("< \""));
- aEntryString += aEntryVector[ i ].first;
- aEntryString += "\"; ";
- aEntryString += ByteString::CreateFromInt32( aEntryVector[ i ].second );
- aEntryString += "; >;";
+ aEntryString.append(aEntryVector[i].first);
+ aEntryString.append(RTL_CONSTASCII_STRINGPARAM("\"; "));
+ aEntryString.append(static_cast<sal_Int32>(aEntryVector[ i ].second));
+ aEntryString.append(RTL_CONSTASCII_STRINGPARAM("; >;"));
- aOStm.WriteLine( aEntryString );
+ aOStm.WriteLine(aEntryString.makeStringAndClear());
}
aOStm.WriteLine( "};" );
diff --git a/rsc/source/tools/rscdef.cxx b/rsc/source/tools/rscdef.cxx
index ad4bab1412a2..86ad2828973c 100644
--- a/rsc/source/tools/rscdef.cxx
+++ b/rsc/source/tools/rscdef.cxx
@@ -170,17 +170,17 @@ RscId::operator sal_Int32() const
*************************************************************************/
ByteString RscId::GetName() const
{
- ByteString aStr;
+ rtl::OStringBuffer aStr;
if ( !aExp.IsNothing() )
{
if( bNames )
- aExp.GetMacro( aStr );
+ aExp.AppendMacro(aStr);
else
- aStr = ByteString::CreateFromInt32( GetNumber() );
+ aStr.append(GetNumber());
}
- return aStr;
+ return aStr.makeStringAndClear();
}
/*************************************************************************
@@ -190,14 +190,14 @@ ByteString RscId::GetName() const
*************************************************************************/
ByteString RscId::GetMacro() const
{
- ByteString aStr;
+ rtl::OStringBuffer aStr;
if ( aExp.IsDefinition() )
- aStr = aExp.aExp.pDef->GetMacro();
+ aStr.append(aExp.aExp.pDef->GetMacro());
else
- aExp.GetMacro( aStr );
+ aExp.AppendMacro(aStr);
- return aStr;
+ return aStr.makeStringAndClear();
}
/****************** R s c D e f i n e ************************************/
@@ -259,7 +259,7 @@ void RscDefine::DefineToNumber()
if( pExp )
delete pExp;
pExp = NULL;
- SetName( ByteString::CreateFromInt32( lId ) );
+ SetName(rtl::OString::valueOf(lId));
}
/*************************************************************************
@@ -314,7 +314,7 @@ ByteString RscDefine::GetMacro()
{
if( pExp )
return pExp->GetMacro();
- return ByteString::CreateFromInt32( lId );
+ return rtl::OString::valueOf(lId);
}
/****************** R s c D e f i n e L i s t ****************************/
@@ -459,23 +459,14 @@ sal_Bool RscExpType::Evaluate( sal_Int32 * plValue ) const{
return sal_True;
}
-/*************************************************************************
-|*
-|* RscExpType::GetMacro()
-|*
-*************************************************************************/
-void RscExpType::GetMacro( ByteString & rStr ) const
+void RscExpType::AppendMacro(rtl::OStringBuffer& rStr) const
{
- ByteString aStr;
-
if( IsDefinition() )
- {
- rStr += aExp.pDef->GetName();
- }
+ rStr.append(aExp.pDef->GetName());
else if( IsExpression() )
- rStr += aExp.pExp->GetMacro();
+ rStr.append(aExp.pExp->GetMacro());
else if( IsNumber() )
- rStr += ByteString::CreateFromInt32( GetLong() );
+ rStr.append(GetLong());
}
@@ -555,38 +546,38 @@ sal_Bool RscExpression::Evaluate( sal_Int32 * plValue ){
*************************************************************************/
ByteString RscExpression::GetMacro()
{
- ByteString aLeft;
+ rtl::OStringBuffer aLeft;
// Ausgabeoptimierung
if( aLeftExp.IsNothing() )
{
if ( '-' == cOperation )
{
- aLeft += '(';
- aLeft += '-';
+ aLeft.append('(');
+ aLeft.append('-');
}
- aRightExp.GetMacro( aLeft );
+ aRightExp.AppendMacro(aLeft);
if( '-' == cOperation )
- aLeft += ')';
+ aLeft.append(')');
}
else if( aRightExp.IsNothing() )
- aLeftExp.GetMacro( aLeft );
+ aLeftExp.AppendMacro(aLeft);
else{
- aLeft += '(';
+ aLeft.append('(');
// linken Zweig auswerten
- aLeftExp.GetMacro( aLeft );
+ aLeftExp.AppendMacro(aLeft);
- aLeft += cOperation;
+ aLeft.append(cOperation);
- aLeft += '(';
+ aLeft.append('(');
// rechten Zweig auswerten
- aRightExp.GetMacro( aLeft );
- aLeft += ')';
+ aRightExp.AppendMacro(aLeft);
+ aLeft.append(')');
- aLeft += ')';
+ aLeft.append(')');
}
- return aLeft;
+ return aLeft.makeStringAndClear();
}
/****************** R s c F i l e ****************************************/