summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-08-18 22:30:22 +0100
committerCaolán McNamara <caolanm@redhat.com>2011-08-19 09:30:44 +0100
commitd1fb13adf9ab73e53851e5d56cbbbe33bcdcd82c (patch)
tree43c8a344a67113e3b1a26138f6653304809f62c7
parent2add3f0e5a6b6e5b818a9e41b19436c496aa4c66 (diff)
convert tools::Config to rtl::OString
-rw-r--r--automation/source/server/server.cxx6
-rw-r--r--automation/source/testtool/objtest.cxx14
-rw-r--r--basic/source/app/app.cxx16
-rw-r--r--basic/source/app/appedit.cxx6
-rw-r--r--basic/source/app/apperror.cxx8
-rw-r--r--basic/source/app/dialogs.cxx8
-rw-r--r--connectivity/source/drivers/dbase/DIndex.cxx2
-rw-r--r--dbaccess/source/ui/dlg/dbfindex.cxx2
-rw-r--r--padmin/source/fontentry.cxx2
-rw-r--r--padmin/source/newppdlg.cxx4
-rw-r--r--sw/source/ui/vba/vbasystem.cxx2
-rw-r--r--tools/inc/tools/config.hxx12
-rw-r--r--tools/source/generic/config.cxx76
13 files changed, 77 insertions, 81 deletions
diff --git a/automation/source/server/server.cxx b/automation/source/server/server.cxx
index ccf0e7ffb840..44c2c0de423e 100644
--- a/automation/source/server/server.cxx
+++ b/automation/source/server/server.cxx
@@ -216,17 +216,17 @@ sal_uLong RemoteControlCommunicationManager::GetPort()
aConf.WriteKey( aNoTesttoolKey, "something" );
}
- nPortIs = aConf.ReadKey("TTPort","0").ToInt32();
+ nPortIs = aConf.ReadKey("TTPort","0").toInt32();
// noch pr�fen ob dieses Office getestet werden soll.
if ( !bAutomate || aConf.ReadKey( aNoTesttoolKey, "" ) != "" )
nPortIs = 0;
- nComm = (sal_uInt16)aConf.ReadKey("Comm","0").ToInt32();
+ nComm = (sal_uInt16)aConf.ReadKey("Comm","0").toInt32();
if ( nComm )
aConf.DeleteKey("Comm");
- bQuiet = ( aConf.ReadKey("Quiet","no").CompareIgnoreCaseToAscii("yes") == COMPARE_EQUAL );
+ bQuiet = aConf.ReadKey("Quiet","no").equalsIgnoreAsciiCase("yes");
}
return nPortIs;
}
diff --git a/automation/source/testtool/objtest.cxx b/automation/source/testtool/objtest.cxx
index 78a2928bd8ff..1f2be28613c3 100644
--- a/automation/source/testtool/objtest.cxx
+++ b/automation/source/testtool/objtest.cxx
@@ -362,11 +362,11 @@ void TestToolObj::LoadIniFile() // Laden der IniEinstellungen, die d
aVar = UniString( __##aVar##__, RTL_TEXTENCODING_UTF8 );\
}
-#define NEWOLD( NewKey, OldKey ) \
- { \
- ByteString aValue; \
- if ( ( (aValue = aConf.ReadKey( OldKey )).Len() ) && !aConf.ReadKey( NewKey ).Len() ) \
- aConf.WriteKey( NewKey, aValue ); \
+#define NEWOLD( NewKey, OldKey ) \
+ { \
+ rtl::OString aValue; \
+ if ( ( (aValue = aConf.ReadKey( OldKey )).getLength() ) && !aConf.ReadKey( NewKey ).getLength() ) \
+ aConf.WriteKey( NewKey, aValue ); \
}
@@ -381,8 +381,8 @@ void TestToolObj::LoadIniFile() // Laden der IniEinstellungen, die d
pImpl->aFileBase = DirEntry(aFB);
// remove old keys
- if ( aConf.ReadKey("KeyCodes + Classes").Len() != 0 ||
- aConf.ReadKey("KeyCodes + Classes + Res_Type").Len() != 0 )
+ if ( aConf.ReadKey("KeyCodes + Classes").getLength() != 0 ||
+ aConf.ReadKey("KeyCodes + Classes + Res_Type").getLength() != 0 )
{
aConf.DeleteKey("KeyCodes + Classes + Res_Type");
aConf.DeleteKey("KeyCodes + Classes");
diff --git a/basic/source/app/app.cxx b/basic/source/app/app.cxx
index 6509ad8a54ff..392d2465f662 100644
--- a/basic/source/app/app.cxx
+++ b/basic/source/app/app.cxx
@@ -604,8 +604,8 @@ void BasicFrame::LoadIniFile()
for ( i = 0 ; i < aConf.GetGroupCount() ; i++ )
{
aConf.SetGroup( ByteString( aConf.GetGroupName( i ) ) );
- if ( ( aConf.ReadKey( "Aktuell" ).Len() || aConf.ReadKey( "Alle" ).Len() )
- &&( !aConf.ReadKey( "Current" ).Len() && !aConf.ReadKey( "All" ).Len() ) )
+ if ( ( aConf.ReadKey( "Aktuell" ).getLength() || aConf.ReadKey( "Alle" ).getLength() )
+ &&( !aConf.ReadKey( "Current" ).getLength() && !aConf.ReadKey( "All" ).getLength() ) )
{
aConf.WriteKey( "Current", aConf.ReadKey( "Aktuell" ) );
aConf.WriteKey( "All", aConf.ReadKey( "Alle" ) );
@@ -1061,13 +1061,13 @@ void BasicFrame::AddToLRU(String const& aFile)
PopupMenu *pPopup = GetMenuBar()->GetPopupMenu(RID_APPFILE);
aConfig.SetGroup("LRU");
- sal_uInt16 nMaxLRU = (sal_uInt16)aConfig.ReadKey("MaxLRU","4").ToInt32();
+ sal_uInt16 nMaxLRU = (sal_uInt16)aConfig.ReadKey("MaxLRU","4").toInt32();
DirEntry aFileEntry( aFile );
sal_uInt16 i,nLastMove = nMaxLRU;
for ( i = 1 ; i<nMaxLRU && nLastMove == nMaxLRU ; i++ )
{
- if ( DirEntry( UniString( aConfig.ReadKey(LRUNr(i),""), RTL_TEXTENCODING_UTF8 ) ) == aFileEntry )
+ if ( DirEntry( rtl::OStringToOUString(aConfig.ReadKey(LRUNr(i),""), RTL_TEXTENCODING_UTF8) ) == aFileEntry )
nLastMove = i;
}
@@ -1075,7 +1075,7 @@ void BasicFrame::AddToLRU(String const& aFile)
pPopup->InsertSeparator();
for ( i = nLastMove ; i>1 ; i-- )
{
- if ( aConfig.ReadKey(LRUNr(i-1),"").Len() )
+ if ( aConfig.ReadKey(LRUNr(i-1),"").getLength() )
{
aConfig.WriteKey(LRUNr(i), aConfig.ReadKey(LRUNr(i-1),""));
if ( pPopup->GetItemPos( IDM_FILE_LRU1 + i-1 ) == MENU_ITEM_NOTFOUND )
@@ -1098,7 +1098,7 @@ void BasicFrame::LoadLRU()
sal_Bool bAddSep = sal_True;
aConfig.SetGroup("LRU");
- sal_uInt16 nMaxLRU = (sal_uInt16)aConfig.ReadKey("MaxLRU","4").ToInt32();
+ sal_uInt16 nMaxLRU = (sal_uInt16)aConfig.ReadKey("MaxLRU","4").toInt32();
if ( pPopup )
bAddSep = pPopup->GetItemPos( IDM_FILE_LRU1 ) == MENU_ITEM_NOTFOUND;
@@ -1106,7 +1106,7 @@ void BasicFrame::LoadLRU()
sal_uInt16 i;
for ( i = 1; i <= nMaxLRU && pPopup != NULL; i++)
{
- String aFile = UniString( aConfig.ReadKey(LRUNr(i)), RTL_TEXTENCODING_UTF8 );
+ String aFile = rtl::OStringToOUString(aConfig.ReadKey(LRUNr(i)), RTL_TEXTENCODING_UTF8);
if (aFile.Len() != 0)
{
@@ -1698,7 +1698,7 @@ void NewFileDialog::FilterSelect()
aConf.SetGroup( "Misc" );
ByteString aCurrentProfile = aConf.ReadKey( "CurrentProfile", "Path" );
aConf.SetGroup( aCurrentProfile );
- aLastPath = UniString( aConf.ReadKey( aFilterType, aConf.ReadKey( "BaseDir" ) ), RTL_TEXTENCODING_UTF8 );
+ aLastPath = rtl::OStringToOUString(aConf.ReadKey(aFilterType, aConf.ReadKey( "BaseDir")), RTL_TEXTENCODING_UTF8);
SetPath( aLastPath );
}
diff --git a/basic/source/app/appedit.cxx b/basic/source/app/appedit.cxx
index 1cf75d13c58a..1fffbc283f13 100644
--- a/basic/source/app/appedit.cxx
+++ b/basic/source/app/appedit.cxx
@@ -85,9 +85,9 @@ void AppEdit::LoadIniFile()
FontList aFontList( pFrame ); // Just some Window is needed
Config aConf(Config::GetConfigName( Config::GetDefDirectory(), CUniString("testtool") ));
aConf.SetGroup("Misc");
- String aFontName = String( aConf.ReadKey( "ScriptFontName", "Courier" ), RTL_TEXTENCODING_UTF8 );
- String aFontStyle = String( aConf.ReadKey( "ScriptFontStyle", "normal" ), RTL_TEXTENCODING_UTF8 );
- String aFontSize = String( aConf.ReadKey( "ScriptFontSize", "12" ), RTL_TEXTENCODING_UTF8 );
+ String aFontName = rtl::OStringToOUString(aConf.ReadKey( "ScriptFontName", "Courier" ), RTL_TEXTENCODING_UTF8);
+ String aFontStyle = rtl::OStringToOUString(aConf.ReadKey( "ScriptFontStyle", "normal" ), RTL_TEXTENCODING_UTF8);
+ String aFontSize = rtl::OStringToOUString(aConf.ReadKey( "ScriptFontSize", "12" ), RTL_TEXTENCODING_UTF8);
Font aFont = aFontList.Get( aFontName, aFontStyle );
sal_uIntPtr nFontSize = aFontSize.ToInt32();
aFont.SetHeight( nFontSize );
diff --git a/basic/source/app/apperror.cxx b/basic/source/app/apperror.cxx
index 04b9e8e34f0f..f6e3fc54a07a 100644
--- a/basic/source/app/apperror.cxx
+++ b/basic/source/app/apperror.cxx
@@ -88,16 +88,16 @@ void AppError::LoadIniFile()
{
Config aConf(Config::GetConfigName( Config::GetDefDirectory(), CUniString("testtool") ));
aConf.SetGroup("Misc");
- ByteString aCurrentProfile = aConf.ReadKey( "CurrentProfile", "Path" );
+ rtl::OString aCurrentProfile = aConf.ReadKey( "CurrentProfile", "Path" );
aConf.SetGroup( aCurrentProfile );
aBaseDir = DirEntry( aConf.ReadKey("BaseDir") );
FontList aFontList( pFrame ); // Just some Window is needed
aConf.SetGroup("Misc");
- String aFontName = String( aConf.ReadKey( "ScriptFontName", "Courier" ), RTL_TEXTENCODING_UTF8 );
- String aFontStyle = String( aConf.ReadKey( "ScriptFontStyle", "normal" ), RTL_TEXTENCODING_UTF8 );
- String aFontSize = String( aConf.ReadKey( "ScriptFontSize", "12" ), RTL_TEXTENCODING_UTF8 );
+ String aFontName = rtl::OStringToOUString(aConf.ReadKey( "ScriptFontName", "Courier" ), RTL_TEXTENCODING_UTF8);
+ String aFontStyle = rtl::OStringToOUString(aConf.ReadKey( "ScriptFontStyle", "normal" ), RTL_TEXTENCODING_UTF8);
+ String aFontSize = rtl::OStringToOUString(aConf.ReadKey( "ScriptFontSize", "12" ), RTL_TEXTENCODING_UTF8);
Font aFont = aFontList.Get( aFontName, aFontStyle );
sal_uIntPtr nFontSize = aFontSize.ToInt32();
aFont.SetHeight( nFontSize );
diff --git a/basic/source/app/dialogs.cxx b/basic/source/app/dialogs.cxx
index 2f692ab20f6e..77e1e091d5d3 100644
--- a/basic/source/app/dialogs.cxx
+++ b/basic/source/app/dialogs.cxx
@@ -146,7 +146,7 @@ void ConfEdit::Init( Config &aConf )
ByteString aCurrentProfile = aConf.ReadKey( "CurrentProfile", "Path" );
aConf.SetGroup( aCurrentProfile );
- String aTemp = UniString( aConf.ReadKey( aKeyName ), RTL_TEXTENCODING_UTF8 );
+ String aTemp = rtl::OStringToOUString(aConf.ReadKey(aKeyName), RTL_TEXTENCODING_UTF8);
aEdit.SetText( aTemp );
}
@@ -182,7 +182,7 @@ void ConfEdit::Reload( Config &aConf )
aConf.SetGroup("Misc");
ByteString aCurrentProfile = aConf.ReadKey( "CurrentProfile", "Path" );
aConf.SetGroup( aCurrentProfile );
- String aValue = String( aConf.ReadKey( aKeyName ), RTL_TEXTENCODING_UTF8 );
+ String aValue = rtl::OStringToOUString(aConf.ReadKey(aKeyName), RTL_TEXTENCODING_UTF8);
aEdit.SetText( aValue );
}
@@ -817,7 +817,7 @@ void GenericOptions::LoadData()
{
String* pGroup = pGroups->at( i );
aConf.SetGroup( ByteString( *pGroup, RTL_TEXTENCODING_UTF8 ) );
- if ( aConf.ReadKey( C_KEY_AKTUELL ).Len() > 0 )
+ if ( aConf.ReadKey( C_KEY_AKTUELL ).getLength() > 0 )
aCbArea.InsertEntry( *pGroup );
delete pGroup;
}
@@ -882,7 +882,7 @@ IMPL_LINK( GenericOptions, MoveButtons, AutoTimer*, aTimer )
String GenericOptions::ReadKey( const ByteString &aGroup, const ByteString &aKey )
{
aConf.SetGroup( aGroup );
- return UniString( aConf.ReadKey( aKey ), RTL_TEXTENCODING_UTF8 );
+ return rtl::OStringToOUString(aConf.ReadKey(aKey), RTL_TEXTENCODING_UTF8);
}
IMPL_LINK( GenericOptions, LoadGroup, ComboBox*, EMPTYARG )
diff --git a/connectivity/source/drivers/dbase/DIndex.cxx b/connectivity/source/drivers/dbase/DIndex.cxx
index 64146fb9a393..0e6efd778a0b 100644
--- a/connectivity/source/drivers/dbase/DIndex.cxx
+++ b/connectivity/source/drivers/dbase/DIndex.cxx
@@ -456,7 +456,7 @@ sal_Bool ODbaseIndex::DropImpl()
aKeyName = aInfFile.GetKeyName( nKey );
if (aKeyName.Copy(0,3) == "NDX")
{
- if(sEntry == String(aInfFile.ReadKey(aKeyName),m_pTable->getConnection()->getTextEncoding()))
+ if(sEntry == String(rtl::OStringToOUString(aInfFile.ReadKey(aKeyName),m_pTable->getConnection()->getTextEncoding())))
{
aInfFile.DeleteKey(aKeyName);
break;
diff --git a/dbaccess/source/ui/dlg/dbfindex.cxx b/dbaccess/source/ui/dlg/dbfindex.cxx
index bd7532c3799a..f15721a6e840 100644
--- a/dbaccess/source/ui/dlg/dbfindex.cxx
+++ b/dbaccess/source/ui/dlg/dbfindex.cxx
@@ -395,7 +395,7 @@ void ODbaseIndexDialog::Init()
// yes -> add to the tables index list
if (aNDX == "NDX" )
{
- aEntry = String(aInfFile.ReadKey(aKeyName), gsl_getSystemTextEncoding());
+ aEntry = rtl::OStringToOUString(aInfFile.ReadKey(aKeyName), gsl_getSystemTextEncoding());
rTabInfo.aIndexList.push_back( OTableIndex( aEntry ) );
// and remove it from the free index list
diff --git a/padmin/source/fontentry.cxx b/padmin/source/fontentry.cxx
index ab84a548c1bc..7e928665b5cd 100644
--- a/padmin/source/fontentry.cxx
+++ b/padmin/source/fontentry.cxx
@@ -376,7 +376,7 @@ FontImportDialog::FontImportDialog( Window* pParent ) :
Config& rPadminRC( getPadminRC() );
rPadminRC.SetGroup( "FontImport" );
- m_aFromDirEdt.SetText( String( rPadminRC.ReadKey( "FromPath" ), RTL_TEXTENCODING_UTF8 ) );
+ m_aFromDirEdt.SetText( rtl::OStringToOUString(rPadminRC.ReadKey("FromPath"), RTL_TEXTENCODING_UTF8) );
RefreshTimeoutHdl( NULL );
}
diff --git a/padmin/source/newppdlg.cxx b/padmin/source/newppdlg.cxx
index 0da40ce90f02..cde0720aae28 100644
--- a/padmin/source/newppdlg.cxx
+++ b/padmin/source/newppdlg.cxx
@@ -76,7 +76,7 @@ PPDImportDialog::PPDImportDialog( Window* pParent ) :
Config& rConfig = getPadminRC();
rConfig.SetGroup( PPDIMPORT_GROUP );
- m_aPathBox.SetText( String( rConfig.ReadKey( "LastDir" ), RTL_TEXTENCODING_UTF8 ) );
+ m_aPathBox.SetText( rtl::OStringToOUString(rConfig.ReadKey("LastDir"), RTL_TEXTENCODING_UTF8) );
for (sal_Int32 i = 0; i < 11; ++i)
{
ByteString aEntry(rConfig.ReadKey(rtl::OString::valueOf(i)));
@@ -117,7 +117,7 @@ void PPDImportDialog::Import()
break;
if( nEntries < 0 )
{
- sal_Int32 nNextEntry = rConfig.ReadKey( "NextEntry" ).ToInt32();
+ sal_Int32 nNextEntry = rConfig.ReadKey("NextEntry").toInt32();
rConfig.WriteKey( rtl::OString::valueOf(nNextEntry), ByteString( aImportPath, RTL_TEXTENCODING_UTF8 ) );
nNextEntry = nNextEntry < 10 ? nNextEntry+1 : 0;
rConfig.WriteKey( "NextEntry", rtl::OString::valueOf(nNextEntry) );
diff --git a/sw/source/ui/vba/vbasystem.cxx b/sw/source/ui/vba/vbasystem.cxx
index de4d8fd137c9..b397c11ca3c2 100644
--- a/sw/source/ui/vba/vbasystem.cxx
+++ b/sw/source/ui/vba/vbasystem.cxx
@@ -93,7 +93,7 @@ uno::Any PrivateProfileStringListener::getValueEvent()
// get key/value from a file
Config aCfg( maFileName );
aCfg.SetGroup( maGroupName );
- sValue = String( aCfg.ReadKey( maKey ), RTL_TEXTENCODING_DONTKNOW );
+ sValue = rtl::OStringToOUString(aCfg.ReadKey(maKey), RTL_TEXTENCODING_DONTKNOW);
}
else
{
diff --git a/tools/inc/tools/config.hxx b/tools/inc/tools/config.hxx
index a4af25892814..1c904b824447 100644
--- a/tools/inc/tools/config.hxx
+++ b/tools/inc/tools/config.hxx
@@ -70,13 +70,13 @@ public:
sal_uInt16 GetGroupCount() const;
sal_Bool HasGroup(const rtl::OString& rGroup) const;
- ByteString ReadKey( const ByteString& rKey ) const;
- UniString ReadKey( const ByteString& rKey, rtl_TextEncoding eEncoding ) const;
- ByteString ReadKey( const ByteString& rKey, const ByteString& rDefault ) const;
+ rtl::OString ReadKey(const rtl::OString& rKey) const;
+ UniString ReadKey(const rtl::OString& rKey, rtl_TextEncoding eEncoding) const;
+ rtl::OString ReadKey(const rtl::OString& rKey, const rtl::OString& rDefault) const;
void WriteKey(const rtl::OString& rKey, const rtl::OString& rValue);
- void DeleteKey( const ByteString& rKey );
- ByteString GetKeyName( sal_uInt16 nKey ) const;
- ByteString ReadKey( sal_uInt16 nKey ) const;
+ void DeleteKey(const rtl::OString& rKey);
+ rtl::OString GetKeyName(sal_uInt16 nKey) const;
+ rtl::OString ReadKey(sal_uInt16 nKey) const;
sal_uInt16 GetKeyCount() const;
sal_Bool IsLocked() const { return (mnLockCount != 0); }
diff --git a/tools/source/generic/config.cxx b/tools/source/generic/config.cxx
index 52d25c4a1835..fb879ea27b41 100644
--- a/tools/source/generic/config.cxx
+++ b/tools/source/generic/config.cxx
@@ -84,14 +84,6 @@ struct ImplConfigData
// =======================================================================
-static ByteString& getEmptyByteString()
-{
- static ByteString aEmpty;
- return aEmpty;
-}
-
-// =======================================================================
-
static String toUncPath( const String& rPath )
{
::rtl::OUString aFileURL;
@@ -261,17 +253,19 @@ static String ImplMakeConfigName( const XubString* pFileName,
namespace {
-ByteString makeByteString(sal_uInt8 const * p, sal_uInt64 n) {
- if (n > STRING_MAXLEN) {
+rtl::OString makeOString(const sal_uInt8* p, sal_uInt64 n)
+{
+ if (n > SAL_MAX_INT32)
+ {
#ifdef WNT
abort();
#else
::std::abort(); //TODO: handle this gracefully
#endif
}
- return ByteString(
+ return rtl::OString(
reinterpret_cast< char const * >(p),
- sal::static_int_cast< xub_StrLen >(n));
+ sal::static_int_cast< sal_Int32 >(n));
}
}
@@ -286,8 +280,8 @@ static void ImplMakeConfigList( ImplConfigData* pData,
// Buffer parsen und Liste zusammenbauen
sal_uInt64 nStart;
sal_uInt64 nLineLen;
- xub_StrLen nNameLen;
- xub_StrLen nKeyLen;
+ sal_uInt64 nNameLen;
+ sal_uInt64 nKeyLen;
sal_uInt64 i;
const sal_uInt8* pLine;
ImplKeyData* pPrevKey = NULL;
@@ -355,7 +349,7 @@ static void ImplMakeConfigList( ImplConfigData* pData,
while ( (pLine[nNameLen-1] == ' ') || (pLine[nNameLen-1] == '\t') )
nNameLen--;
}
- pGroup->maGroupName = ByteString( (const sal_Char*)pLine, nNameLen );
+ pGroup->maGroupName = makeOString(pLine, nNameLen);
}
else
{
@@ -400,7 +394,7 @@ static void ImplMakeConfigList( ImplConfigData* pData,
pPrevKey = pKey;
if ( pLine[0] == ';' )
{
- pKey->maValue = makeByteString(pLine, nLineLen);
+ pKey->maValue = makeOString(pLine, nLineLen);
pKey->mbIsComment = sal_True;
}
else
@@ -416,7 +410,7 @@ static void ImplMakeConfigList( ImplConfigData* pData,
while ( (pLine[nNameLen-1] == ' ') || (pLine[nNameLen-1] == '\t') )
nNameLen--;
}
- pKey->maKey = ByteString( (const sal_Char*)pLine, nNameLen );
+ pKey->maKey = makeOString(pLine, nNameLen);
nKeyLen++;
if ( nKeyLen < nLineLen )
{
@@ -432,7 +426,7 @@ static void ImplMakeConfigList( ImplConfigData* pData,
{
while ( (pLine[nLineLen-1] == ' ') || (pLine[nLineLen-1] == '\t') )
nLineLen--;
- pKey->maValue = makeByteString(pLine, nLineLen);
+ pKey->maValue = makeOString(pLine, nLineLen);
}
}
}
@@ -636,7 +630,7 @@ static void ImplWriteConfig( ImplConfigData* pData )
{
if ( pData->mnTimeStamp != ImplSysGetConfigTimeStamp( pData->maFileName ) )
{
- OSL_TRACE( "Config overwrites modified configfile:\n %s", ByteString( pData->maFileName, RTL_TEXTENCODING_UTF8 ).GetBuffer() );
+ OSL_TRACE( "Config overwrites modified configfile:\n %s", rtl::OUStringToOString(pData->maFileName, RTL_TEXTENCODING_UTF8).getStr() );
}
}
#endif
@@ -780,10 +774,11 @@ Config::Config( const XubString& rFileName )
mbPersistence = sal_True;
#ifdef DBG_UTIL
- ByteString aTraceStr( "Config::Config( " );
- aTraceStr += ByteString( maFileName, RTL_TEXTENCODING_UTF8 );
- aTraceStr += " )";
- OSL_TRACE( "%s", aTraceStr.GetBuffer() );
+ rtl::OStringBuffer aTraceStr(
+ RTL_CONSTASCII_STRINGPARAM("Config::Config( "));
+ aTraceStr.append(rtl::OUStringToOString(maFileName, RTL_TEXTENCODING_UTF8));
+ aTraceStr.append(RTL_CONSTASCII_STRINGPARAM(" )"));
+ OSL_TRACE("%s", aTraceStr.getStr());
#endif
}
@@ -959,32 +954,33 @@ sal_Bool Config::HasGroup(const rtl::OString& rGroup) const
// -----------------------------------------------------------------------
-ByteString Config::ReadKey( const ByteString& rKey ) const
+rtl::OString Config::ReadKey(const rtl::OString& rKey) const
{
- return ReadKey( rKey, getEmptyByteString() );
+ return ReadKey(rKey, rtl::OString());
}
// -----------------------------------------------------------------------
-UniString Config::ReadKey( const ByteString& rKey, rtl_TextEncoding eEncoding ) const
+UniString Config::ReadKey(const rtl::OString& rKey, rtl_TextEncoding eEncoding) const
{
if ( mpData->mbIsUTF8BOM )
eEncoding = RTL_TEXTENCODING_UTF8;
- return UniString( ReadKey( rKey ), eEncoding );
+ return rtl::OStringToOUString(ReadKey(rKey), eEncoding);
}
// -----------------------------------------------------------------------
-ByteString Config::ReadKey( const ByteString& rKey, const ByteString& rDefault ) const
+rtl::OString Config::ReadKey(const rtl::OString& rKey, const rtl::OString& rDefault) const
{
#ifdef DBG_UTIL
- ByteString aTraceStr( "Config::ReadKey( " );
- aTraceStr += rKey;
- aTraceStr += " ) from ";
- aTraceStr += ByteString(GetGroup());
- aTraceStr += " in ";
- aTraceStr += ByteString( maFileName, RTL_TEXTENCODING_UTF8 );
- OSL_TRACE( "%s", aTraceStr.GetBuffer() );
+ rtl::OStringBuffer aTraceStr(
+ RTL_CONSTASCII_STRINGPARAM("Config::ReadKey( "));
+ aTraceStr.append(rKey);
+ aTraceStr.append(RTL_CONSTASCII_STRINGPARAM(" ) from "));
+ aTraceStr.append(GetGroup());
+ aTraceStr.append(RTL_CONSTASCII_STRINGPARAM(" in "));
+ aTraceStr.append(rtl::OUStringToOString(maFileName, RTL_TEXTENCODING_UTF8));
+ OSL_TRACE("%s", aTraceStr.getStr());
#endif
// Config-Daten evt. updaten
@@ -1078,7 +1074,7 @@ void Config::WriteKey(const rtl::OString& rKey, const rtl::OString& rStr)
// -----------------------------------------------------------------------
-void Config::DeleteKey( const ByteString& rKey )
+void Config::DeleteKey(const rtl::OString& rKey)
{
// Config-Daten evt. updaten
if ( !mnLockCount || !mpData->mbRead )
@@ -1160,7 +1156,7 @@ sal_uInt16 Config::GetKeyCount() const
// -----------------------------------------------------------------------
-ByteString Config::GetKeyName( sal_uInt16 nKey ) const
+rtl::OString Config::GetKeyName(sal_uInt16 nKey) const
{
#ifdef DBG_UTIL
rtl::OStringBuffer aTraceStr(
@@ -1192,12 +1188,12 @@ ByteString Config::GetKeyName( sal_uInt16 nKey ) const
}
}
- return getEmptyByteString();
+ return rtl::OString();
}
// -----------------------------------------------------------------------
-ByteString Config::ReadKey( sal_uInt16 nKey ) const
+rtl::OString Config::ReadKey(sal_uInt16 nKey) const
{
#ifdef DBG_UTIL
rtl::OStringBuffer aTraceStr(
@@ -1229,7 +1225,7 @@ ByteString Config::ReadKey( sal_uInt16 nKey ) const
}
}
- return getEmptyByteString();
+ return rtl::OString();
}
void Config::Flush()