Kaydet (Commit) a16b4676 authored tarafından Caolán McNamara's avatar Caolán McNamara

convert ResStringArray to rtl::OUString

Change-Id: I51b86a10caa5da6e12583c2b22404b0d9282b13d
üst 2862d842
...@@ -63,7 +63,7 @@ namespace dbaui ...@@ -63,7 +63,7 @@ namespace dbaui
if ( RTL_TEXTENCODING_DONTKNOW == _eEncoding ) if ( RTL_TEXTENCODING_DONTKNOW == _eEncoding )
return sal_True; return sal_True;
return 0 != GetTextString( _eEncoding ).Len(); return !GetTextString(_eEncoding).isEmpty();
} }
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
......
...@@ -2376,7 +2376,7 @@ void SmParser::Special() ...@@ -2376,7 +2376,7 @@ void SmParser::Special()
sal_uInt16 nCount = sal::static_int_cast< sal_uInt16 >(pFrom->Count()); sal_uInt16 nCount = sal::static_int_cast< sal_uInt16 >(pFrom->Count());
for (sal_uInt16 i = 0; i < nCount; ++i) for (sal_uInt16 i = 0; i < nCount; ++i)
{ {
if (pFrom->GetString(i) == rName) if (pFrom->GetString(i).equals(rName))
{ {
aNewName = pTo->GetString(i); aNewName = pTo->GetString(i);
bReplace = true; bReplace = true;
......
...@@ -100,7 +100,7 @@ const String SmLocalizedSymbolData::GetUiSymbolName( const String &rExportName ) ...@@ -100,7 +100,7 @@ const String SmLocalizedSymbolData::GetUiSymbolName( const String &rExportName )
sal_uInt16 nCount = sal::static_int_cast< xub_StrLen >(rExportNames.Count()); sal_uInt16 nCount = sal::static_int_cast< xub_StrLen >(rExportNames.Count());
for (sal_uInt16 i = 0; i < nCount && !aRes.Len(); ++i) for (sal_uInt16 i = 0; i < nCount && !aRes.Len(); ++i)
{ {
if (rExportName == rExportNames.GetString(i)) if (rExportNames.GetString(i).equals(rExportName))
{ {
aRes = rUiNames.GetString(i); aRes = rUiNames.GetString(i);
break; break;
...@@ -121,7 +121,7 @@ const String SmLocalizedSymbolData::GetExportSymbolName( const String &rUiName ) ...@@ -121,7 +121,7 @@ const String SmLocalizedSymbolData::GetExportSymbolName( const String &rUiName )
sal_uInt16 nCount = sal::static_int_cast< xub_StrLen >(rUiNames.Count()); sal_uInt16 nCount = sal::static_int_cast< xub_StrLen >(rUiNames.Count());
for (sal_uInt16 i = 0; i < nCount && !aRes.Len(); ++i) for (sal_uInt16 i = 0; i < nCount && !aRes.Len(); ++i)
{ {
if (rUiName == rUiNames.GetString(i)) if (rUiNames.GetString(i).equals(rUiName))
{ {
aRes = rExportNames.GetString(i); aRes = rExportNames.GetString(i);
break; break;
...@@ -142,7 +142,7 @@ const String SmLocalizedSymbolData::GetUiSymbolSetName( const String &rExportNam ...@@ -142,7 +142,7 @@ const String SmLocalizedSymbolData::GetUiSymbolSetName( const String &rExportNam
sal_uInt16 nCount = sal::static_int_cast< xub_StrLen >(rExportNames.Count()); sal_uInt16 nCount = sal::static_int_cast< xub_StrLen >(rExportNames.Count());
for (sal_uInt16 i = 0; i < nCount && !aRes.Len(); ++i) for (sal_uInt16 i = 0; i < nCount && !aRes.Len(); ++i)
{ {
if (rExportName == rExportNames.GetString(i)) if (rExportNames.GetString(i).equals(rExportName))
{ {
aRes = rUiNames.GetString(i); aRes = rUiNames.GetString(i);
break; break;
...@@ -163,7 +163,7 @@ const String SmLocalizedSymbolData::GetExportSymbolSetName( const String &rUiNam ...@@ -163,7 +163,7 @@ const String SmLocalizedSymbolData::GetExportSymbolSetName( const String &rUiNam
sal_uInt16 nCount = sal::static_int_cast< xub_StrLen >(rUiNames.Count()); sal_uInt16 nCount = sal::static_int_cast< xub_StrLen >(rUiNames.Count());
for (sal_uInt16 i = 0; i < nCount && !aRes.Len(); ++i) for (sal_uInt16 i = 0; i < nCount && !aRes.Len(); ++i)
{ {
if (rUiName == rUiNames.GetString(i)) if (rUiNames.GetString(i).equals(rUiName))
{ {
aRes = rExportNames.GetString(i); aRes = rExportNames.GetString(i);
break; break;
......
...@@ -49,7 +49,7 @@ public: ...@@ -49,7 +49,7 @@ public:
Tools->Options->LanguageSettings->UserInterface listbox. Tools->Options->LanguageSettings->UserInterface listbox.
If FALSE, do replace. If FALSE, do replace.
*/ */
const String& GetString( const LanguageType eType, bool bUserInterfaceSelection = false ) const; const rtl::OUString GetString( const LanguageType eType, bool bUserInterfaceSelection = false ) const;
LanguageType GetType( const String& rStr ) const; LanguageType GetType( const String& rStr ) const;
sal_uInt32 GetEntryCount() const; sal_uInt32 GetEntryCount() const;
......
...@@ -135,7 +135,7 @@ SvtLanguageTable::~SvtLanguageTable() ...@@ -135,7 +135,7 @@ SvtLanguageTable::~SvtLanguageTable()
//------------------------------------------------------------------------ //------------------------------------------------------------------------
const String& SvtLanguageTable::GetString( const LanguageType eType, bool bUserInterfaceSelection ) const const rtl::OUString SvtLanguageTable::GetString( const LanguageType eType, bool bUserInterfaceSelection ) const
{ {
LanguageType eLang = MsLangId::getReplacementForObsoleteLanguage( eType, bUserInterfaceSelection); LanguageType eLang = MsLangId::getReplacementForObsoleteLanguage( eType, bUserInterfaceSelection);
sal_uInt32 nPos = FindIndex( eLang ); sal_uInt32 nPos = FindIndex( eLang );
...@@ -154,8 +154,7 @@ const String& SvtLanguageTable::GetString( const LanguageType eType, bool bUserI ...@@ -154,8 +154,7 @@ const String& SvtLanguageTable::GetString( const LanguageType eType, bool bUserI
if ( RESARRAY_INDEX_NOTFOUND != nPos && nPos < Count() ) if ( RESARRAY_INDEX_NOTFOUND != nPos && nPos < Count() )
return ResStringArray::GetString( nPos ); return ResStringArray::GetString( nPos );
} }
static String aEmptyStr; return rtl::OUString();
return aEmptyStr;
} }
String SvtLanguageTable::GetLanguageString( const LanguageType eType ) String SvtLanguageTable::GetLanguageString( const LanguageType eType )
...@@ -173,7 +172,7 @@ LanguageType SvtLanguageTable::GetType( const String& rStr ) const ...@@ -173,7 +172,7 @@ LanguageType SvtLanguageTable::GetType( const String& rStr ) const
for ( sal_uInt32 i = 0; i < nCount; ++i ) for ( sal_uInt32 i = 0; i < nCount; ++i )
{ {
if ( rStr == ResStringArray::GetString( i ) ) if (ResStringArray::GetString( i ).equals(rStr))
{ {
eType = LanguageType( GetValue( i ) ); eType = LanguageType( GetValue( i ) );
break; break;
......
...@@ -42,7 +42,7 @@ public: ...@@ -42,7 +42,7 @@ public:
SvxStringArray( const ResId& rResId ); SvxStringArray( const ResId& rResId );
~SvxStringArray(); ~SvxStringArray();
const String& GetStringByPos( sal_uInt32 nPos ) const; const rtl::OUString GetStringByPos( sal_uInt32 nPos ) const;
}; };
......
...@@ -45,7 +45,7 @@ public: ...@@ -45,7 +45,7 @@ public:
SvxTextEncodingTable(); SvxTextEncodingTable();
~SvxTextEncodingTable(); ~SvxTextEncodingTable();
const String& GetTextString( const rtl_TextEncoding nEnc ) const; const rtl::OUString GetTextString( const rtl_TextEncoding nEnc ) const;
rtl_TextEncoding GetTextEncoding( const String& rStr ) const; rtl_TextEncoding GetTextEncoding( const String& rStr ) const;
}; };
......
...@@ -59,12 +59,11 @@ SvxStringArray::~SvxStringArray() ...@@ -59,12 +59,11 @@ SvxStringArray::~SvxStringArray()
//------------------------------------------------------------------------ //------------------------------------------------------------------------
const String& SvxStringArray::GetStringByPos( sal_uInt32 nPos ) const const rtl::OUString SvxStringArray::GetStringByPos( sal_uInt32 nPos ) const
{ {
if ( RESARRAY_INDEX_NOTFOUND != nPos && nPos < Count() ) if ( RESARRAY_INDEX_NOTFOUND != nPos && nPos < Count() )
return ResStringArray::GetString( nPos ); return ResStringArray::GetString( nPos );
else return rtl::OUString();
return String::EmptyString();
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -48,15 +48,14 @@ SvxTextEncodingTable::~SvxTextEncodingTable() ...@@ -48,15 +48,14 @@ SvxTextEncodingTable::~SvxTextEncodingTable()
//------------------------------------------------------------------------ //------------------------------------------------------------------------
const String& SvxTextEncodingTable::GetTextString( const rtl_TextEncoding nEnc ) const const rtl::OUString SvxTextEncodingTable::GetTextString( const rtl_TextEncoding nEnc ) const
{ {
sal_uInt32 nPos = FindIndex( (long)nEnc ); sal_uInt32 nPos = FindIndex( (long)nEnc );
if ( RESARRAY_INDEX_NOTFOUND != nPos && nPos < Count() ) if ( RESARRAY_INDEX_NOTFOUND != nPos && nPos < Count() )
return ResStringArray::GetString( nPos ); return ResStringArray::GetString( nPos );
static String aEmptyString; return rtl::OUString();
return aEmptyString;
} }
//------------------------------------------------------------------------ //------------------------------------------------------------------------
...@@ -67,7 +66,7 @@ rtl_TextEncoding SvxTextEncodingTable::GetTextEncoding( const String& rStr ) con ...@@ -67,7 +66,7 @@ rtl_TextEncoding SvxTextEncodingTable::GetTextEncoding( const String& rStr ) con
for ( sal_uInt32 i = 0; i < nCount; ++i ) for ( sal_uInt32 i = 0; i < nCount; ++i )
{ {
if ( rStr == ResStringArray::GetString( i ) ) if (ResStringArray::GetString( i ).equals(rStr))
return rtl_TextEncoding( GetValue( i ) ); return rtl_TextEncoding( GetValue( i ) );
} }
return RTL_TEXTENCODING_DONTKNOW; return RTL_TEXTENCODING_DONTKNOW;
......
...@@ -505,7 +505,7 @@ String SwAddressPreview::FillData( ...@@ -505,7 +505,7 @@ String SwAddressPreview::FillData(
nColumn < rDefHeaders.Count() && nColumn < aAssignment.getLength(); nColumn < rDefHeaders.Count() && nColumn < aAssignment.getLength();
++nColumn) ++nColumn)
{ {
if(rDefHeaders.GetString(nColumn) == aItem.sText && if (rDefHeaders.GetString(nColumn).equals(aItem.sText) &&
!pAssignment[nColumn].isEmpty()) !pAssignment[nColumn].isEmpty())
{ {
sConvertedColumn = pAssignment[nColumn]; sConvertedColumn = pAssignment[nColumn];
......
...@@ -1330,7 +1330,7 @@ bool SwMailMergeConfigItem::IsAddressFieldsAssigned() const ...@@ -1330,7 +1330,7 @@ bool SwMailMergeConfigItem::IsAddressFieldsAssigned() const
nColumn < rHeaders.Count() && nColumn < aAssignment.getLength(); nColumn < rHeaders.Count() && nColumn < aAssignment.getLength();
++nColumn) ++nColumn)
{ {
if(rHeaders.GetString(nColumn) == aItem.sText && if (rHeaders.GetString(nColumn).equals(aItem.sText) &&
!pAssignment[nColumn].isEmpty()) !pAssignment[nColumn].isEmpty())
{ {
sConvertedColumn = pAssignment[nColumn]; sConvertedColumn = pAssignment[nColumn];
...@@ -1389,7 +1389,7 @@ bool SwMailMergeConfigItem::IsGreetingFieldsAssigned() const ...@@ -1389,7 +1389,7 @@ bool SwMailMergeConfigItem::IsGreetingFieldsAssigned() const
nColumn < rHeaders.Count() && nColumn < aAssignment.getLength(); nColumn < rHeaders.Count() && nColumn < aAssignment.getLength();
++nColumn) ++nColumn)
{ {
if(rHeaders.GetString(nColumn) == aItem.sText && if (rHeaders.GetString(nColumn).equals(aItem.sText) &&
!pAssignment[nColumn].isEmpty()) !pAssignment[nColumn].isEmpty())
{ {
sConvertedColumn = pAssignment[nColumn]; sConvertedColumn = pAssignment[nColumn];
......
...@@ -370,7 +370,7 @@ SwFrmFmt* SwMailMergeLayoutPage::InsertAddressFrame( ...@@ -370,7 +370,7 @@ SwFrmFmt* SwMailMergeLayoutPage::InsertAddressFrame(
nColumn < rHeaders.Count() && nColumn < aAssignment.getLength(); nColumn < rHeaders.Count() && nColumn < aAssignment.getLength();
++nColumn) ++nColumn)
{ {
if(rHeaders.GetString(nColumn) == aItem.sText && if (rHeaders.GetString(nColumn).equals(aItem.sText) &&
!pAssignment[nColumn].isEmpty()) !pAssignment[nColumn].isEmpty())
{ {
sConvertedColumn = pAssignment[nColumn]; sConvertedColumn = pAssignment[nColumn];
...@@ -627,7 +627,7 @@ void SwMailMergeLayoutPage::InsertGreeting(SwWrtShell& rShell, SwMailMergeConfig ...@@ -627,7 +627,7 @@ void SwMailMergeLayoutPage::InsertGreeting(SwWrtShell& rShell, SwMailMergeConfig
nColumn < rHeaders.Count() && nColumn < aAssignment.getLength(); nColumn < rHeaders.Count() && nColumn < aAssignment.getLength();
++nColumn) ++nColumn)
{ {
if(rHeaders.GetString(nColumn) == aItem.sText && if (rHeaders.GetString(nColumn).equals(aItem.sText) &&
!pAssignment[nColumn].isEmpty()) !pAssignment[nColumn].isEmpty())
{ {
sConvertedColumn = pAssignment[nColumn]; sConvertedColumn = pAssignment[nColumn];
......
...@@ -48,10 +48,10 @@ class TOOLS_DLLPUBLIC ResStringArray : private boost::noncopyable ...@@ -48,10 +48,10 @@ class TOOLS_DLLPUBLIC ResStringArray : private boost::noncopyable
// --------------------- // ---------------------
struct ImplResStringItem struct ImplResStringItem
{ {
XubString m_aStr; rtl::OUString m_aStr;
long m_nValue; long m_nValue;
ImplResStringItem( const XubString& rStr, long nValue = 0 ) : ImplResStringItem( const rtl::OUString& rStr, long nValue = 0 ) :
m_aStr( rStr ), m_aStr( rStr ),
m_nValue( nValue ) m_nValue( nValue )
{} {}
...@@ -63,8 +63,8 @@ class TOOLS_DLLPUBLIC ResStringArray : private boost::noncopyable ...@@ -63,8 +63,8 @@ class TOOLS_DLLPUBLIC ResStringArray : private boost::noncopyable
ResStringArray( const ResId& rResId ); ResStringArray( const ResId& rResId );
~ResStringArray(); ~ResStringArray();
const XubString& GetString( sal_uInt32 nIndex ) const const rtl::OUString GetString( sal_uInt32 nIndex ) const
{ return (nIndex < m_aStrings.size()) ? m_aStrings[nIndex].m_aStr : String::EmptyString(); } { return (nIndex < m_aStrings.size()) ? m_aStrings[nIndex].m_aStr : rtl::OUString(); }
long GetValue( sal_uInt32 nIndex ) const long GetValue( sal_uInt32 nIndex ) const
{ return (nIndex < m_aStrings.size()) ? m_aStrings[nIndex].m_nValue : -1; } { return (nIndex < m_aStrings.size()) ? m_aStrings[nIndex].m_nValue : -1; }
sal_uInt32 Count() const { return sal_uInt32(m_aStrings.size()); } sal_uInt32 Count() const { return sal_uInt32(m_aStrings.size()); }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment