summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-11-27 08:21:00 +0000
committerCaolán McNamara <caolanm@redhat.com>2011-11-28 09:55:02 +0000
commit3fd28200f1c1a46970789f21ee6fce3f6f3ac1ec (patch)
tree18600b1b78ed5ede7f7068a98fe3fe7b6962b311
parent48221d6a2bf4c327b6cadcdc65169997f7d7408d (diff)
ByteString->rtl::OString[Buffer]
-rw-r--r--idl/source/objects/basobj.cxx2
-rw-r--r--idl/source/objects/bastype.cxx2
-rw-r--r--idl/source/objects/module.cxx16
-rw-r--r--idl/source/objects/object.cxx4
-rw-r--r--idl/source/objects/slot.cxx4
-rw-r--r--idl/source/prj/command.cxx21
-rw-r--r--idl/source/prj/database.cxx10
-rw-r--r--idl/source/prj/svidl.cxx61
-rw-r--r--l10ntools/source/export.cxx8
-rw-r--r--rsc/inc/rscdb.hxx2
-rw-r--r--rsc/inc/rscdef.hxx2
-rw-r--r--rsc/inc/rscrsc.hxx2
-rw-r--r--rsc/source/parser/rscibas.cxx4
-rw-r--r--rsc/source/parser/rscicpx.cxx4
-rw-r--r--rsc/source/parser/rscyacc.y10
-rw-r--r--rsc/source/rsc/rsc.cxx38
-rw-r--r--rsc/source/tools/rscdef.cxx2
-rw-r--r--rsc/source/tools/rsctools.cxx2
-rw-r--r--tools/bootstrp/cppdep.cxx70
-rw-r--r--tools/bootstrp/cppdep.hxx12
-rw-r--r--tools/bootstrp/mkunroll/mkunroll.cxx12
-rw-r--r--tools/bootstrp/rscdep.cxx39
-rw-r--r--tools/source/inet/inetstrm.cxx35
-rw-r--r--unotools/source/i18n/calendarwrapper.cxx195
-rw-r--r--unotools/source/i18n/charclass.cxx12
-rw-r--r--unotools/source/i18n/localedatawrapper.cxx78
-rw-r--r--unotools/source/i18n/transliterationwrapper.cxx34
27 files changed, 343 insertions, 338 deletions
diff --git a/idl/source/objects/basobj.cxx b/idl/source/objects/basobj.cxx
index f5a5c3fd6288..4f9c15d3e762 100644
--- a/idl/source/objects/basobj.cxx
+++ b/idl/source/objects/basobj.cxx
@@ -583,7 +583,7 @@ void SvMetaExtern::WriteAttributes( SvIdlDataBase & rBase, SvStream & rOutStm,
WriteTab( rOutStm, nTab );
rOutStm << "// class SvMetaExtern" << endl;
WriteTab( rOutStm, nTab );
- rOutStm << "uuid(" << ByteString( GetUUId().GetHexName(), RTL_TEXTENCODING_UTF8 ).GetBuffer() << ")," << endl;
+ rOutStm << "uuid(" << rtl::OUStringToOString(GetUUId().GetHexName(), RTL_TEXTENCODING_UTF8).getStr() << ")," << endl;
WriteTab( rOutStm, nTab );
rOutStm << "version("
<< rtl::OString::valueOf(static_cast<sal_Int32>(aVersion.GetMajorVersion())).getStr()
diff --git a/idl/source/objects/bastype.cxx b/idl/source/objects/bastype.cxx
index b60477aef45f..c7c391d60533 100644
--- a/idl/source/objects/bastype.cxx
+++ b/idl/source/objects/bastype.cxx
@@ -398,7 +398,7 @@ sal_Bool SvUUId::WriteSvIdl( SvStream & rOutStm )
{
// write global id
rOutStm << SvHash_uuid()->GetName().GetBuffer() << "(\"";
- rOutStm << ByteString( GetHexName(), RTL_TEXTENCODING_UTF8 ).GetBuffer() << "\")";
+ rOutStm << rtl::OUStringToOString(GetHexName(), RTL_TEXTENCODING_UTF8).getStr() << "\")";
return sal_True;
}
diff --git a/idl/source/objects/module.cxx b/idl/source/objects/module.cxx
index 08b42adc6ce5..75af0cfc25a1 100644
--- a/idl/source/objects/module.cxx
+++ b/idl/source/objects/module.cxx
@@ -272,16 +272,20 @@ void SvMetaModule::ReadContextSvIdl( SvIdlDataBase & rBase,
}
else
{
- ByteString aStr = "cannot open file: ";
- aStr += ByteString( aFullName.GetFull(), RTL_TEXTENCODING_UTF8 );
- rBase.SetError( aStr, pTok );
+ rtl::OStringBuffer aStr(RTL_CONSTASCII_STRINGPARAM(
+ "cannot open file: "));
+ aStr.append(rtl::OUStringToOString(aFullName.GetFull(),
+ RTL_TEXTENCODING_UTF8));
+ rBase.SetError(aStr.makeStringAndClear(), pTok);
}
}
else
{
- ByteString aStr = "cannot find file: ";
- aStr += ByteString( aFullName.GetFull(), RTL_TEXTENCODING_UTF8 );
- rBase.SetError( aStr, pTok );
+ rtl::OStringBuffer aStr(RTL_CONSTASCII_STRINGPARAM(
+ "cannot find file:"));
+ aStr.append(rtl::OUStringToOString(aFullName.GetFull(),
+ RTL_TEXTENCODING_UTF8));
+ rBase.SetError(aStr.makeStringAndClear(), pTok);
}
}
if( !bOk )
diff --git a/idl/source/objects/object.cxx b/idl/source/objects/object.cxx
index 99cb16b584b8..01dd2d5071c4 100644
--- a/idl/source/objects/object.cxx
+++ b/idl/source/objects/object.cxx
@@ -695,7 +695,7 @@ void SvMetaClass::WriteHxx( SvIdlDataBase &, SvStream & rOutStm, sal_uInt16 )
<< "\tvirtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) = 0;" << endl
<< "public:" << endl
<< "\t static SvGlobalName ClassName()" << endl
- << "\t { return SvGlobalName( " << ByteString( GetUUId().GetctorName(), RTL_TEXTENCODING_UTF8 ).GetBuffer() << " ); }" << endl
+ << "\t { return SvGlobalName( " << rtl::OUStringToOString(GetUUId().GetctorName(), RTL_TEXTENCODING_UTF8).getStr() << " ); }" << endl
<< "};" << endl;
}
@@ -719,7 +719,7 @@ void SvMetaClass::WriteCxx( SvIdlDataBase &, SvStream & rOutStm, sal_uInt16 )
<< "\t sal_uInt16 * pMajor," << endl
<< "\t sal_uInt16 * pMinor ) const" << endl
<< '{' << endl
- << "\tSvGlobalName aN( " << ByteString( pMod->GetUUId().GetctorName(), RTL_TEXTENCODING_UTF8 ).GetBuffer() << " );" << endl;
+ << "\tSvGlobalName aN( " << rtl::OUStringToOString(pMod->GetUUId().GetctorName(), RTL_TEXTENCODING_UTF8).getStr() << " );" << endl;
rOutStm << "\t*pGN = aN;" << endl
<< "\t*pMajor = "
<< rtl::OString::valueOf(static_cast<sal_Int32>(pMod->GetVersion().GetMajorVersion())).getStr()
diff --git a/idl/source/objects/slot.cxx b/idl/source/objects/slot.cxx
index f352abf00423..2434a10ecb62 100644
--- a/idl/source/objects/slot.cxx
+++ b/idl/source/objects/slot.cxx
@@ -519,14 +519,14 @@ void SvMetaSlot::ReadAttributesSvIdl( SvIdlDataBase & rBase,
bOk |= aDisableFlags.ReadSvIdl( SvHash_DisableFlags(), rInStm );
if( aGet.ReadSvIdl( SvHash_Get(), rInStm ) )
{
- rBase.WriteError( "warning", ByteString( rInStm.GetFileName(), RTL_TEXTENCODING_UTF8 ),
+ rBase.WriteError( "warning", rtl::OUStringToOString(rInStm.GetFileName(), RTL_TEXTENCODING_UTF8),
"<Get> old style, use Readonly",
rInStm.GetToken()->GetLine(),
rInStm.GetToken()->GetColumn() );
}
if( aSet.ReadSvIdl( SvHash_Set(), rInStm ) )
{
- rBase.WriteError( "warning", ByteString( rInStm.GetFileName(), RTL_TEXTENCODING_UTF8 ),
+ rBase.WriteError( "warning", rtl::OUStringToOString(rInStm.GetFileName(), RTL_TEXTENCODING_UTF8),
"<Set> old style, use method declaration",
rInStm.GetToken()->GetLine(),
rInStm.GetToken()->GetColumn() );
diff --git a/idl/source/prj/command.cxx b/idl/source/prj/command.cxx
index 177637361d2a..9366d7c32045 100644
--- a/idl/source/prj/command.cxx
+++ b/idl/source/prj/command.cxx
@@ -153,15 +153,16 @@ sal_Bool ReadIdl( SvIdlWorkingBase * pDataBase, const SvCommand & rCommand )
pDataBase->Load( aStm );
if( aStm.GetError() != SVSTREAM_OK )
{
- ByteString aStr;
+ rtl::OStringBuffer aStr;
if( aStm.GetError() == SVSTREAM_FILEFORMAT_ERROR )
- aStr = "error: incompatible format, file ";
+ aStr.append("error: incompatible format, file ");
else if( aStm.GetError() == SVSTREAM_WRONGVERSION )
- aStr = "error: wrong version, file ";
+ aStr.append("error: wrong version, file ");
else
- aStr = "error during load, file ";
- aStr += ByteString( aFileName, RTL_TEXTENCODING_UTF8 );
- fprintf( stderr, "%s\n", aStr.GetBuffer() );
+ aStr.append("error during load, file ");
+ aStr.append(rtl::OUStringToOString(aFileName,
+ RTL_TEXTENCODING_UTF8));
+ fprintf( stderr, "%s\n", aStr.getStr() );
return sal_False;
}
}
@@ -174,8 +175,9 @@ sal_Bool ReadIdl( SvIdlWorkingBase * pDataBase, const SvCommand & rCommand )
}
else
{
- const ByteString aStr( aFileName, RTL_TEXTENCODING_UTF8 );
- fprintf( stderr, "unable to read input file: %s\n", aStr.GetBuffer() );
+ const rtl::OString aStr(rtl::OUStringToOString(aFileName,
+ RTL_TEXTENCODING_UTF8));
+ fprintf( stderr, "unable to read input file: %s\n", aStr.getStr() );
return sal_False;
}
}
@@ -333,7 +335,8 @@ SvCommand::SvCommand( int argc, char ** argv )
{ // first line in *.srs file
if( aList[ i + 1 ] )
{
- aSrsLine = ByteString( *aList[ i +1 ], RTL_TEXTENCODING_UTF8 );
+ aSrsLine = rtl::OUStringToOString(*aList[ i +1 ],
+ RTL_TEXTENCODING_UTF8);
i++;
}
}
diff --git a/idl/source/prj/database.cxx b/idl/source/prj/database.cxx
index 639e944b97a8..4ca16cbe9cf9 100644
--- a/idl/source/prj/database.cxx
+++ b/idl/source/prj/database.cxx
@@ -601,7 +601,8 @@ void SvIdlDataBase::WriteError( SvTokenStream & rInStm )
aError = SvIdlError();
}
- WriteError( "error", ByteString( aFileName, RTL_TEXTENCODING_UTF8 ), aErrorText.makeStringAndClear(), nRow, nColumn );
+ WriteError("error", rtl::OUStringToOString(aFileName,
+ RTL_TEXTENCODING_UTF8), aErrorText.makeStringAndClear(), nRow, nColumn);
DBG_ASSERT( pTok, "token must be found" );
if( !pTok )
@@ -650,9 +651,10 @@ sal_Bool SvIdlWorkingBase::ReadSvIdl( SvTokenStream & rInStm, sal_Bool bImported
{
if( aStm.GetError() == SVSTREAM_WRONGVERSION )
{
- ByteString aStr( "wrong version, file " );
- aStr += ByteString( aFullName.GetFull(), RTL_TEXTENCODING_UTF8 );
- SetError( aStr, pTok );
+ rtl::OStringBuffer aStr("wrong version, file ");
+ aStr.append(rtl::OUStringToOString(
+ aFullName.GetFull(), RTL_TEXTENCODING_UTF8));
+ SetError(aStr.makeStringAndClear(), pTok);
WriteError( rInStm );
bOk = sal_False;
}
diff --git a/idl/source/prj/svidl.cxx b/idl/source/prj/svidl.cxx
index 85c01ebf2b8e..f633c9a7aa1c 100644
--- a/idl/source/prj/svidl.cxx
+++ b/idl/source/prj/svidl.cxx
@@ -135,9 +135,10 @@ int cdecl main ( int argc, char ** argv)
if( !pDataBase->WriteDocumentation( aOutStm ) )
{
nExit = -1;
- ByteString aStr = "cannot write documentation file: ";
- aStr += ByteString( aCommand.aDocuFile, RTL_TEXTENCODING_UTF8 );
- fprintf( stderr, "%s\n", aStr.GetBuffer() );
+ rtl::OStringBuffer aStr("cannot write documentation file: ");
+ aStr.append(rtl::OUStringToOString(aCommand.aDocuFile,
+ RTL_TEXTENCODING_UTF8));
+ fprintf(stderr, "%s\n", aStr.getStr());
}
}
if( nExit == 0 && aCommand.aListFile.Len() )
@@ -149,9 +150,10 @@ int cdecl main ( int argc, char ** argv)
if( !pDataBase->WriteSvIdl( aOutStm ) )
{
nExit = -1;
- ByteString aStr = "cannot write list file: ";
- aStr += ByteString( aCommand.aListFile, RTL_TEXTENCODING_UTF8 );
- fprintf( stderr, "%s\n", aStr.GetBuffer() );
+ rtl::OStringBuffer aStr("cannot write list file: ");
+ aStr.append(rtl::OUStringToOString(aCommand.aListFile,
+ RTL_TEXTENCODING_UTF8));
+ fprintf(stderr, "%s\n", aStr.getStr());
}
}
if( nExit == 0 && aCommand.aSlotMapFile.Len() )
@@ -163,9 +165,10 @@ int cdecl main ( int argc, char ** argv)
if( !pDataBase->WriteSfx( aOutStm ) )
{
nExit = -1;
- ByteString aStr = "cannot write slotmap file: ";
- aStr += ByteString( aCommand.aSlotMapFile, RTL_TEXTENCODING_UTF8 );
- fprintf( stderr, "%s\n", aStr.GetBuffer() );
+ rtl::OStringBuffer aStr("cannot write slotmap file: ");
+ aStr.append(rtl::OUStringToOString(aCommand.aSlotMapFile,
+ RTL_TEXTENCODING_UTF8));
+ fprintf(stderr, "%s\n", aStr.getStr());
}
}
if( nExit == 0 && aCommand.aHelpIdFile.Len() )
@@ -177,9 +180,10 @@ int cdecl main ( int argc, char ** argv)
if (!pDataBase->WriteHelpIds( aStm ) )
{
nExit = -1;
- ByteString aStr = "cannot write help ID file: ";
- aStr += ByteString( aCommand.aHelpIdFile, RTL_TEXTENCODING_UTF8 );
- fprintf( stderr, "%s\n", aStr.GetBuffer() );
+ rtl::OStringBuffer aStr("cannot write help ID file: ");
+ aStr.append(rtl::OUStringToOString(aCommand.aHelpIdFile,
+ RTL_TEXTENCODING_UTF8));
+ fprintf(stderr, "%s\n", aStr.getStr());
}
}
if( nExit == 0 && aCommand.aCSVFile.Len() )
@@ -191,9 +195,10 @@ int cdecl main ( int argc, char ** argv)
if (!pDataBase->WriteCSV( aStm ) )
{
nExit = -1;
- ByteString aStr = "cannot write CSV file: ";
- aStr += ByteString( aCommand.aCSVFile, RTL_TEXTENCODING_UTF8 );
- fprintf( stderr, "%s\n", aStr.GetBuffer() );
+ rtl::OStringBuffer aStr("cannot write CSV file: ");
+ aStr.append(rtl::OUStringToOString(aCommand.aCSVFile,
+ RTL_TEXTENCODING_UTF8));
+ fprintf(stderr, "%s\n", aStr.getStr());
}
}
if( nExit == 0 && aCommand.aSfxItemFile.Len() )
@@ -205,9 +210,10 @@ int cdecl main ( int argc, char ** argv)
if( !pDataBase->WriteSfxItem( aOutStm ) )
{
nExit = -1;
- ByteString aStr = "cannot write item file: ";
- aStr += ByteString( aCommand.aSfxItemFile, RTL_TEXTENCODING_UTF8 );
- fprintf( stderr, "%s\n", aStr.GetBuffer() );
+ rtl::OStringBuffer aStr("cannot write item file: ");
+ aStr.append(rtl::OUStringToOString(aCommand.aSfxItemFile,
+ RTL_TEXTENCODING_UTF8));
+ fprintf(stderr, "%s\n", aStr.getStr());
}
}
if( nExit == 0 && aCommand.aDataBaseFile.Len() )
@@ -220,9 +226,10 @@ int cdecl main ( int argc, char ** argv)
if( aOutStm.GetError() != SVSTREAM_OK )
{
nExit = -1;
- ByteString aStr = "cannot write database file: ";
- aStr += ByteString( aCommand.aDataBaseFile, RTL_TEXTENCODING_UTF8 );
- fprintf( stderr, "%s\n", aStr.GetBuffer() );
+ rtl::OStringBuffer aStr("cannot write database file: ");
+ aStr.append(rtl::OUStringToOString(aCommand.aDataBaseFile,
+ RTL_TEXTENCODING_UTF8));
+ fprintf(stderr, "%s\n", aStr.getStr());
}
}
if (nExit == 0 && aCommand.m_DepFile.getLength())
@@ -341,11 +348,13 @@ int cdecl main ( int argc, char ** argv)
if( bErr )
{
nExit = -1;
- ByteString aStr = "cannot move file from: ";
- aStr += ByteString( aErrFile2, RTL_TEXTENCODING_UTF8 );
- aStr += "\n to file: ";
- aStr += ByteString( aErrFile, RTL_TEXTENCODING_UTF8 );
- fprintf( stderr, "%s\n", aStr.GetBuffer() );
+ rtl::OStringBuffer aStr("cannot move file from: ");
+ aStr.append(rtl::OUStringToOString(aErrFile2,
+ RTL_TEXTENCODING_UTF8));
+ aStr.append("\n to file: ");
+ aStr.append(rtl::OUStringToOString(aErrFile,
+ RTL_TEXTENCODING_UTF8));
+ fprintf( stderr, "%s\n", aStr.getStr() );
}
else
{
diff --git a/l10ntools/source/export.cxx b/l10ntools/source/export.cxx
index 96501580e9ed..1ab13aeebd29 100644
--- a/l10ntools/source/export.cxx
+++ b/l10ntools/source/export.cxx
@@ -252,14 +252,16 @@ extern FILE *GetNextFile()
// create path to project root
DirEntry aEntry( String( sOrigFile, RTL_TEXTENCODING_ASCII_US ));
aEntry.ToAbs();
- ByteString sFullEntry( aEntry.GetFull(), RTL_TEXTENCODING_ASCII_US );
+ rtl::OString sFullEntry(rtl::OUStringToOString(aEntry.GetFull(),
+ RTL_TEXTENCODING_ASCII_US));
aEntry += DirEntry( String( "..", RTL_TEXTENCODING_ASCII_US ));
aEntry += DirEntry( sPrjRoot );
- ByteString sPrjEntry( aEntry.GetFull(), RTL_TEXTENCODING_ASCII_US );
+ rtl::OString sPrjEntry(rtl::OUStringToOString(aEntry.GetFull(),
+ RTL_TEXTENCODING_ASCII_US));
// create file name, beginnig with project root
// (e.g.: source\ui\src\menue.src)
- sActFileName = sFullEntry.Copy( sPrjEntry.Len() + 1 );
+ sActFileName = sFullEntry.copy(sPrjEntry.getLength() + 1);
sActFileName.SearchAndReplaceAll( "/", "\\" );
diff --git a/rsc/inc/rscdb.hxx b/rsc/inc/rscdb.hxx
index fd4988f6f2e9..ffe61c3c7df0 100644
--- a/rsc/inc/rscdb.hxx
+++ b/rsc/inc/rscdb.hxx
@@ -265,7 +265,7 @@ class RscTypCont
RscTop * pStyleFamily );
RscTop * InitClassSfxSlotInfo( RscTop * pSuper );
- void InsWinBit( RscTop * pClass, const ByteString & rName,
+ void InsWinBit( RscTop * pClass, const rtl::OString& rName,
Atom nVal );
void WriteInc( FILE * fOutput, sal_uLong lKey );
diff --git a/rsc/inc/rscdef.hxx b/rsc/inc/rscdef.hxx
index 6d335d5544b0..4e2ff5b9f40a 100644
--- a/rsc/inc/rscdef.hxx
+++ b/rsc/inc/rscdef.hxx
@@ -257,7 +257,7 @@ public:
// Alle Defines die in dieser Datei Definiert sind loeschen
void DeleteFileContext( sal_uLong lKey );
- sal_uLong NewCodeFile( const ByteString & rName );
+ sal_uLong NewCodeFile( const rtl::OString& rName );
sal_uLong NewIncFile( const ByteString & rName, const ByteString & rPath );
RscFile * GetFile( sal_uLong lFileKey ){ return Get( lFileKey ); }
};
diff --git a/rsc/inc/rscrsc.hxx b/rsc/inc/rscrsc.hxx
index aa7ee437643a..1f79a3e8206a 100644
--- a/rsc/inc/rscrsc.hxx
+++ b/rsc/inc/rscrsc.hxx
@@ -51,7 +51,7 @@ class RscCmdLine
public:
RscStrList aInputList; // Liste der Quelldateien
- ByteString aPath; // Liste der Pfade
+ rtl::OString aPath; // Liste der Pfade
RSCBYTEORDER_TYPE nByteOrder;
unsigned short nCommands; // Steuerbits
ByteString aOutputLst; // Name der List-Ausgabedatei
diff --git a/rsc/source/parser/rscibas.cxx b/rsc/source/parser/rscibas.cxx
index 9024281c0cf0..a7fdf0c6f137 100644
--- a/rsc/source/parser/rscibas.cxx
+++ b/rsc/source/parser/rscibas.cxx
@@ -144,8 +144,8 @@ void RscLangEnum::Init( RscNameTable& rNames )
nIndex++;
}
- ByteString aEnvIsoTokens = getenv( "RSC_LANG_ISO" );
- if ( aEnvIsoTokens.Len() )
+ rtl::OString aEnvIsoTokens = getenv( "RSC_LANG_ISO" );
+ if ( aEnvIsoTokens.getLength() )
{
ByteString aIsoToken;
sal_uInt16 nTokenCounter = 0;
diff --git a/rsc/source/parser/rscicpx.cxx b/rsc/source/parser/rscicpx.cxx
index c59acfb8273e..ad70349f17b0 100644
--- a/rsc/source/parser/rscicpx.cxx
+++ b/rsc/source/parser/rscicpx.cxx
@@ -47,7 +47,7 @@
/*************************************************************************
|* RscTypCont::InsWinBit()
*************************************************************************/
-void RscTypCont::InsWinBit( RscTop * pClass, const ByteString & rName,
+void RscTypCont::InsWinBit( RscTop * pClass, const rtl::OString& rName,
Atom nVal )
{
RscClient * pClient;
@@ -56,7 +56,7 @@ void RscTypCont::InsWinBit( RscTop * pClass, const ByteString & rName,
aBaseLst.push_back(
pClient = new RscClient( pHS->getID( "sal_Bool" ), RSC_NOTYPE, &aWinBits, nVal )
);
- Atom nId = aNmTb.Put( rName.GetBuffer(), VARNAME );
+ Atom nId = aNmTb.Put( rName.getStr(), VARNAME );
pClass->SetVariable( nId, pClient, NULL,
VAR_NODATAINST, 0, nWinBitVarId );
}
diff --git a/rsc/source/parser/rscyacc.y b/rsc/source/parser/rscyacc.y
index a89560a4ad6f..61f028e558ec 100644
--- a/rsc/source/parser/rscyacc.y
+++ b/rsc/source/parser/rscyacc.y
@@ -389,7 +389,7 @@ resource_definition
if( $4.IsNumber() ){
if( !pTC->aFileTab.NewDef( pFI->GetFileIndex(),
- ByteString( $3 ),
+ rtl::OString( $3 ),
$4.GetLong(), ULONG_MAX ) )
bError = sal_True;
}
@@ -403,12 +403,12 @@ resource_definition
pExpr = new RscExpression( aExpType, '+', $4 );
if( !pTC->aFileTab.NewDef( pFI->GetFileIndex(),
- ByteString( $3 ), pExpr, ULONG_MAX ) )
+ rtl::OString( $3 ), pExpr, ULONG_MAX ) )
bError = sal_True;
}
else if( $4.IsExpression() ){
if( !pTC->aFileTab.NewDef( pFI->GetFileIndex(),
- ByteString( $3 ), $4.aExp.pExp,
+ rtl::OString( $3 ), $4.aExp.pExp,
ULONG_MAX ) )
bError = sal_True;
}
@@ -1334,7 +1334,7 @@ line_number
RscFile * pFName;
pFI->SetLineNo( $3 );
- pFI->SetFileIndex( pTC->aFileTab.NewCodeFile( ByteString( $4 ) ) );
+ pFI->SetFileIndex( pTC->aFileTab.NewCodeFile( rtl::OString( $4 ) ) );
pFName = pTC->aFileTab.Get( pFI->GetFileIndex() );
pFName->bLoaded = sal_True;
pFName->bScanned = sal_True;
@@ -1344,7 +1344,7 @@ line_number
RscFile * pFName;
pFI->SetLineNo( $2 );
- pFI->SetFileIndex( pTC->aFileTab.NewCodeFile( ByteString( $3 ) ) );
+ pFI->SetFileIndex( pTC->aFileTab.NewCodeFile( rtl::OString( $3 ) ) );
pFName = pTC->aFileTab.Get( pFI->GetFileIndex() );
pFName->bLoaded = sal_True;
pFName->bScanned = sal_True;
diff --git a/rsc/source/rsc/rsc.cxx b/rsc/source/rsc/rsc.cxx
index 282b250c6a2e..628dc572128b 100644
--- a/rsc/source/rsc/rsc.cxx
+++ b/rsc/source/rsc/rsc.cxx
@@ -101,7 +101,7 @@ void RscCmdLine::Init()
nByteOrder = RSC_BIGENDIAN;
DirEntry aEntry;
- aPath = ByteString( aEntry.GetFull(), RTL_TEXTENCODING_ASCII_US ); //Immer im Aktuellen Pfad suchen
+ aPath = rtl::OUStringToOString(aEntry.GetFull(), RTL_TEXTENCODING_ASCII_US); //Immer im Aktuellen Pfad suchen
m_aOutputFiles.clear();
m_aOutputFiles.push_back( OutputFile() );
}
@@ -181,7 +181,7 @@ RscCmdLine::RscCmdLine( int argc, char ** argv, RscError * pEH )
DirEntry aSDir( String( aSPath, RTL_TEXTENCODING_ASCII_US ) );
m_aReplacements.push_back( std::pair< OString, OString >( OString( (*ppStr)+4, pEqual - *ppStr - 4 ),
- ByteString( aSDir.GetFull(), RTL_TEXTENCODING_ASCII_US ) ) );
+ rtl::OUStringToOString(aSDir.GetFull(), RTL_TEXTENCODING_ASCII_US) ) );
}
}
else if( !rsc_stricmp( (*ppStr) + 1, "PreLoad" ) )
@@ -207,9 +207,11 @@ RscCmdLine::RscCmdLine( int argc, char ** argv, RscError * pEH )
else if( !rsc_strnicmp( (*ppStr) + 1, "i", 1 ) )
{ // Include-Pfade definieren
nCommands |= INCLUDE_FLAG;
- if( aPath.Len() )
- aPath += ByteString( DirEntry::GetSearchDelimiter(), RTL_TEXTENCODING_ASCII_US );
- aPath += (*ppStr) + 2;
+ rtl::OStringBuffer aBuffer(aPath);
+ if (aBuffer.getLength())
+ aBuffer.append(rtl::OUStringToOString(DirEntry::GetSearchDelimiter(), RTL_TEXTENCODING_ASCII_US));
+ aBuffer.append((*ppStr) + 2);
+ aPath = aBuffer.makeStringAndClear();
}
else if( !rsc_strnicmp( (*ppStr) + 1, "fs=", 3 ) )
{ // anderer Name fuer .rc-file
@@ -226,10 +228,12 @@ RscCmdLine::RscCmdLine( int argc, char ** argv, RscError * pEH )
{
DirEntry aSysDir( String( aSysSearchDir, RTL_TEXTENCODING_ASCII_US ) );
m_aOutputFiles.back().aSysSearchDirs.push_back(
- ByteString( aSysDir.GetFull(), RTL_TEXTENCODING_ASCII_US ) );
+ rtl::OUStringToOString(aSysDir.GetFull(), RTL_TEXTENCODING_ASCII_US) );
if( m_aOutputFiles.back().aLangSearchPath.Len() )
+ {
m_aOutputFiles.back().aLangSearchPath.Append(
- ByteString( DirEntry::GetSearchDelimiter(), RTL_TEXTENCODING_ASCII_US ) );
+ rtl::OUStringToOString(DirEntry::GetSearchDelimiter(), RTL_TEXTENCODING_ASCII_US) );
+ }
m_aOutputFiles.back().aLangSearchPath.Append( aSysSearchDir );
}
}
@@ -286,7 +290,7 @@ RscCmdLine::RscCmdLine( int argc, char ** argv, RscError * pEH )
{
if( m_aOutputFiles.back().aLangName.Len() )
m_aOutputFiles.push_back( OutputFile() );
- m_aOutputFiles.back().aLangName = ByteString( (*ppStr)+3 );
+ m_aOutputFiles.back().aLangName = rtl::OString((*ppStr)+3);
}
else
pEH->FatalError( ERR_UNKNOWNSW, RscId(), *ppStr );
@@ -652,7 +656,10 @@ ERRTYPE RscCompiler :: IncludeParser( sal_uLong lFileKey )
UniString aUniFileName( pFNTmp->aFileName, RTL_TEXTENCODING_ASCII_US );
DirEntry aFullName( aUniFileName );
if ( aFullName.Find( UniString( pCL->aPath, RTL_TEXTENCODING_ASCII_US ) ) )
- pFNTmp->aPathName = ByteString( aFullName.GetFull(), RTL_TEXTENCODING_ASCII_US );
+ {
+ pFNTmp->aPathName = rtl::OUStringToOString(
+ aFullName.GetFull(), RTL_TEXTENCODING_ASCII_US);
+ }
else
aError = ERR_OPENFILE;
}
@@ -707,8 +714,9 @@ ERRTYPE RscCompiler :: ParseOneFile( sal_uLong lFileKey,
else
aSrsPath.CopyTo( aTmpPath, FSYS_ACTION_COPYFILE );
- ByteString aParseFile( aTmpPath.GetFull(), RTL_TEXTENCODING_ASCII_US );
- finput = fopen( aParseFile.GetBuffer(), "r" );
+ rtl::OString aParseFile(rtl::OUStringToOString(aTmpPath.GetFull(),
+ RTL_TEXTENCODING_ASCII_US));
+ finput = fopen(aParseFile.getStr(), "r");
if( !finput )
{
@@ -720,7 +728,7 @@ ERRTYPE RscCompiler :: ParseOneFile( sal_uLong lFileKey,
RscFileInst aFileInst( pTC, lFileKey, lFileKey, finput );
pTC->pEH->StdOut( "reading file ", RscVerbosityVerbose );
- pTC->pEH->StdOut( aParseFile.GetBuffer(), RscVerbosityVerbose );
+ pTC->pEH->StdOut( aParseFile.getStr(), RscVerbosityVerbose );
pTC->pEH->StdOut( " ", RscVerbosityVerbose );
aError = ::parser( &aFileInst );
@@ -844,8 +852,8 @@ ERRTYPE RscCompiler::Link()
pTC->pEH->FatalError( ERR_OPENFILE, RscId(), aRcTmp.getStr() );
// Schreibe Datei
- sal_Char cSearchDelim = ByteString( DirEntry::GetSearchDelimiter(), RTL_TEXTENCODING_ASCII_US ).GetChar( 0 );
- sal_Char cAccessDelim = ByteString( DirEntry::GetAccessDelimiter(), RTL_TEXTENCODING_ASCII_US ).GetChar( 0 );
+ sal_Char cSearchDelim = rtl::OUStringToOString(DirEntry::GetSearchDelimiter(), RTL_TEXTENCODING_ASCII_US)[0];
+ sal_Char cAccessDelim = rtl::OUStringToOString(DirEntry::GetAccessDelimiter(), RTL_TEXTENCODING_ASCII_US)[0];
pTC->ChangeLanguage( it->aLangName );
pTC->SetSourceCharSet( RTL_TEXTENCODING_UTF8 );
pTC->ClearSysNames();
@@ -973,7 +981,7 @@ ERRTYPE RscCompiler::Link()
if( !aHxx.Len() )
{
UniString aUniOutputCxx( pCL->aOutputCxx, RTL_TEXTENCODING_ASCII_US );
- aHxx = ByteString( DirEntry( aUniOutputCxx ).GetBase(), RTL_TEXTENCODING_ASCII_US );
+ aHxx = rtl::OUStringToOString(DirEntry( aUniOutputCxx ).GetBase(), RTL_TEXTENCODING_ASCII_US);
aHxx += ".hxx";
}
diff --git a/rsc/source/tools/rscdef.cxx b/rsc/source/tools/rscdef.cxx
index 77a0b0de85f4..93d9144942a8 100644
--- a/rsc/source/tools/rscdef.cxx
+++ b/rsc/source/tools/rscdef.cxx
@@ -854,7 +854,7 @@ void RscFileTab :: DeleteFileContext( sal_uLong lFileKey ){
|* RscFileTab::NewCodeFile()
|*
*************************************************************************/
-sal_uLong RscFileTab :: NewCodeFile( const ByteString & rName )
+sal_uLong RscFileTab :: NewCodeFile( const rtl::OString& rName )
{
sal_uLong lKey;
RscFile * pFName;
diff --git a/rsc/source/tools/rsctools.cxx b/rsc/source/tools/rsctools.cxx
index ff7c68b6e760..c4546077f87b 100644
--- a/rsc/source/tools/rsctools.cxx
+++ b/rsc/source/tools/rsctools.cxx
@@ -190,7 +190,7 @@ ByteString OutputFile ( ByteString aInput, const char * pExt )
UniString aExt( pExt, RTL_TEXTENCODING_ASCII_US );
aFileName.SetExtension( aExt );
- return ByteString( aFileName.GetFull(), RTL_TEXTENCODING_ASCII_US );
+ return rtl::OUStringToOString(aFileName.GetFull(), RTL_TEXTENCODING_ASCII_US);
}
/*************************************************************************
diff --git a/tools/bootstrp/cppdep.cxx b/tools/bootstrp/cppdep.cxx
index 093208cc1706..ea9179d2a071 100644
--- a/tools/bootstrp/cppdep.cxx
+++ b/tools/bootstrp/cppdep.cxx
@@ -39,50 +39,31 @@
CppDep::CppDep()
{
- pSources = new ByteStringList;
- pSearchPath = new ByteStringList;
- pFileList = new ByteStringList;
}
CppDep::~CppDep()
{
- for ( size_t i = 0, n = pSources->size(); i < n; ++i ) {
- delete (*pSources)[ i ];
- }
- delete pSources;
-
- for ( size_t i = 0, n = pSearchPath->size(); i < n; ++i ) {
- delete (*pSearchPath)[ i ];
- }
- delete pSearchPath;
-
- for ( size_t i = 0, n = pFileList->size(); i < n; ++i ) {
- delete (*pFileList)[ i ];
- }
- delete pFileList;
}
void CppDep::Execute()
{
- size_t nCount = pSources->size();
- for ( size_t n = 0; n < nCount; n++ )
+ size_t nCount = m_aSources.size();
+ for ( size_t n = 0; n < nCount; ++n )
{
- ByteString *pStr = (*pSources)[ n ];
- Search( *pStr );
+ const rtl::OString &rStr = m_aSources[n];
+ Search(rStr);
}
}
-sal_Bool CppDep::AddSearchPath( const char* aPath )
+sal_Bool CppDep::AddSearchPath( const char* pPath )
{
- ByteString *pStr = new ByteString( aPath );
- pSearchPath->push_back( pStr );
+ m_aSearchPath.push_back( rtl::OString(pPath) );
return sal_False;
}
-sal_Bool CppDep::AddSource( const char* aSource )
+sal_Bool CppDep::AddSource( const char* pSource )
{
- ByteString *pStr = new ByteString( aSource );
- pSources->push_back( pStr );
+ m_aSources.push_back( rtl::OString(pSource) );
return sal_False;
}
@@ -114,16 +95,16 @@ sal_Bool CppDep::Search( ByteString aFileName )
fprintf( stderr, "Result : %s\n", aResult.GetBuffer() );
#endif
- ByteString aNewFile;
+ rtl::OString aNewFile;
if ( aResult !="")
- if ( (aNewFile = Exists( aResult )) != "" )
+ if ( (aNewFile = Exists( aResult )).getLength() )
{
sal_Bool bFound = sal_False;
- size_t nCount = pFileList->size();
- for ( size_t i = 0; i < nCount; i++ )
+ size_t nCount = m_aFileList.size();
+ for ( size_t i = 0; i < nCount; ++i )
{
- ByteString *pStr = (*pFileList)[ i ];
- if ( *pStr == aNewFile )
+ const rtl::OString &rStr = m_aFileList[i];
+ if ( rStr == aNewFile )
bFound = sal_True;
}
#ifdef DEBUG_VERBOSE
@@ -131,9 +112,9 @@ sal_Bool CppDep::Search( ByteString aFileName )
#endif
if ( !bFound )
{
- pFileList->push_back( new ByteString( aNewFile ) );
+ m_aFileList.push_back(aNewFile);
#ifdef DEBUG_VERBOSE
- fprintf( stderr, " CppDep %s\\\n", aNewFile.GetBuffer() );
+ fprintf( stderr, " CppDep %s\\\n", aNewFile.getStr() );
#endif
Search(aNewFile);
}
@@ -145,24 +126,23 @@ sal_Bool CppDep::Search( ByteString aFileName )
return bRet;
}
-ByteString CppDep::Exists( ByteString aFileName )
+rtl::OString CppDep::Exists( rtl::OString aFileName )
{
char pFullName[1023];
- ByteString aString;
#ifdef DEBUG_VERBOSE
- fprintf( stderr, "Searching %s \n", aFileName.GetBuffer() );
+ fprintf( stderr, "Searching %s \n", aFileName.getStr() );
#endif
- size_t nCount = pSearchPath->size();
- for ( size_t n = 0; n < nCount; n++ )
+ size_t nCount = m_aSearchPath.size();
+ for ( size_t n = 0; n < nCount; ++n )
{
struct stat aBuf;
- ByteString *pPathName = (*pSearchPath)[ n ];
+ const rtl::OString &rPathName = m_aSearchPath[n];
- strcpy( pFullName, pPathName->GetBuffer());
+ strcpy( pFullName, rPathName.getStr());
strcat( pFullName, DIR_SEP );
- strcat( pFullName, aFileName.GetBuffer());
+ strcat( pFullName, aFileName.getStr());
#ifdef DEBUG_VERBOSE
fprintf( stderr, "looking for %s\t ", pFullName );
@@ -176,10 +156,10 @@ ByteString CppDep::Exists( ByteString aFileName )
fprintf( stderr, "%s \\\n", pFullName );
#endif
- return ByteString(pFullName);
+ return rtl::OString(pFullName);
}
}
- return aString;
+ return rtl::OString();
}
rtl::OString CppDep::IsIncludeStatement(rtl::OString aLine)
diff --git a/tools/bootstrp/cppdep.hxx b/tools/bootstrp/cppdep.hxx
index ca41dea188ac..d71e38f01855 100644
--- a/tools/bootstrp/cppdep.hxx
+++ b/tools/bootstrp/cppdep.hxx
@@ -31,19 +31,17 @@
#define PATH_SEP ":"
#define DIR_SEP "/"
-typedef ::std::vector< ByteString* > ByteStringList;
-
class CppDep
{
ByteString aSourceFile;
- ByteStringList *pSearchPath;
+ std::vector<rtl::OString> m_aSearchPath;
protected:
- ByteStringList *pFileList;
- ByteStringList *pSources;
+ std::vector<rtl::OString> m_aFileList;
+ std::vector<rtl::OString> m_aSources;
sal_Bool Search( ByteString aFileName );
- ByteString Exists( ByteString aFileName );
+ rtl::OString Exists( rtl::OString aFileName );
rtl::OString IsIncludeStatement(rtl::OString aLine);
public:
@@ -51,7 +49,7 @@ public:
virtual ~CppDep();
virtual void Execute();
- ByteStringList* GetDepList(){return pFileList;}
+ std::vector<rtl::OString>& GetDepList() { return m_aFileList; }
sal_Bool AddSearchPath( const char* aPath );
sal_Bool AddSource( const char * aSource );
};
diff --git a/tools/bootstrp/mkunroll/mkunroll.cxx b/tools/bootstrp/mkunroll/mkunroll.cxx
index 524ac19ea3c8..694645745658 100644
--- a/tools/bootstrp/mkunroll/mkunroll.cxx
+++ b/tools/bootstrp/mkunroll/mkunroll.cxx
@@ -104,7 +104,7 @@ MkLine::MkLine()
class MkFilter : public TextFilter
{
- static ByteString aTnr;
+ static rtl::OString aTnr;
ByteStringList *pLst;
ByteStringList *pTnrLst;
protected:
@@ -133,7 +133,7 @@ MkFilter::~MkFilter()
delete pLst;
}
-ByteString MkFilter::aTnr="$(TNR)";
+rtl::OString MkFilter::aTnr(RTL_CONSTASCII_STRINGPARAM("$(TNR)"));
void MkFilter::Filter()
{
@@ -142,14 +142,14 @@ void MkFilter::Filter()
while(( fgets(aLineBuf, LINE_LEN, pIn)) != NULL )
{
- ByteString aLine( aLineBuf );
- if ( aLine.Search("mkfilter1" ) != STRING_NOTFOUND )
+ rtl::OString aLine(aLineBuf);
+ if (aLine.indexOf(rtl::OString(RTL_CONSTASCII_STRINGPARAM("mkfilter1"))) != -1)
{
// Zeilen unterdruecken
fprintf( stderr, "mkfilter1\n" );
nState = 0;
}
- else if ( aLine.Search("unroll begin" ) != STRING_NOTFOUND )
+ else if (aLine.indexOf(rtl::OString(RTL_CONSTASCII_STRINGPARAM("unroll begin"))) != -1)
{
// Zeilen raus schreiben mit ersetzen von $(TNR) nach int n
fprintf( stderr, "\nunroll begin\n" );
@@ -170,7 +170,7 @@ void MkFilter::Filter()
sal_Bool bInTnrList = sal_True;
fprintf( stderr, ":" );
MkLine *pMkLine = new MkLine();
- if ( aLine.Search("unroll end") != STRING_NOTFOUND )
+ if (aLine.indexOf(rtl::OString(RTL_CONSTASCII_STRINGPARAM("unroll end"))) != -1)
{
fprintf( stderr, ";\nunroll end\n" );
MkLine *p_MkLine = new MkLine();
diff --git a/tools/bootstrp/rscdep.cxx b/tools/bootstrp/rscdep.cxx
index d26ffd418f65..eb6993e8498d 100644
--- a/tools/bootstrp/rscdep.cxx
+++ b/tools/bootstrp/rscdep.cxx
@@ -36,6 +36,7 @@
#include "bootstrp/prj.hxx"
+#include <rtl/strbuf.hxx>
#include <tools/string.hxx>
#include <tools/fsys.hxx>
#include <tools/stream.hxx>
@@ -215,22 +216,21 @@ int main( int argc, char** argv )
aFileName += String(".dprr", osl_getThreadTextEncoding());
aOutStream.Open( aFileName, STREAM_WRITE );
- ByteString aString;
+ rtl::OStringBuffer aString;
if ( optind < argc )
{
#ifdef DEBUG_VERBOSE
printf("further arguments : ");
#endif
- aString = ByteString( pSrsFileName );
- aString.SearchAndReplaceAll('\\', cDelim);
- aString += ByteString(" : " );
+ aString.append(rtl::OString(pSrsFileName).replace('\\', cDelim));
+ aString.append(RTL_CONSTASCII_STRINGPARAM(" : " ));
while ( optind < argc )
{
if (!bSource )
{
- aString += ByteString(" " );
- aString += ByteString( argv[optind]);
+ aString.append(' ');
+ aString.append(argv[optind]);
pDep->AddSource( argv[optind++]);
}
else
@@ -239,27 +239,20 @@ int main( int argc, char** argv )
}
}
}
- aString += aRespArg;
+ aString.append(aRespArg);
pDep->Execute();
- ByteStringList *pLst = pDep->GetDepList();
- size_t nCount = pLst->size();
- if ( nCount == 0 )
- {
- aOutStream.WriteLine( aString );
- }
- else
- {
- aString += ByteString( "\\" );
- aOutStream.WriteLine( aString );
- }
+ std::vector<rtl::OString>& rLst = pDep->GetDepList();
+ size_t nCount = rLst.size();
+ if ( nCount != 0 )
+ aString.append('\\');
+ aOutStream.WriteLine( aString.makeStringAndClear() );
- for ( size_t j = 0; j < nCount; j++ )
+ for ( size_t j = 0; j < nCount; ++j )
{
- ByteString *pStr = (*pLst)[ j ];
- pStr->SearchAndReplaceAll('\\', cDelim);
+ rtl::OStringBuffer aStr(rLst[j].replace('\\', cDelim));
if ( j != (nCount-1) )
- *pStr += ByteString( "\\" );
- aOutStream.WriteLine( *pStr );
+ aStr.append('\\');
+ aOutStream.WriteLine(aStr.makeStringAndClear());
}
delete pDep;
aOutStream.Close();
diff --git a/tools/source/inet/inetstrm.cxx b/tools/source/inet/inetstrm.cxx
index 40932bf5e08a..d70d84d2c30c 100644
--- a/tools/source/inet/inetstrm.cxx
+++ b/tools/source/inet/inetstrm.cxx
@@ -1444,7 +1444,7 @@ int INetMIMEMessageStream::GetMsgLine (sal_Char *pData, sal_uIntPtr nSize)
rtl::OStringBuffer aDelim(
RTL_CONSTASCII_STRINGPARAM("--"));
aDelim.append(pMsg->GetMultipartBoundary());
- aDelim.append("\r\n");
+ aDelim.append(RTL_CONSTASCII_STRINGPARAM("\r\n"));
rtl_copyMemory(pData, aDelim.getStr(),
aDelim.getLength());
@@ -1460,13 +1460,14 @@ int INetMIMEMessageStream::GetMsgLine (sal_Char *pData, sal_uIntPtr nSize)
if (pMsg->IsMultipart())
{
// Insert close delimiter.
- ByteString aDelim ("--");
- aDelim += pMsg->GetMultipartBoundary();
- aDelim += "--\r\n";
+ rtl::OStringBuffer aDelim(
+ RTL_CONSTASCII_STRINGPARAM("--"));
+ aDelim.append(pMsg->GetMultipartBoundary());
+ aDelim.append(RTL_CONSTASCII_STRINGPARAM("--\r\n"));
- rtl_copyMemory (
- pData, aDelim.GetBuffer(), aDelim.Len());
- return aDelim.Len();
+ rtl_copyMemory (pData, aDelim.getStr(),
+ aDelim.getLength());
+ return aDelim.getLength();
}
}
}
@@ -1626,14 +1627,18 @@ int INetMIMEMessageStream::PutMsgLine (const sal_Char *pData, sal_uIntPtr nSize)
}
ByteString aPlainDelim (pMsg->GetMultipartBoundary());
- ByteString aDelim ("--");
- aDelim += aPlainDelim;
-
- ByteString aPlainClose (aPlainDelim);
- aPlainClose += "--";
-
- ByteString aClose (aDelim);
- aClose += "--";
+ ByteString aDelim = rtl::OStringBuffer(
+ RTL_CONSTASCII_STRINGPARAM("--")).
+ append(aPlainDelim).
+ makeStringAndClear();
+ ByteString aPlainClose = rtl::OStringBuffer(
+ aPlainDelim).
+ append(RTL_CONSTASCII_STRINGPARAM("--")).
+ makeStringAndClear();
+ ByteString aClose = rtl::OStringBuffer(
+ aDelim).
+ append(RTL_CONSTASCII_STRINGPARAM("--")).
+ makeStringAndClear();
if (pMsgBuffer == NULL) pMsgBuffer = new SvMemoryStream;
pMsgBuffer->Write (pData, nSize);
diff --git a/unotools/source/i18n/calendarwrapper.cxx b/unotools/source/i18n/calendarwrapper.cxx
index 0e471d226317..6bf1e2003b6c 100644
--- a/unotools/source/i18n/calendarwrapper.cxx
+++ b/unotools/source/i18n/calendarwrapper.cxx
@@ -27,9 +27,10 @@
************************************************************************/
-#include <unotools/calendarwrapper.hxx>
+#include <rtl/strbuf.hxx>
#include <tools/string.hxx>
#include <tools/debug.hxx>
+#include <unotools/calendarwrapper.hxx>
#include <instance.hxx>
#include <com/sun/star/i18n/CalendarFieldIndex.hpp>
#include <com/sun/star/i18n/XCalendar3.hpp>
@@ -67,12 +68,12 @@ void CalendarWrapper::loadDefaultCalendar( const ::com::sun::star::lang::Locale&
if ( xC.is() )
xC->loadDefaultCalendar( rLocale );
}
- catch ( Exception& e )
+ catch (const Exception& e)
{
#ifdef DBG_UTIL
- ByteString aMsg( "loadDefaultCalendar: Exception caught\n" );
- aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
- DBG_ERRORFILE( aMsg.GetBuffer() );
+ rtl::OStringBuffer aMsg("loadDefaultCalendar: Exception caught\n");
+ aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8));
+ DBG_ERRORFILE(aMsg.getStr());
#else
(void)e;
#endif
@@ -112,12 +113,12 @@ void CalendarWrapper::loadCalendar( const ::rtl::OUString& rUniqueID, const ::co
if ( xC.is() )
return xC->getAllCalendars( rLocale );
}
- catch ( Exception& e )
+ catch (const Exception& e)
{
#ifdef DBG_UTIL
- ByteString aMsg( "getAllCalendars: Exception caught\n" );
- aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
- DBG_ERRORFILE( aMsg.GetBuffer() );
+ rtl::OStringBuffer aMsg("getAllCalendars: Exception caught\n");
+ aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8));
+ DBG_ERRORFILE(aMsg.getStr());
#else
(void)e;
#endif
@@ -133,12 +134,12 @@ void CalendarWrapper::loadCalendar( const ::rtl::OUString& rUniqueID, const ::co
if ( xC.is() )
return xC->getUniqueID();
}
- catch ( Exception& e )
+ catch (const Exception& e)
{
#ifdef DBG_UTIL
- ByteString aMsg( "getUniqueID: Exception caught\n" );
- aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
- DBG_ERRORFILE( aMsg.GetBuffer() );
+ rtl::OStringBuffer aMsg("getUniqueID: Exception caught\n");
+ aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8));
+ DBG_ERRORFILE(aMsg.getStr());
#else
(void)e;
#endif
@@ -154,12 +155,12 @@ void CalendarWrapper::setDateTime( double nTimeInDays )
if ( xC.is() )
xC->setDateTime( nTimeInDays );
}
- catch ( Exception& e )
+ catch (const Exception& e)
{
#ifdef DBG_UTIL
- ByteString aMsg( "setDateTime: Exception caught\n" );
- aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
- DBG_ERRORFILE( aMsg.GetBuffer() );
+ rtl::OStringBuffer aMsg("setDateTime: Exception caught\n");
+ aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8));
+ DBG_ERRORFILE(aMsg.getStr());
#else
(void)e;
#endif
@@ -174,12 +175,12 @@ double CalendarWrapper::getDateTime() const
if ( xC.is() )
return xC->getDateTime();
}
- catch ( Exception& e )
+ catch (const Exception& e)
{
#ifdef DBG_UTIL
- ByteString aMsg( "getDateTime: Exception caught\n" );
- aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
- DBG_ERRORFILE( aMsg.GetBuffer() );
+ rtl::OStringBuffer aMsg("getDateTime: Exception caught\n");
+ aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8));
+ DBG_ERRORFILE(aMsg.getStr());
#else
(void)e;
#endif
@@ -204,12 +205,12 @@ sal_Int32 CalendarWrapper::getCombinedOffsetInMillis(
nOffset += static_cast<sal_uInt16>( nSecondMillis);
}
}
- catch ( Exception& e )
+ catch (const Exception& e)
{
#ifdef DBG_UTIL
- ByteString aMsg( "setLocalDateTime: Exception caught\n" );
- aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
- DBG_ERRORFILE( aMsg.GetBuffer() );
+ rtl::OStringBuffer aMsg("setLocalDateTime: Exception caught\n");
+ aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8));
+ DBG_ERRORFILE(aMsg.getStr());
#else
(void)e;
#endif
@@ -276,12 +277,12 @@ void CalendarWrapper::setLocalDateTime( double nTimeInDays )
}
}
}
- catch ( Exception& e )
+ catch (const Exception& e)
{
#ifdef DBG_UTIL
- ByteString aMsg( "setLocalDateTime: Exception caught\n" );
- aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
- DBG_ERRORFILE( aMsg.GetBuffer() );
+ rtl::OStringBuffer aMsg("setLocalDateTime: Exception caught\n");
+ aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8));
+ DBG_ERRORFILE(aMsg.getStr());
#else
(void)e;
#endif
@@ -302,12 +303,12 @@ double CalendarWrapper::getLocalDateTime() const
return nTimeInDays;
}
}
- catch ( Exception& e )
+ catch (const Exception& e)
{
#ifdef DBG_UTIL
- ByteString aMsg( "getLocalDateTime: Exception caught\n" );
- aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
- DBG_ERRORFILE( aMsg.GetBuffer() );
+ rtl::OStringBuffer aMsg("getLocalDateTime: Exception caught\n");
+ aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8));
+ DBG_ERRORFILE(aMsg.getStr());
#else
(void)e;
#endif
@@ -323,12 +324,12 @@ void CalendarWrapper::setValue( sal_Int16 nFieldIndex, sal_Int16 nValue )
if ( xC.is() )
xC->setValue( nFieldIndex, nValue );
}
- catch ( Exception& e )
+ catch (const Exception& e)
{
#ifdef DBG_UTIL
- ByteString aMsg( "setValue: Exception caught\n" );
- aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
- DBG_ERRORFILE( aMsg.GetBuffer() );
+ rtl::OStringBuffer aMsg("setValue: Exception caught\n");
+ aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8));
+ DBG_ERRORFILE(aMsg.getStr());
#else
(void)e;
#endif
@@ -343,12 +344,12 @@ sal_Bool CalendarWrapper::isValid() const
if ( xC.is() )
return xC->isValid();
}
- catch ( Exception& e )
+ catch (const Exception& e)
{
#ifdef DBG_UTIL
- ByteString aMsg( "isValid: Exception caught\n" );
- aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
- DBG_ERRORFILE( aMsg.GetBuffer() );
+ rtl::OStringBuffer aMsg("isValid: Exception caught\n");
+ aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8));
+ DBG_ERRORFILE(aMsg.getStr());
#else
(void)e;
#endif
@@ -364,12 +365,12 @@ sal_Int16 CalendarWrapper::getValue( sal_Int16 nFieldIndex ) const
if ( xC.is() )
return xC->getValue( nFieldIndex );
}
- catch ( Exception& e )
+ catch (const Exception& e)
{
#ifdef DBG_UTIL
- ByteString aMsg( "getValue: Exception caught\n" );
- aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
- DBG_ERRORFILE( aMsg.GetBuffer() );
+ rtl::OStringBuffer aMsg("getValue: Exception caught\n");
+ aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8));
+ DBG_ERRORFILE(aMsg.getStr());
#else
(void)e;
#endif
@@ -385,12 +386,12 @@ void CalendarWrapper::addValue( sal_Int16 nFieldIndex, sal_Int32 nAmount )
if ( xC.is() )
xC->addValue( nFieldIndex, nAmount );
}
- catch ( Exception& e )
+ catch (const Exception& e)
{
#ifdef DBG_UTIL
- ByteString aMsg( "addValue: Exception caught\n" );
- aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
- DBG_ERRORFILE( aMsg.GetBuffer() );
+ rtl::OStringBuffer aMsg("addValue: Exception caught\n");
+ aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8));
+ DBG_ERRORFILE(aMsg.getStr());
#else
(void)e;
#endif
@@ -405,12 +406,12 @@ sal_Int16 CalendarWrapper::getFirstDayOfWeek() const
if ( xC.is() )
return xC->getFirstDayOfWeek();
}
- catch ( Exception& e )
+ catch (const Exception& e)
{
#ifdef DBG_UTIL
- ByteString aMsg( "getFirstDayOfWeek: Exception caught\n" );
- aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
- DBG_ERRORFILE( aMsg.GetBuffer() );
+ rtl::OStringBuffer aMsg("getFirstDayOfWeek: Exception caught\n");
+ aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8));
+ DBG_ERRORFILE(aMsg.getStr());
#else
(void)e;
#endif
@@ -426,12 +427,12 @@ void CalendarWrapper::setFirstDayOfWeek( sal_Int16 nDay )
if ( xC.is() )
xC->setFirstDayOfWeek( nDay );
}
- catch ( Exception& e )
+ catch (const Exception& e)
{
#ifdef DBG_UTIL
- ByteString aMsg( "setFirstDayOfWeek: Exception caught\n" );
- aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
- DBG_ERRORFILE( aMsg.GetBuffer() );
+ rtl::OStringBuffer aMsg("setFirstDayOfWeek: Exception caught\n");
+ aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8));
+ DBG_ERRORFILE(aMsg.getStr());
#else
(void)e;
#endif
@@ -446,12 +447,12 @@ void CalendarWrapper::setMinimumNumberOfDaysForFirstWeek( sal_Int16 nDays )
if ( xC.is() )
xC->setMinimumNumberOfDaysForFirstWeek( nDays );
}
- catch ( Exception& e )
+ catch (const Exception& e)
{
#ifdef DBG_UTIL
- ByteString aMsg( "setMinimumNumberOfDaysForFirstWeek: Exception caught\n" );
- aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
- DBG_ERRORFILE( aMsg.GetBuffer() );
+ rtl::OStringBuffer aMsg("setMinimumNumberOfDaysForFirstWeek: Exception caught\n");
+ aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8));
+ DBG_ERRORFILE(aMsg.getStr());
#else
(void)e;
#endif
@@ -466,12 +467,12 @@ sal_Int16 CalendarWrapper::getNumberOfMonthsInYear() const
if ( xC.is() )
return xC->getNumberOfMonthsInYear();
}
- catch ( Exception& e )
+ catch (const Exception& e)
{
#ifdef DBG_UTIL
- ByteString aMsg( "getNumberOfMonthsInYear: Exception caught\n" );
- aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
- DBG_ERRORFILE( aMsg.GetBuffer() );
+ rtl::OStringBuffer aMsg("getNumberOfMonthsInYear: Exception caught\n");
+ aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8));
+ DBG_ERRORFILE(aMsg.getStr());
#else
(void)e;
#endif
@@ -487,12 +488,12 @@ sal_Int16 CalendarWrapper::getNumberOfDaysInWeek() const
if ( xC.is() )
return xC->getNumberOfDaysInWeek();
}
- catch ( Exception& e )
+ catch (const Exception& e)
{
#ifdef DBG_UTIL
- ByteString aMsg( "getNumberOfDaysInWeek: Exception caught\n" );
- aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
- DBG_ERRORFILE( aMsg.GetBuffer() );
+ rtl::OStringBuffer aMsg("getNumberOfDaysInWeek: Exception caught\n");
+ aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8));
+ DBG_ERRORFILE(aMsg.getStr());
#else
(void)e;
#endif
@@ -508,12 +509,12 @@ sal_Int16 CalendarWrapper::getNumberOfDaysInWeek() const
if ( xC.is() )
return xC->getMonths2();
}
- catch ( Exception& e )
+ catch (const Exception& e)
{
#ifdef DBG_UTIL
- ByteString aMsg( "getMonths: Exception caught\n" );
- aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
- DBG_ERRORFILE( aMsg.GetBuffer() );
+ rtl::OStringBuffer aMsg("getMonths: Exception caught\n");
+ aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8));
+ DBG_ERRORFILE(aMsg.getStr());
#else
(void)e;
#endif
@@ -529,12 +530,12 @@ sal_Int16 CalendarWrapper::getNumberOfDaysInWeek() const
if ( xC.is() )
return xC->getDays2();
}
- catch ( Exception& e )
+ catch (const Exception& e)
{
#ifdef DBG_UTIL
- ByteString aMsg( "getDays: Exception caught\n" );
- aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
- DBG_ERRORFILE( aMsg.GetBuffer() );
+ rtl::OStringBuffer aMsg("getDays: Exception caught\n");
+ aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8));
+ DBG_ERRORFILE(aMsg.getStr());
#else
(void)e;
#endif
@@ -550,12 +551,12 @@ String CalendarWrapper::getDisplayName( sal_Int16 nCalendarDisplayIndex, sal_Int
if ( xC.is() )
return xC->getDisplayName( nCalendarDisplayIndex, nIdx, nNameType );
}
- catch ( Exception& e )
+ catch (const Exception& e)
{
#ifdef DBG_UTIL
- ByteString aMsg( "getDisplayName: Exception caught\n" );
- aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
- DBG_ERRORFILE( aMsg.GetBuffer() );
+ rtl::OStringBuffer aMsg("getDisplayName: Exception caught\n");
+ aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8));
+ DBG_ERRORFILE(aMsg.getStr());
#else
(void)e;
#endif
@@ -573,12 +574,12 @@ String CalendarWrapper::getDisplayString( sal_Int32 nCalendarDisplayCode, sal_In
if ( xC.is() )
return xC->getDisplayString( nCalendarDisplayCode, nNativeNumberMode );
}
- catch ( Exception& e )
+ catch (const Exception& e)
{
#ifdef DBG_UTIL
- ByteString aMsg( "getDisplayString: Exception caught\n" );
- aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
- DBG_ERRORFILE( aMsg.GetBuffer() );
+ rtl::OStringBuffer aMsg("getDisplayString: Exception caught\n");
+ aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8));
+ DBG_ERRORFILE(aMsg.getStr());
#else
(void)e;
#endif
@@ -596,12 +597,12 @@ String CalendarWrapper::getDisplayString( sal_Int32 nCalendarDisplayCode, sal_In
if ( xC.is() )
return xC->getLoadedCalendar2();
}
- catch ( Exception& e )
+ catch (const Exception& e)
{
#ifdef DBG_UTIL
- ByteString aMsg( "getLoadedCalendar2: Exception caught\n" );
- aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
- DBG_ERRORFILE( aMsg.GetBuffer() );
+ rtl::OStringBuffer aMsg( "getLoadedCalendar2: Exception caught\n" );
+ aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8));
+ DBG_ERRORFILE(aMsg.getStr());
#else
(void)e;
#endif
@@ -617,12 +618,12 @@ String CalendarWrapper::getDisplayString( sal_Int32 nCalendarDisplayCode, sal_In
if ( xC.is() )
return xC->getGenitiveMonths2();
}
- catch ( Exception& e )
+ catch (const Exception& e)
{
#ifdef DBG_UTIL
- ByteString aMsg( "getGenitiveMonths: Exception caught\n" );
- aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
- DBG_ERRORFILE( aMsg.GetBuffer() );
+ rtl::OStringBuffer aMsg("getGenitiveMonths: Exception caught\n");
+ aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8));
+ DBG_ERRORFILE(aMsg.getStr());
#else
(void)e;
#endif
@@ -638,12 +639,12 @@ String CalendarWrapper::getDisplayString( sal_Int32 nCalendarDisplayCode, sal_In
if ( xC.is() )
return xC->getPartitiveMonths2();
}
- catch ( Exception& e )
+ catch (const Exception& e)
{
#ifdef DBG_UTIL
- ByteString aMsg( "getPartitiveMonths: Exception caught\n" );
- aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
- DBG_ERRORFILE( aMsg.GetBuffer() );
+ rtl::OStringBuffer aMsg("getPartitiveMonths: Exception caught\n");
+ aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8));
+ DBG_ERRORFILE(aMsg.getStr());
#else
(void)e;
#endif
diff --git a/unotools/source/i18n/charclass.cxx b/unotools/source/i18n/charclass.cxx
index 1800915bfa9d..f3c1d416f34a 100644
--- a/unotools/source/i18n/charclass.cxx
+++ b/unotools/source/i18n/charclass.cxx
@@ -448,9 +448,9 @@ sal_Int32 CharClass::getStringType( const String& rStr, xub_StrLen nPos, xub_Str
catch ( const Exception& e )
{
#ifdef DBG_UTIL
- ByteString aMsg( "parseAnyToken: Exception caught\n" );
- aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
- DBG_ERRORFILE( aMsg.GetBuffer() );
+ rtl::OStringBuffer aMsg("parseAnyToken: Exception caught\n");
+ aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8));
+ DBG_ERRORFILE(aMsg.getStr());
#else
(void)e;
#endif
@@ -480,9 +480,9 @@ sal_Int32 CharClass::getStringType( const String& rStr, xub_StrLen nPos, xub_Str
catch ( const Exception& e )
{
#ifdef DBG_UTIL
- ByteString aMsg( "parsePredefinedToken: Exception caught\n" );
- aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
- DBG_ERRORFILE( aMsg.GetBuffer() );
+ rtl::OStringBuffer aMsg("parsePredefinedToken: Exception caught\n");
+ aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8));
+ DBG_ERRORFILE(aMsg.getStr());
#else
(void)e;
#endif
diff --git a/unotools/source/i18n/localedatawrapper.cxx b/unotools/source/i18n/localedatawrapper.cxx
index 8e926a48bd8f..56944d2bb2a9 100644
--- a/unotools/source/i18n/localedatawrapper.cxx
+++ b/unotools/source/i18n/localedatawrapper.cxx
@@ -145,12 +145,12 @@ void LocaleDataWrapper::invalidateData()
if ( xLD.is() )
return xLD->getLanguageCountryInfo( getLocale() );
}
- catch ( Exception& e )
+ catch (const Exception& e)
{
#ifdef DBG_UTIL
- ByteString aMsg( "getLanguageCountryInfo: Exception caught\n" );
- aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
- DBG_ERRORFILE( aMsg.GetBuffer() );
+ rtl::OStringBuffer aMsg( "getLanguageCountryInfo: Exception caught\n");
+ aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8));
+ DBG_ERRORFILE(aMsg.getStr());
#else
(void)e;
#endif
@@ -166,12 +166,12 @@ void LocaleDataWrapper::invalidateData()
if ( xLD.is() )
return xLD->getLocaleItem( getLocale() );
}
- catch ( Exception& e )
+ catch (const Exception& e)
{
#ifdef DBG_UTIL
- ByteString aMsg( "getLocaleItem: Exception caught\n" );
- aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
- DBG_ERRORFILE( aMsg.GetBuffer() );
+ rtl::OStringBuffer aMsg("getLocaleItem: Exception caught\n");
+ aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8));
+ DBG_ERRORFILE(aMsg.getStr());
#else
(void)e;
#endif
@@ -187,12 +187,12 @@ void LocaleDataWrapper::invalidateData()
if ( xLD.is() )
return xLD->getAllCurrencies2( getLocale() );
}
- catch ( Exception& e )
+ catch (const Exception& e)
{
#ifdef DBG_UTIL
- ByteString aMsg( "getAllCurrencies: Exception caught\n" );
- aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
- DBG_ERRORFILE( aMsg.GetBuffer() );
+ rtl::OStringBuffer aMsg("getAllCurrencies: Exception caught\n");
+ aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8));
+ DBG_ERRORFILE(aMsg.getStr());
#else
(void)e;
#endif
@@ -208,12 +208,12 @@ void LocaleDataWrapper::invalidateData()
if ( xLD.is() )
return xLD->getAllFormats( getLocale() );
}
- catch ( Exception& e )
+ catch (const Exception& e)
{
#ifdef DBG_UTIL
- ByteString aMsg( "getAllFormats: Exception caught\n" );
- aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
- DBG_ERRORFILE( aMsg.GetBuffer() );
+ rtl::OStringBuffer aMsg("getAllFormats: Exception caught\n");
+ aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8));
+ DBG_ERRORFILE(aMsg.getStr());
#else
(void)e;
#endif
@@ -229,12 +229,12 @@ void LocaleDataWrapper::invalidateData()
if ( xLD.is() )
return xLD->getCollatorImplementations( getLocale() );
}
- catch ( Exception& e )
+ catch (const Exception& e)
{
#ifdef DBG_UTIL
- ByteString aMsg( "getCollatorImplementations: Exception caught\n" );
- aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
- DBG_ERRORFILE( aMsg.GetBuffer() );
+ rtl::OStringBuffer aMsg("getCollatorImplementations: Exception caught\n");
+ aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8));
+ DBG_ERRORFILE(aMsg.getStr());
#else
(void)e;
#endif
@@ -250,12 +250,12 @@ void LocaleDataWrapper::invalidateData()
if ( xLD.is() )
return xLD->getTransliterations( getLocale() );
}
- catch ( Exception& e )
+ catch (const Exception& e)
{
#ifdef DBG_UTIL
- ByteString aMsg( "getTransliterations: Exception caught\n" );
- aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
- DBG_ERRORFILE( aMsg.GetBuffer() );
+ rtl::OStringBuffer aMsg("getTransliterations: Exception caught\n");
+ aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8));
+ DBG_ERRORFILE(aMsg.getStr());
#else
(void)e;
#endif
@@ -271,12 +271,12 @@ void LocaleDataWrapper::invalidateData()
if ( xLD.is() )
return xLD->getForbiddenCharacters( getLocale() );
}
- catch ( Exception& e )
+ catch (const Exception& e)
{
#ifdef DBG_UTIL
- ByteString aMsg( "getForbiddenCharacters: Exception caught\n" );
- aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
- DBG_ERRORFILE( aMsg.GetBuffer() );
+ rtl::OStringBuffer aMsg("getForbiddenCharacters: Exception caught\n");
+ aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8));
+ DBG_ERRORFILE(aMsg.getStr());
#else
(void)e;
#endif
@@ -295,9 +295,9 @@ void LocaleDataWrapper::invalidateData()
catch ( Exception& e )
{
#ifdef DBG_UTIL
- ByteString aMsg( "getReservedWord: Exception caught\n" );
- aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
- DBG_ERRORFILE( aMsg.GetBuffer() );
+ rtl::OStringBuffer aMsg("getReservedWord: Exception caught\n");
+ aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8));
+ DBG_ERRORFILE(aMsg.getStr());
#else
(void)e;
#endif
@@ -321,9 +321,9 @@ void LocaleDataWrapper::invalidateData()
catch ( Exception& e )
{
#ifdef DBG_UTIL
- ByteString aMsg( "getAllInstalledLocaleNames: Exception caught\n" );
- aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
- DBG_ERRORFILE( aMsg.GetBuffer() );
+ rtl::OStringBuffer aMsg("getAllInstalledLocaleNames: Exception caught\n");
+ aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8));
+ DBG_ERRORFILE(aMsg.getStr());
#else
(void)e;
#endif
@@ -1882,7 +1882,7 @@ rtl::OUString LocaleDataWrapper::appendLocaleInfo(const rtl::OUString& rDebugMsg
// static
void LocaleDataWrapper::outputCheckMessage( const String& rMsg )
{
- outputCheckMessage( ByteString( rMsg, RTL_TEXTENCODING_UTF8).GetBuffer());
+ outputCheckMessage(rtl::OUStringToOString(rMsg, RTL_TEXTENCODING_UTF8).getStr());
}
@@ -1937,12 +1937,12 @@ void LocaleDataWrapper::evaluateLocaleDataChecking()
if ( xLD.is() )
return xLD->getAllCalendars2( getLocale() );
}
- catch ( Exception& e )
+ catch (const Exception& e)
{
#ifdef DBG_UTIL
- ByteString aMsg( "getAllCalendars: Exception caught\n" );
- aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
- DBG_ERRORFILE( aMsg.GetBuffer() );
+ rtl::OStringBuffer aMsg("getAllCalendars: Exception caught\n");
+ aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8));
+ DBG_ERRORFILE(aMsg.getStr());
#else
(void)e;
#endif
diff --git a/unotools/source/i18n/transliterationwrapper.cxx b/unotools/source/i18n/transliterationwrapper.cxx
index 7de48f3adfa8..1ae8b7957265 100644
--- a/unotools/source/i18n/transliterationwrapper.cxx
+++ b/unotools/source/i18n/transliterationwrapper.cxx
@@ -172,9 +172,9 @@ void TransliterationWrapper::loadModuleImpl() const
catch ( Exception& e )
{
#ifdef DBG_UTIL
- ByteString aMsg( "loadModuleImpl: Exception caught\n" );
- aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
- DBG_ERRORFILE( aMsg.GetBuffer() );
+ rtl::OStringBuffer aMsg("loadModuleImpl: Exception caught\n");
+ aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8));
+ DBG_ERRORFILE(aMsg.getStr());
#else
(void)e;
#endif
@@ -199,9 +199,9 @@ void TransliterationWrapper::loadModuleByImplName(
catch ( Exception& e )
{
#ifdef DBG_UTIL
- ByteString aMsg( "loadModuleByImplName: Exception caught\n" );
- aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
- DBG_ERRORFILE( aMsg.GetBuffer() );
+ rtl::OStringBuffer aMsg("loadModuleByImplName: Exception caught\n");
+ aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8));
+ DBG_ERRORFILE(aMsg.getStr());
#else
(void)e;
#endif
@@ -225,9 +225,9 @@ sal_Bool TransliterationWrapper::equals(
catch ( Exception& e )
{
#ifdef DBG_UTIL
- ByteString aMsg( "equals: Exception caught\n" );
- aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
- DBG_ERRORFILE( aMsg.GetBuffer() );
+ rtl::OStringBuffer aMsg("equals: Exception caught\n");
+ aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8));
+ DBG_ERRORFILE(aMsg.getStr());
#else
(void)e;
#endif
@@ -247,12 +247,12 @@ sal_Int32 TransliterationWrapper::compareSubstring(
if ( xTrans.is() )
return xTrans->compareSubstring( rStr1, nOff1, nLen1, rStr2, nOff2, nLen2 );
}
- catch ( Exception& e )
+ catch (const Exception& e)
{
#ifdef DBG_UTIL
- ByteString aMsg( "compareSubstring: Exception caught\n" );
- aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
- DBG_ERRORFILE( aMsg.GetBuffer() );
+ rtl::OStringBuffer aMsg("compareSubstring: Exception caught\n");
+ aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8));
+ DBG_ERRORFILE(aMsg.getStr());
#else
(void)e;
#endif
@@ -270,12 +270,12 @@ sal_Int32 TransliterationWrapper::compareString( const String& rStr1, const Stri
if ( xTrans.is() )
return xTrans->compareString( rStr1, rStr2 );
}
- catch ( Exception& e )
+ catch (const Exception& e)
{
#ifdef DBG_UTIL
- ByteString aMsg( "compareString: Exception caught\n" );
- aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
- DBG_ERRORFILE( aMsg.GetBuffer() );
+ rtl::OStringBuffer aMsg("compareString: Exception caught\n");
+ aMsg.append(rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8));
+ DBG_ERRORFILE(aMsg.getStr());
#else
(void)e;
#endif