[Libreoffice-commits] .: basic/source idl/inc idl/source sfx2/source

Caolán McNamara caolan at kemper.freedesktop.org
Wed Jun 29 03:17:46 PDT 2011


 basic/source/app/dialogs.cxx     |   12 ++++--
 basic/source/sbx/sbxobj.cxx      |    6 +--
 basic/source/sbx/sbxvar.cxx      |    2 -
 idl/inc/database.hxx             |    2 -
 idl/source/objects/basobj.cxx    |    4 +-
 idl/source/prj/database.cxx      |   29 ++++++++--------
 sfx2/source/control/dispatch.cxx |   68 ++++++++++++++++++++++-----------------
 sfx2/source/control/statcach.cxx |    2 -
 8 files changed, 70 insertions(+), 55 deletions(-)

New commits:
commit 69f857ac5c6ef8196de6b2b689243ab397cb85e0
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Jun 29 08:59:06 2011 +0100

    remove deprecated ByteString::CreateFromInt64

diff --git a/basic/source/app/dialogs.cxx b/basic/source/app/dialogs.cxx
index 64bc78b..2f0913b 100644
--- a/basic/source/app/dialogs.cxx
+++ b/basic/source/app/dialogs.cxx
@@ -556,7 +556,8 @@ void CrashreportOptions::Save( Config &aConfig )
         aConfig.WriteKey( "UseProxy", "false" );
 
     aConfig.WriteKey( "ProxyServer", ByteString( aEDCRHost.GetText(), RTL_TEXTENCODING_UTF8 ) );
-    aConfig.WriteKey( "ProxyPort", ByteString::CreateFromInt64( aNFCRPort.GetValue() ) );
+    aConfig.WriteKey("ProxyPort",
+        rtl::OString::valueOf(static_cast<sal_Int64>(aNFCRPort.GetValue())));
 
     if ( aCBAllowContact.IsChecked() )
         aConfig.WriteKey( "AllowContact", "true" );
@@ -644,8 +645,10 @@ void MiscOptions::Save( Config &aConfig )
 {
     aConfig.SetGroup("Communication");
     aConfig.WriteKey( "Host", ByteString( aEDHost.GetText(), RTL_TEXTENCODING_UTF8 ) );
-    aConfig.WriteKey( "TTPort", ByteString::CreateFromInt64( aNFTTPort.GetValue() ) );
-    aConfig.WriteKey( "UnoPort", ByteString::CreateFromInt64( aNFUNOPort.GetValue() ) );
+    aConfig.WriteKey("TTPort",
+        rtl::OString::valueOf(static_cast<sal_Int64>(aNFTTPort.GetValue())));
+    aConfig.WriteKey("UnoPort",
+        rtl::OString::valueOf(static_cast<sal_Int64>(aNFUNOPort.GetValue())));
 
     aConfig.SetGroup("Misc");
     aConfig.WriteKey( "ServerTimeout", ByteString::CreateFromInt32( aServerTimeout.GetTime().GetTime() ) );
@@ -656,7 +659,8 @@ void MiscOptions::Save( Config &aConfig )
     sal_uInt16 n;
     for ( n = nOldMaxLRU ; n > aTFMaxLRU.GetValue() ; n-- )
         aConfig.DeleteKey( ByteString("LRU").Append( ByteString::CreateFromInt32( n ) ) );
-    aConfig.WriteKey( "MaxLRU", ByteString::CreateFromInt64( aTFMaxLRU.GetValue() ) );
+    aConfig.WriteKey("MaxLRU",
+        rtl::OString::valueOf(static_cast<sal_Int64>(aTFMaxLRU.GetValue())));
 
     aConfig.SetGroup("OOoProgramDir");
     aConfig.WriteKey( C_KEY_AKTUELL, ByteString( aEDProgDir.GetText(), RTL_TEXTENCODING_UTF8 ) );
diff --git a/basic/source/sbx/sbxobj.cxx b/basic/source/sbx/sbxobj.cxx
index 2ad0e4e..2c47af7 100644
--- a/basic/source/sbx/sbxobj.cxx
+++ b/basic/source/sbx/sbxobj.cxx
@@ -866,17 +866,17 @@ void SbxObject::Dump( SvStream& rStrm, sal_Bool bFill )
     ByteString aNameStr( (const UniString&)GetName(), RTL_TEXTENCODING_ASCII_US );
     ByteString aClassNameStr( (const UniString&)aClassName, RTL_TEXTENCODING_ASCII_US );
     rStrm << "Object( "
-          << ByteString::CreateFromInt64( (sal_uIntPtr) this ).GetBuffer() << "=='"
+          << rtl::OString::valueOf(reinterpret_cast<sal_Int64>(this)).getStr()<< "=='"
           << ( aNameStr.Len() ? aNameStr.GetBuffer() : "<unnamed>" ) << "', "
           << "of class '" << aClassNameStr.GetBuffer() << "', "
           << "counts "
-          << ByteString::CreateFromInt64( GetRefCount() ).GetBuffer()
+          << rtl::OString::valueOf(static_cast<sal_Int64>(GetRefCount())).getStr()
           << " refs, ";
     if ( GetParent() )
     {
         ByteString aParentNameStr( (const UniString&)GetName(), RTL_TEXTENCODING_ASCII_US );
         rStrm << "in parent "
-              << ByteString::CreateFromInt64( (sal_uIntPtr) GetParent() ).GetBuffer()
+              << rtl::OString::valueOf(reinterpret_cast<sal_Int64>(GetParent())).getStr()
               << "=='" << ( aParentNameStr.Len() ? aParentNameStr.GetBuffer() : "<unnamed>" ) << "'";
     }
     else
diff --git a/basic/source/sbx/sbxvar.cxx b/basic/source/sbx/sbxvar.cxx
index b91eb87..2867639 100644
--- a/basic/source/sbx/sbxvar.cxx
+++ b/basic/source/sbx/sbxvar.cxx
@@ -641,7 +641,7 @@ void SbxVariable::Dump( SvStream& rStrm, sal_Bool bFill )
 {
     ByteString aBNameStr( (const UniString&)GetName( SbxNAME_SHORT_TYPES ), RTL_TEXTENCODING_ASCII_US );
     rStrm << "Variable( "
-          << ByteString::CreateFromInt64( (sal_uIntPtr) this ).GetBuffer() << "=="
+          << rtl::OString::valueOf(reinterpret_cast<sal_Int64>(this)).getStr() << "=="
           << aBNameStr.GetBuffer();
     ByteString aBParentNameStr( (const UniString&)GetParent()->GetName(), RTL_TEXTENCODING_ASCII_US );
     if ( GetParent() )
diff --git a/idl/inc/database.hxx b/idl/inc/database.hxx
index dd6dcf6..5a2a34e 100644
--- a/idl/inc/database.hxx
+++ b/idl/inc/database.hxx
@@ -126,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/objects/basobj.cxx b/idl/source/objects/basobj.cxx
index e6ca91f..320d44b 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;
     }
 }
diff --git a/idl/source/prj/database.cxx b/idl/source/prj/database.cxx
index 1e5aaeb..b7cdc1a 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;
         }
     }
diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx
index a98678a..431fad8 100644
--- a/sfx2/source/control/dispatch.cxx
+++ b/sfx2/source/control/dispatch.cxx
@@ -74,6 +74,7 @@
 #include <sfx2/docfile.hxx>
 #include <sfx2/mnumgr.hxx>
 #include "workwin.hxx"
+#include <rtl/strbuf.hxx>
 
 namespace css = ::com::sun::star;
 
@@ -407,9 +408,9 @@ SfxDispatcher::~SfxDispatcher()
 
 {
 #ifdef DBG_UTIL
-    ByteString sTemp( "Delete Dispatcher " );
-    sTemp += ByteString::CreateFromInt64( (sal_uIntPtr)this );
-    OSL_TRACE( "%s", sTemp.GetBuffer() );
+    rtl::OStringBuffer sTemp(RTL_CONSTASCII_STRINGPARAM("Delete Dispatcher "));
+    sTemp.append(reinterpret_cast<sal_Int64>(this));
+    OSL_TRACE("%s", sTemp.getStr());
     DBG_ASSERT( !pImp->bActive, "deleting active Dispatcher" );
 #endif
 
@@ -478,16 +479,23 @@ void SfxDispatcher::Pop
     SfxApplication *pSfxApp = SFX_APP();
 
 #ifdef DBG_UTIL
-    ByteString aMsg( "-SfxDispatcher(" );
-    aMsg += ByteString::CreateFromInt64( (sal_uIntPtr) this );
-    aMsg += bPush ? ")::Push(" : ")::Pop(";
-    if ( rShell.GetInterface() )
-        aMsg += rShell.GetInterface()->GetClassName();
+    rtl::OStringBuffer aMsg(RTL_CONSTASCII_STRINGPARAM("-SfxDispatcher("));
+    aMsg.append(reinterpret_cast<sal_Int64>(this));
+    if (bPush)
+        aMsg.append(RTL_CONSTASCII_STRINGPARAM(")::Push("));
     else
-        aMsg += ByteString::CreateFromInt64( (sal_uIntPtr) &rShell );
-    aMsg += bDelete ? ") with delete" : ")";
-    if ( bUntil ) aMsg += " (up to)";
-    DbgTrace( aMsg.GetBuffer() );
+        aMsg.append(RTL_CONSTASCII_STRINGPARAM(")::Pop("));
+    if (rShell.GetInterface())
+        aMsg.append(rShell.GetInterface()->GetClassName());
+    else
+        aMsg.append(reinterpret_cast<sal_Int64>(&rShell));
+    if (bDelete)
+        aMsg.append(RTL_CONSTASCII_STRINGPARAM(") with delete"));
+    else
+        aMsg.append(')');
+    if (bUntil)
+        aMsg.append(RTL_CONSTASCII_STRINGPARAM(" (up to)"));
+    DbgTrace(aMsg.getStr());
 #endif
 
     // same shell as on top of the to-do stack?
@@ -742,12 +750,13 @@ void SfxDispatcher::DoActivate_Impl( sal_Bool bMDI, SfxViewFrame* /* pOld */ )
     SFX_STACK(SfxDispatcher::DoActivate);
     if ( bMDI )
     {
-        #ifdef DBG_UTIL
-        ByteString sTemp("Activate Dispatcher ");
-        sTemp += ByteString::CreateFromInt64( (sal_uIntPtr) this );
-        OSL_TRACE( "%s", sTemp.GetBuffer());
+#ifdef DBG_UTIL
+        rtl::OStringBuffer sTemp(
+            RTL_CONSTASCII_STRINGPARAM("Activate Dispatcher "));
+        sTemp.append(reinterpret_cast<sal_Int64>(this));
+        OSL_TRACE("%s", sTemp.getStr());
         DBG_ASSERT( !pImp->bActive, "Activation error" );
-        #endif
+#endif
         pImp->bActive = sal_True;
         pImp->bUpdated = sal_False;
         SfxBindings* pBindings = GetBindings();
@@ -759,11 +768,12 @@ void SfxDispatcher::DoActivate_Impl( sal_Bool bMDI, SfxViewFrame* /* pOld */ )
     }
     else
     {
-        #ifdef DBG_UTIL
-        ByteString sTemp("Non-MDI-Activate Dispatcher");
-        sTemp += ByteString::CreateFromInt64( (sal_uIntPtr) this );
-        OSL_TRACE( "%s", sTemp.GetBuffer() );
-        #endif
+#ifdef DBG_UTIL
+        rtl::OStringBuffer sTemp(
+            RTL_CONSTASCII_STRINGPARAM("Non-MDI-Activate Dispatcher"));
+        sTemp.append(reinterpret_cast<sal_Int64>(this));
+        OSL_TRACE("%s", sTemp.getStr());
+#endif
     }
 
     if ( IsAppDispatcher() )
@@ -833,7 +843,7 @@ void SfxDispatcher::DoDeactivate_Impl( sal_Bool bMDI, SfxViewFrame* pNew )
 
     if ( bMDI )
     {
-        OSL_TRACE(ByteString("Deactivate Dispatcher ").Append(ByteString::CreateFromInt64( (sal_uIntPtr) this )).GetBuffer());
+        OSL_TRACE(rtl::OStringBuffer(RTL_CONSTASCII_STRINGPARAM("Deactivate Dispatcher")).append(reinterpret_cast<sal_Int64>(this)).getStr());
         DBG_ASSERT( pImp->bActive, "Deactivate error" );
         pImp->bActive = sal_False;
 
@@ -854,7 +864,7 @@ void SfxDispatcher::DoDeactivate_Impl( sal_Bool bMDI, SfxViewFrame* pNew )
         }
     }
     else {
-        OSL_TRACE( ByteString ("Non-MDI-DeActivate Dispatcher").Append(ByteString::CreateFromInt64( (sal_uIntPtr) this )).GetBuffer() );
+        OSL_TRACE(rtl::OStringBuffer(RTL_CONSTASCII_STRINGPARAM("Non-MDI-DeActivate Dispatcher")).append(reinterpret_cast<sal_Int64>(this)).getStr());
     }
 
     if ( IsAppDispatcher() && !pSfxApp->IsDowning() )
@@ -1844,9 +1854,9 @@ void SfxDispatcher::FlushImpl()
     OSL_TRACE("Flushing dispatcher!");
 
 #ifdef DBG_UTIL
-    ByteString aMsg( "SfxDispatcher(" );
-    aMsg += ByteString::CreateFromInt64( (sal_uIntPtr) this );
-    aMsg += ")::Flush()";
+    rtl::OStringBuffer aMsg(RTL_CONSTASCII_STRINGPARAM("SfxDispatcher("));
+    aMsg.append(reinterpret_cast<sal_Int64>(this));
+    aMsg.append(RTL_CONSTASCII_STRINGPARAM(")::Flush()"));
 #endif
 
     pImp->aTimer.Stop();
@@ -1960,8 +1970,8 @@ void SfxDispatcher::FlushImpl()
         pImp->aFixedObjBars[n].nResId = 0;
 
 #ifdef DBG_UTIL
-    aMsg += " done";
-    DbgTrace( aMsg.GetBuffer() );
+    aMsg.append(RTL_CONSTASCII_STRINGPARAM("done"));
+    DbgTrace(aMsg.getStr());
 #endif
 }
 
diff --git a/sfx2/source/control/statcach.cxx b/sfx2/source/control/statcach.cxx
index 7cd76e0..a5c1644 100644
--- a/sfx2/source/control/statcach.cxx
+++ b/sfx2/source/control/statcach.cxx
@@ -527,7 +527,7 @@ void SfxStateCache::DeleteFloatingWindows()
     SfxControllerItem *pNextCtrl=0;
     for ( SfxControllerItem *pCtrl=pController; pCtrl; pCtrl=pNextCtrl )
     {
-        OSL_TRACE((ByteString("pCtrl: ").Append(ByteString::CreateFromInt64((sal_uIntPtr)pCtrl))).GetBuffer());
+        OSL_TRACE(rtl::OStringBuffer(RTL_CONSTASCII_STRINGPARAM("pCtrl: ")).append(reinterpret_cast<sal_Int64>(pCtrl)).getStr());
         pNextCtrl = pCtrl->GetItemLink();
         pCtrl->DeleteFloatingWindow();
     }


More information about the Libreoffice-commits mailing list