diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-11-27 08:21:00 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-11-28 09:55:02 +0000 |
commit | 3fd28200f1c1a46970789f21ee6fce3f6f3ac1ec (patch) | |
tree | 18600b1b78ed5ede7f7068a98fe3fe7b6962b311 /idl/source | |
parent | 48221d6a2bf4c327b6cadcdc65169997f7d7408d (diff) |
ByteString->rtl::OString[Buffer]
Diffstat (limited to 'idl/source')
-rw-r--r-- | idl/source/objects/basobj.cxx | 2 | ||||
-rw-r--r-- | idl/source/objects/bastype.cxx | 2 | ||||
-rw-r--r-- | idl/source/objects/module.cxx | 16 | ||||
-rw-r--r-- | idl/source/objects/object.cxx | 4 | ||||
-rw-r--r-- | idl/source/objects/slot.cxx | 4 | ||||
-rw-r--r-- | idl/source/prj/command.cxx | 21 | ||||
-rw-r--r-- | idl/source/prj/database.cxx | 10 | ||||
-rw-r--r-- | idl/source/prj/svidl.cxx | 61 |
8 files changed, 69 insertions, 51 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 { |