[Libreoffice-commits] .: idl/source

Caolán McNamara caolan at kemper.freedesktop.org
Fri Jul 1 01:09:53 PDT 2011


 idl/source/objects/basobj.cxx  |    7 +++--
 idl/source/objects/bastype.cxx |    6 +++-
 idl/source/objects/object.cxx  |   19 +++++++++++---
 idl/source/objects/slot.cxx    |   52 ++++++++++++++++++++++++++---------------
 idl/source/objects/types.cxx   |    9 +++----
 5 files changed, 62 insertions(+), 31 deletions(-)

New commits:
commit 7cfb85b9fbbb16acb4b0570f2155425801897f8e
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Jun 30 22:53:24 2011 +0100

    ByteString::CreateFromInt32 -> OString::valueOf

diff --git a/idl/source/objects/basobj.cxx b/idl/source/objects/basobj.cxx
index 320d44b..7a16f05 100644
--- a/idl/source/objects/basobj.cxx
+++ b/idl/source/objects/basobj.cxx
@@ -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 3ba2c8d..3b4bc8b 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 c7c4f00..160af1c 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 75553a4..e99d4b9 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 e8ad7d2..4ae69c6 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()


More information about the Libreoffice-commits mailing list