summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-07-19 00:10:39 +0100
committerCaolán McNamara <caolanm@redhat.com>2011-07-19 09:32:02 +0100
commitb2ac2f2ad169ddc49a893a2c41937862a9101348 (patch)
tree9ab499844219c1f2c9935899e4ea2fdd9a3dd223
parent4a098895345e5cfb28ab8b55e88c1ba6286712ae (diff)
ByteString::CreateFromInt32->rtl::OStringBuffer::append
-rw-r--r--basic/source/app/app.cxx12
-rw-r--r--basic/source/app/brkpnts.cxx14
-rw-r--r--basic/source/app/dialogs.cxx30
3 files changed, 36 insertions, 20 deletions
diff --git a/basic/source/app/app.cxx b/basic/source/app/app.cxx
index 54b5794c71..a143b53e24 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 c4358a7848..98c39bc145 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 2f0913b7d8..d0221bb703 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())));