diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-07-19 00:10:39 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-07-19 09:32:02 +0100 |
commit | 6b28a5d89dde8d432c63bd28259017fb8987b067 (patch) | |
tree | 91082da775080fa7038ea703a4df240ab520a181 /basic | |
parent | 78bf0a60fa2248106f419f0bdec534489edb97a8 (diff) |
ByteString::CreateFromInt32->rtl::OStringBuffer::append
Diffstat (limited to 'basic')
-rw-r--r-- | basic/source/app/app.cxx | 12 | ||||
-rw-r--r-- | basic/source/app/brkpnts.cxx | 14 | ||||
-rw-r--r-- | basic/source/app/dialogs.cxx | 30 |
3 files changed, 36 insertions, 20 deletions
diff --git a/basic/source/app/app.cxx b/basic/source/app/app.cxx index 96744a876ac0..f1bdd3f0e69e 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 134c5194b7aa..57406feec54d 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 c9a3d72e8c33..e729bf79f4f0 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()))); |