diff options
author | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2011-07-21 18:51:11 +0200 |
---|---|---|
committer | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2011-07-21 18:51:11 +0200 |
commit | 200bc6c582d6cf2365001f27928c1e3d1f9c9845 (patch) | |
tree | 0f27abe75bc3603341aef715372676aee8d86835 /idl | |
parent | 01ea92166c12fe080575f8faba4162779fb46c28 (diff) | |
parent | 1b465fcc0f5f699308c6ee5113dde6b82842c3dd (diff) |
resyncing to master
Diffstat (limited to 'idl')
-rw-r--r-- | idl/inc/database.hxx | 4 | ||||
-rw-r--r-- | idl/source/cmptools/lex.cxx | 2 | ||||
-rw-r--r-- | idl/source/objects/basobj.cxx | 11 | ||||
-rw-r--r-- | idl/source/objects/bastype.cxx | 6 | ||||
-rw-r--r-- | idl/source/objects/object.cxx | 19 | ||||
-rw-r--r-- | idl/source/objects/slot.cxx | 52 | ||||
-rw-r--r-- | idl/source/objects/types.cxx | 9 | ||||
-rw-r--r-- | idl/source/prj/database.cxx | 29 |
8 files changed, 81 insertions, 51 deletions
diff --git a/idl/inc/database.hxx b/idl/inc/database.hxx index 74ccbd575354..c8ad5cf2bff7 100644 --- a/idl/inc/database.hxx +++ b/idl/inc/database.hxx @@ -82,7 +82,6 @@ class SvIdlDataBase protected: #ifdef IDL_COMPILER - ByteString aModulePrefix; SvMetaObjectMemberStack aContextStack; String aPath; SvIdlError aError; @@ -117,7 +116,6 @@ public: void SetExportFile( const String& rName ) { aExportFile = rName; } void AppendAttr( SvMetaAttribute *pSlot ); - const ByteString& GetActModulePrefix() const { return aModulePrefix; } const SvIdlError & GetError() const { return aError; } void SetError( const SvIdlError & r ) { aError = r; } @@ -128,7 +126,7 @@ public: void Write( const ByteString & rText ); void WriteError( const ByteString & rErrWrn, const ByteString & rFileName, - const ByteString & rErrorText, + const rtl::OString& rErrorText, sal_uLong nRow = 0, sal_uLong nColumn = 0 ) const; void WriteError( SvTokenStream & rInStm ); void SetError( const ByteString & rError, SvToken * pTok ); diff --git a/idl/source/cmptools/lex.cxx b/idl/source/cmptools/lex.cxx index 04281e3fcff7..12ce3e1ed4fd 100644 --- a/idl/source/cmptools/lex.cxx +++ b/idl/source/cmptools/lex.cxx @@ -50,7 +50,7 @@ ByteString SvToken::GetTokenAsString() const aStr = aString; break; case SVTOKEN_INTEGER: - aStr = ByteString::CreateFromInt64(nLong); + aStr = rtl::OString::valueOf(static_cast<sal_Int64>(nLong)); break; case SVTOKEN_STRING: aStr = aString; diff --git a/idl/source/objects/basobj.cxx b/idl/source/objects/basobj.cxx index 7a284999e6eb..97822791533e 100644 --- a/idl/source/objects/basobj.cxx +++ b/idl/source/objects/basobj.cxx @@ -401,8 +401,8 @@ void SvMetaName::WriteAttributes( SvIdlDataBase &, SvStream & rOutStm, { WriteTab( rOutStm, nTab ); rOutStm << "helpcontext(" - << ByteString::CreateFromInt64( - GetHelpContext().GetValue() ).GetBuffer() + << rtl::OString::valueOf(static_cast<sal_Int64>( + GetHelpContext().GetValue())).getStr() << ")," << endl; } } @@ -587,8 +587,11 @@ void SvMetaExtern::WriteAttributes( SvIdlDataBase & rBase, SvStream & rOutStm, WriteTab( rOutStm, nTab ); rOutStm << "uuid(" << ByteString( GetUUId().GetHexName(), RTL_TEXTENCODING_UTF8 ).GetBuffer() << ")," << endl; WriteTab( rOutStm, nTab ); - rOutStm << "version(" << ByteString::CreateFromInt32( aVersion.GetMajorVersion() ).GetBuffer() << '.' - << ByteString::CreateFromInt32( aVersion.GetMinorVersion() ).GetBuffer() << ")," << endl; + rOutStm << "version(" + << rtl::OString::valueOf(static_cast<sal_Int32>(aVersion.GetMajorVersion())).getStr() + << '.' + << rtl::OString::valueOf(static_cast<sal_Int32>(aVersion.GetMinorVersion())).getStr() + << ")," << endl; } #endif // IDL_COMPILER diff --git a/idl/source/objects/bastype.cxx b/idl/source/objects/bastype.cxx index 5556da3ad4b5..01faea8c6d3f 100644 --- a/idl/source/objects/bastype.cxx +++ b/idl/source/objects/bastype.cxx @@ -432,8 +432,10 @@ sal_Bool SvVersion::ReadSvIdl( SvTokenStream & rInStm ) sal_Bool SvVersion::WriteSvIdl( SvStream & rOutStm ) { rOutStm << SvHash_Version()->GetName().GetBuffer() << '(' - << ByteString::CreateFromInt32( nMajorVersion ).GetBuffer() << '.' - << ByteString::CreateFromInt32( nMinorVersion ).GetBuffer() << ')'; + << rtl::OString::valueOf(static_cast<sal_Int32>(nMajorVersion)).getStr() + << '.' + << rtl::OString::valueOf(static_cast<sal_Int32>(nMinorVersion)).getStr() + << ')'; return sal_True; } #endif //IDL_COMPILER diff --git a/idl/source/objects/object.cxx b/idl/source/objects/object.cxx index 7344eba7fd64..8308d50625ec 100644 --- a/idl/source/objects/object.cxx +++ b/idl/source/objects/object.cxx @@ -356,7 +356,8 @@ sal_Bool SvMetaClass::TestAttribute( SvIdlDataBase & rBase, SvTokenStream & rInS if( nId1 == nId2 && nId1 != 0 ) { OSL_FAIL( "Gleiche Id in MetaClass : " ); - OSL_FAIL( ByteString::CreateFromInt32( pS->GetSlotId().GetValue() ).GetBuffer() ); + OSL_FAIL(rtl::OString::valueOf(static_cast<sal_Int32>( + pS->GetSlotId().GetValue())).getStr()); OSL_FAIL( pS->GetSlotId().GetBuffer() ); OSL_FAIL( rAttr.GetSlotId().GetBuffer() ); @@ -719,8 +720,12 @@ void SvMetaClass::WriteCxx( SvIdlDataBase &, SvStream & rOutStm, sal_uInt16 ) << '{' << endl << "\tSvGlobalName aN( " << ByteString( pMod->GetUUId().GetctorName(), RTL_TEXTENCODING_UTF8 ).GetBuffer() << " );" << endl; rOutStm << "\t*pGN = aN;" << endl - << "\t*pMajor = " << ByteString::CreateFromInt32(pMod->GetVersion().GetMajorVersion()).GetBuffer() << ';' << endl - << "\t*pMinor = " << ByteString::CreateFromInt32(pMod->GetVersion().GetMinorVersion()).GetBuffer() << ';' << endl + << "\t*pMajor = " + << rtl::OString::valueOf(static_cast<sal_Int32>(pMod->GetVersion().GetMajorVersion())).getStr() + << ';' << endl + << "\t*pMinor = " + << rtl::OString::valueOf(static_cast<sal_Int32>(pMod->GetVersion().GetMinorVersion())).getStr() + << ';' << endl << "\treturn sal_True;" << endl << '}' << endl; @@ -730,8 +735,12 @@ void SvMetaClass::WriteCxx( SvIdlDataBase &, SvStream & rOutStm, sal_uInt16 ) << "\t sal_uInt16 * pMinor ) const" << endl; rOutStm << '{' << endl << "\t*pName = \"" << pMod->GetTypeLibFileName().GetBuffer() << "\";" << endl - << "\t*pMajor = " << ByteString::CreateFromInt32(pMod->GetVersion().GetMajorVersion()).GetBuffer() << ';' << endl - << "\t*pMinor = " << ByteString::CreateFromInt32(pMod->GetVersion().GetMinorVersion()).GetBuffer() << ';' << endl + << "\t*pMajor = " + << rtl::OString::valueOf(static_cast<sal_Int32>(pMod->GetVersion().GetMajorVersion())).getStr() + << ';' << endl + << "\t*pMinor = " + << rtl::OString::valueOf(static_cast<sal_Int32>(pMod->GetVersion().GetMinorVersion())).getStr() + << ';' << endl << "\treturn sal_True;" << endl << '}' << endl; diff --git a/idl/source/objects/slot.cxx b/idl/source/objects/slot.cxx index 746fa741af25..e56d95776960 100644 --- a/idl/source/objects/slot.cxx +++ b/idl/source/objects/slot.cxx @@ -1154,8 +1154,11 @@ void SvMetaSlot::WriteSlot( const ByteString & rShellName, sal_uInt16 nCount, sal_Bool bIsEnumSlot = 0 != pEnumValue; - rOutStm << "// Slot Nr. " << ByteString::CreateFromInt32(nListPos).GetBuffer() << " : "; - ByteString aSlotIdValue( ByteString::CreateFromInt32( GetSlotId().GetValue() ) ); + rOutStm << "// Slot Nr. " + << rtl::OString::valueOf(static_cast<sal_Int32>(nListPos)).getStr() + << " : "; + ByteString aSlotIdValue(rtl::OString::valueOf(static_cast<sal_Int32>( + GetSlotId().GetValue()))); rOutStm << aSlotIdValue.GetBuffer() << endl; WriteTab( rOutStm, 1 ); if( bIsEnumSlot ) @@ -1181,12 +1184,12 @@ void SvMetaSlot::WriteSlot( const ByteString & rShellName, sal_uInt16 nCount, if( bIsEnumSlot ) { rOutStm << "&a" << rShellName.GetBuffer() << "Slots_Impl[" - << ByteString::CreateFromInt32(pLinkedSlot->GetListPos()).GetBuffer() - << "] /*Offset Master*/, " << endl; + << rtl::OString::valueOf(static_cast<sal_Int32>(pLinkedSlot->GetListPos())).getStr() + << "] /*Offset Master*/, " << endl; WriteTab( rOutStm, 4 ); rOutStm << "&a" << rShellName.GetBuffer() << "Slots_Impl[" - << ByteString::CreateFromInt32(pNextSlot->GetListPos()).GetBuffer() - << "] /*Offset Next*/, " << endl; + << rtl::OString::valueOf(static_cast<sal_Int32>(pNextSlot->GetListPos())).getStr() + << "] /*Offset Next*/, " << endl; WriteTab( rOutStm, 4 ); @@ -1240,14 +1243,14 @@ void SvMetaSlot::WriteSlot( const ByteString & rShellName, sal_uInt16 nCount, else { rOutStm << "&a" << rShellName.GetBuffer() << "Slots_Impl[" - << ByteString::CreateFromInt32(pLinkedSlot->GetListPos()).GetBuffer() + << rtl::OString::valueOf(static_cast<sal_Int32>(pLinkedSlot->GetListPos())).getStr() << "] /*Offset Linked*/, " << endl; WriteTab( rOutStm, 4 ); } rOutStm << "&a" << rShellName.GetBuffer() << "Slots_Impl[" - << ByteString::CreateFromInt32(pNextSlot->GetListPos()).GetBuffer() - << "] /*Offset Next*/, " << endl; + << rtl::OString::valueOf(static_cast<sal_Int32>(pNextSlot->GetListPos())).getStr() + << "] /*Offset Next*/, " << endl; WriteTab( rOutStm, 4 ); @@ -1357,7 +1360,9 @@ void SvMetaSlot::WriteSlot( const ByteString & rShellName, sal_uInt16 nCount, { rOutStm << ',' << endl; WriteTab( rOutStm, 4 ); - rOutStm << ByteString::CreateFromInt32( nCount ).GetBuffer() << "/*Offset*/, "; + rOutStm + << rtl::OString::valueOf(static_cast<sal_Int32>(nCount)).getStr() + << "/*Offset*/, "; if( IsMethod() ) { @@ -1368,7 +1373,10 @@ void SvMetaSlot::WriteSlot( const ByteString & rShellName, sal_uInt16 nCount, else pType = GetType(); sal_uLong nSCount = pType->GetAttrCount(); - rOutStm << ByteString::CreateFromInt32( nSCount ).GetBuffer() << "/*Count*/"; + rOutStm + << rtl::OString::valueOf(static_cast<sal_Int32>( + nSCount)).getStr() + << "/*Count*/"; } else rOutStm << '0'; @@ -1485,8 +1493,9 @@ void SvMetaSlot::WriteSrc( SvIdlDataBase & rBase, SvStream & rOutStm, if( !pTable->IsKeyValid( nSId ) ) { pTable->Insert( nSId, this ); - rOutStm << "SfxSlotInfo " << ByteString::CreateFromInt32( nSId ).GetBuffer() - << endl << '{' << endl; + rOutStm << "SfxSlotInfo " + << rtl::OString::valueOf(static_cast<sal_Int32>(nSId)).getStr() + << endl << '{' << endl; WriteTab( rOutStm, 1 ); ByteString aStr = GetConfigName(); @@ -1521,7 +1530,7 @@ void SvMetaSlot::WriteSrc( SvIdlDataBase & rBase, SvStream & rOutStm, sal_Bool bIdOk = sal_False; if( rBase.FindId( aSId, &nSId2 ) ) { - aSId = ByteString::CreateFromInt32( nSId2 ); + aSId = rtl::OString::valueOf(static_cast<sal_Int32>(nSId2)); bIdOk = sal_True; } @@ -1554,7 +1563,9 @@ void SvMetaSlot::WriteHelpId( SvIdlDataBase & rBase, SvStream & rOutStm, if( !pTable->IsKeyValid( nSId ) ) { pTable->Insert( nSId, this ); - rOutStm << "#define " << GetSlotId().GetBuffer() << '\t' << ByteString::CreateFromInt32( nSId ).GetBuffer() << endl; + rOutStm << "#define " << GetSlotId().GetBuffer() << '\t' + << rtl::OString::valueOf(static_cast<sal_Int32>(nSId)).getStr() + << endl; } SvMetaTypeEnum * pEnum = PTR_CAST( SvMetaTypeEnum, GetType() ); @@ -1573,7 +1584,7 @@ void SvMetaSlot::WriteHelpId( SvIdlDataBase & rBase, SvStream & rOutStm, sal_Bool bIdOk = sal_False; if( rBase.FindId( aSId, &nSId2 ) ) { - aSId = ByteString::CreateFromInt32( nSId2 ); + aSId = rtl::OString::valueOf(static_cast<sal_Int32>(nSId2)); bIdOk = sal_True; } @@ -1583,7 +1594,9 @@ void SvMetaSlot::WriteHelpId( SvIdlDataBase & rBase, SvStream & rOutStm, pTable->Insert( nSId2, this ); rOutStm << "#define " << aSId.GetBuffer() << '\t' - << ByteString::CreateFromInt32( nSId2 ).GetBuffer() << endl; + << rtl::OString::valueOf( + static_cast<sal_Int32>(nSId2)).getStr() + << endl; } } } @@ -1601,7 +1614,10 @@ void SvMetaSlot::WriteCSV( SvIdlDataBase& rBase, SvStream& rStrm ) { rStrm << "PROJECT,"; rStrm << GetSlotId().GetBuffer() << ','; - rStrm << ByteString::CreateFromInt32( GetSlotId().GetValue() ).GetBuffer() << ','; + rStrm + << rtl::OString::valueOf( + static_cast<sal_Int32>(GetSlotId().GetValue())).getStr() + << ','; if ( GetPseudoPrefix().Len() ) rStrm << GetPseudoPrefix().GetBuffer() << ','; diff --git a/idl/source/objects/types.cxx b/idl/source/objects/types.cxx index 7a006f2f8428..d57d3cb0e33f 100644 --- a/idl/source/objects/types.cxx +++ b/idl/source/objects/types.cxx @@ -425,8 +425,8 @@ void SvMetaAttribute::WriteAttributes( SvIdlDataBase & rBase, SvStream & rOutStm { WriteTab( rOutStm, nTab ); rOutStm << "id(" - << ByteString::CreateFromInt32(MakeSlotValue( rBase, bVar )).GetBuffer() - << ")," << endl; + << rtl::OString::valueOf(static_cast<sal_Int32>(MakeSlotValue(rBase,bVar))).getStr() + << ")," << endl; } if( bVar && (bReadonly || IsMethod()) ) { @@ -467,7 +467,7 @@ void SvMetaAttribute::WriteCSource( SvIdlDataBase & rBase, SvStream & rOutStm, } } rOutStm << "pODKCallFunction( " - << ByteString::CreateFromInt32(MakeSlotValue( rBase, IsVariable() )).GetBuffer(); + << rtl::OString::valueOf(static_cast<sal_Int32>(MakeSlotValue(rBase, IsVariable()))).getStr(); rOutStm << ',' << endl; WriteTab( rOutStm, 3 ); rOutStm << " h" << rBase.aIFaceName.GetBuffer() << " , "; @@ -1428,7 +1428,8 @@ void SvMetaType::WriteSfxItem( ByteString aTypeName = "SfxType"; ByteString aAttrArray; sal_uLong nAttrCount = MakeSfx( &aAttrArray ); - ByteString aAttrCount( ByteString::CreateFromInt32( nAttrCount ) ); + ByteString aAttrCount( + rtl::OString::valueOf(static_cast<sal_Int32>(nAttrCount))); aTypeName += aAttrCount; rOutStm << "extern " << aTypeName.GetBuffer() diff --git a/idl/source/prj/database.cxx b/idl/source/prj/database.cxx index 40831709fe65..fa37d2d003a3 100644 --- a/idl/source/prj/database.cxx +++ b/idl/source/prj/database.cxx @@ -36,6 +36,7 @@ #include <tools/debug.hxx> #include <database.hxx> #include <globals.hxx> +#include <rtl/strbuf.hxx> SvIdlDataBase::SvIdlDataBase( const SvCommand& rCmd ) : bExport( sal_False ) @@ -541,16 +542,16 @@ void SvIdlDataBase::Write( const ByteString & rText ) void SvIdlDataBase::WriteError( const ByteString & rErrWrn, const ByteString & rFileName, - const ByteString & rErrorText, + const rtl::OString& rErrorText, sal_uLong nRow, sal_uLong nColumn ) const { // error treatment fprintf( stderr, "\n%s --- %s: ( %ld, %ld )\n", rFileName.GetBuffer(), rErrWrn.GetBuffer(), nRow, nColumn ); - if( rErrorText.Len() ) + if( !rErrorText.isEmpty() ) { // error set - fprintf( stderr, "\t%s\n", rErrorText.GetBuffer() ); + fprintf( stderr, "\t%s\n", rErrorText.getStr() ); } } @@ -558,7 +559,7 @@ void SvIdlDataBase::WriteError( SvTokenStream & rInStm ) { // error treatment String aFileName( rInStm.GetFileName() ); - ByteString aErrorText; + rtl::OStringBuffer aErrorText; sal_uLong nRow = 0, nColumn = 0; rInStm.SeekEnd(); @@ -574,8 +575,8 @@ void SvIdlDataBase::WriteError( SvTokenStream & rInStm ) // error text if( aError.GetText().Len() ) { - aErrorText = "may be <"; - aErrorText += aError.GetText(); + aErrorText.append(RTL_CONSTASCII_STRINGPARAM("may be <")); + aErrorText.append(aError.GetText()); } SvToken * pPrevTok = NULL; while( pTok != pPrevTok ) @@ -588,17 +589,17 @@ void SvIdlDataBase::WriteError( SvTokenStream & rInStm ) } // error position - aErrorText += "> at ( "; - aErrorText += ByteString::CreateFromInt64(aError.nLine); - aErrorText += ", "; - aErrorText += ByteString::CreateFromInt64(aError.nColumn); - aErrorText += " )"; + aErrorText.append(RTL_CONSTASCII_STRINGPARAM("> at ( ")); + aErrorText.append(static_cast<sal_Int64>(aError.nLine)); + aErrorText.append(RTL_CONSTASCII_STRINGPARAM(", ")); + aErrorText.append(static_cast<sal_Int64>(aError.nColumn)); + aErrorText.append(RTL_CONSTASCII_STRINGPARAM(" )")); // reset error aError = SvIdlError(); } - WriteError( "error", ByteString( aFileName, RTL_TEXTENCODING_UTF8 ), aErrorText, nRow, nColumn ); + WriteError( "error", ByteString( aFileName, RTL_TEXTENCODING_UTF8 ), aErrorText.makeStringAndClear(), nRow, nColumn ); DBG_ASSERT( pTok, "token must be found" ); if( !pTok ) @@ -714,8 +715,8 @@ sal_Bool SvIdlWorkingBase::WriteSvIdl( SvStream & rOutStm ) SvStringHashEntry* pEntry = aList[ i ]; rOutStm << "#define " << pEntry->GetName().GetBuffer() << '\t' - << ByteString::CreateFromInt64( - pEntry->GetValue() ).GetBuffer() + << rtl::OString::valueOf(static_cast<sal_Int64>( + pEntry->GetValue())).getStr() << endl; } } |