[Libreoffice-commits] .: basic/source

Caolán McNamara caolan at kemper.freedesktop.org
Tue Jul 19 01:34:52 PDT 2011


 basic/source/app/app.cxx     |   12 +++++++++---
 basic/source/app/brkpnts.cxx |   14 ++++++++------
 basic/source/app/dialogs.cxx |   30 +++++++++++++++++++-----------
 3 files changed, 36 insertions(+), 20 deletions(-)

New commits:
commit b2ac2f2ad169ddc49a893a2c41937862a9101348
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Jul 19 00:10:39 2011 +0100

    ByteString::CreateFromInt32->rtl::OStringBuffer::append

diff --git a/basic/source/app/app.cxx b/basic/source/app/app.cxx
index 54b5794..a143b53 100644
--- a/basic/source/app/app.cxx
+++ b/basic/source/app/app.cxx
@@ -70,6 +70,8 @@
 #include <ucbhelper/content.hxx>
 #include <unotools/syslocale.hxx>
 
+#include <rtl/strbuf.hxx>
+
 using namespace comphelper;
 using namespace cppu;
 using namespace com::sun::star;
@@ -278,8 +280,9 @@ int BasicApp::Main( )
         // 1033 = LANGUAGE_ENGLISH_US
         // 1031 = LANGUAGE_GERMAN
         aConf.SetGroup("Misc");
-        ByteString aLang = aConf.ReadKey( "Language", ByteString::CreateFromInt32( LANGUAGE_SYSTEM ) );
-        aRequestedLanguage = LanguageType( aLang.ToInt32() );
+        rtl::OString aLang = aConf.ReadKey( "Language",
+            rtl::OString::valueOf(static_cast<sal_Int32>(LANGUAGE_SYSTEM)) );
+        aRequestedLanguage = LanguageType(aLang.toInt32());
 
         AllSettings aSettings = GetSettings();
         aSettings.SetUILanguage( aRequestedLanguage );
@@ -1029,7 +1032,10 @@ sal_Bool BasicFrame::CompileAll()
 
 // Setup menu
 #define MENU2FILENAME( Name ) Name.Copy( Name.SearchAscii(" ") +1).EraseAllChars( '~' )
-#define LRUNr( nNr ) CByteString("LRU").Append( ByteString::CreateFromInt32( nNr ) )
+#define LRUNr( nNr ) \
+    rtl::OStringBuffer(RTL_CONSTASCII_STRINGPARAM("LRU")) \
+        .append(static_cast<sal_Int32>(nNr)) \
+        .makeStringAndClear()
 String FILENAME2MENU( sal_uInt16 nNr, String aName )
 {
     String aRet;
diff --git a/basic/source/app/brkpnts.cxx b/basic/source/app/brkpnts.cxx
index c4358a7..98c39bc 100644
--- a/basic/source/app/brkpnts.cxx
+++ b/basic/source/app/brkpnts.cxx
@@ -39,6 +39,8 @@
 
 #include <basic/ttstrhlp.hxx>
 
+#include <rtl/strbuf.hxx>
+
 #include "brkpnts.hxx"
 #include "basic.hrc"
 #include "resids.hrc"
@@ -232,22 +234,22 @@ void BreakpointWindow::LoadBreakpoints( String aFilename )
 
 void BreakpointWindow::SaveBreakpoints( String aFilename )
 {
-    ByteString aBreakpoints;
+    rtl::OStringBuffer aBreakpoints;
 
     for ( size_t i = 0, n = BreakpointList.size(); i < n; ++i )
     {
         Breakpoint* pBrk = BreakpointList[ i ];
-        if ( aBreakpoints.Len() )
-            aBreakpoints += ';';
-        aBreakpoints += ByteString::CreateFromInt32( pBrk->nLine );
+        if (aBreakpoints.getLength())
+            aBreakpoints.append(';');
+        aBreakpoints.append(static_cast<sal_Int32>(pBrk->nLine));
     }
 
     Config aConfig(Config::GetConfigName( Config::GetDefDirectory(), CUniString("testtool") ));
 
     aConfig.SetGroup("Breakpoints");
 
-    if ( aBreakpoints.Len() )
-        aConfig.WriteKey( ByteString( aFilename, RTL_TEXTENCODING_UTF8 ), aBreakpoints );
+    if (aBreakpoints.getLength())
+        aConfig.WriteKey( ByteString( aFilename, RTL_TEXTENCODING_UTF8 ), aBreakpoints.makeStringAndClear() );
     else
         aConfig.DeleteKey( ByteString( aFilename, RTL_TEXTENCODING_UTF8 ) );
 }
diff --git a/basic/source/app/dialogs.cxx b/basic/source/app/dialogs.cxx
index 2f0913b..d0221bb 100644
--- a/basic/source/app/dialogs.cxx
+++ b/basic/source/app/dialogs.cxx
@@ -55,6 +55,7 @@
 
 #include <basic/dispdefs.hxx>
 #include <basic/testtool.hxx>
+#include <rtl/strbuf.hxx>
 #include "dialogs.hxx"
 #include "resids.hrc"
 #include "basic.hrc"
@@ -607,27 +608,29 @@ MiscOptions::MiscOptions( Window* pParent, Config &aConfig )
     aNFUNOPort.SetUseThousandSep( sal_False );
     aTFMaxLRU.SetUseThousandSep( sal_False );
 
-    ByteString aTemp;
+    rtl::OString aTemp;
 
     aConfig.SetGroup("Communication");
     aTemp = aConfig.ReadKey( "Host", DEFAULT_HOST );
-    aEDHost.SetText( String( aTemp, RTL_TEXTENCODING_UTF8 ) );
-    aTemp = aConfig.ReadKey( "TTPort", ByteString::CreateFromInt32( TESTTOOL_DEFAULT_PORT ) );
-    aNFTTPort.SetValue( aTemp.ToInt32() );
-    aTemp = aConfig.ReadKey( "UnoPort", ByteString::CreateFromInt32( UNO_DEFAULT_PORT ) );
-    aNFUNOPort.SetValue( aTemp.ToInt32() );
+    aEDHost.SetText(rtl::OStringToOUString(aTemp, RTL_TEXTENCODING_UTF8));
+    aTemp = aConfig.ReadKey("TTPort",
+        rtl::OString::valueOf(static_cast<sal_Int32>(TESTTOOL_DEFAULT_PORT)));
+    aNFTTPort.SetValue(aTemp.toInt32());
+    aTemp = aConfig.ReadKey("UnoPort",
+        rtl::OString::valueOf(static_cast<sal_Int32>(UNO_DEFAULT_PORT)));
+    aNFUNOPort.SetValue(aTemp.toInt32());
 
     aConfig.SetGroup("Misc");
     aTemp = aConfig.ReadKey( "ServerTimeout", "10000" );	// Default 1 Minute
-    aServerTimeout.SetTime( Time(aTemp.ToInt32()) );
+    aServerTimeout.SetTime(Time(aTemp.toInt32()));
 
     aConfig.SetGroup("LRU");
     aTemp = aConfig.ReadKey( "MaxLRU", "4" );
-    aTFMaxLRU.SetValue( aTemp.ToInt32() );
+    aTFMaxLRU.SetValue(aTemp.toInt32());
 
     aConfig.SetGroup("OOoProgramDir");
     aTemp = aConfig.ReadKey( "Current" );
-    aEDProgDir.SetText( String( aTemp, RTL_TEXTENCODING_UTF8 ) );
+    aEDProgDir.SetText(rtl::OStringToOUString(aTemp, RTL_TEXTENCODING_UTF8));
     aPBProgDir.SetClickHdl( LINK( this, MiscOptions, Click ) );
 }
 
@@ -651,14 +654,19 @@ void MiscOptions::Save( Config &aConfig )
         rtl::OString::valueOf(static_cast<sal_Int64>(aNFUNOPort.GetValue())));
 
     aConfig.SetGroup("Misc");
-    aConfig.WriteKey( "ServerTimeout", ByteString::CreateFromInt32( aServerTimeout.GetTime().GetTime() ) );
+    aConfig.WriteKey("ServerTimeout",
+        rtl::OString::valueOf(static_cast<sal_Int32>(aServerTimeout.GetTime().GetTime())));
 
     aConfig.SetGroup("LRU");
     ByteString aTemp = aConfig.ReadKey( "MaxLRU", "4" );
     sal_uInt16 nOldMaxLRU = (sal_uInt16)aTemp.ToInt32();
     sal_uInt16 n;
     for ( n = nOldMaxLRU ; n > aTFMaxLRU.GetValue() ; n-- )
-        aConfig.DeleteKey( ByteString("LRU").Append( ByteString::CreateFromInt32( n ) ) );
+    {
+        aConfig.DeleteKey(rtl::OStringBuffer(RTL_CONSTASCII_STRINGPARAM("LRU"))
+            .append(static_cast<sal_Int32>(n))
+            .makeStringAndClear());
+    }
     aConfig.WriteKey("MaxLRU",
         rtl::OString::valueOf(static_cast<sal_Int64>(aTFMaxLRU.GetValue())));
 


More information about the Libreoffice-commits mailing list