[Libreoffice-commits] .: 3 commits - dbaccess/source starmath/source svtools/inc svtools/source svx/inc svx/source sw/source tools/inc
Caolán McNamara
caolan at kemper.freedesktop.org
Thu May 24 01:48:17 PDT 2012
dbaccess/source/ui/misc/charsets.cxx | 2 +-
starmath/source/parse.cxx | 2 +-
starmath/source/smmod.cxx | 8 ++++----
svtools/inc/svtools/langtab.hxx | 2 +-
svtools/source/misc/langtab.cxx | 7 +++----
svx/inc/svx/strarray.hxx | 2 +-
svx/inc/svx/txenctab.hxx | 2 +-
svx/source/dialog/strarray.cxx | 5 ++---
svx/source/dialog/txenctab.cxx | 7 +++----
sw/source/ui/dbui/mailmergehelper.cxx | 2 +-
sw/source/ui/dbui/mmconfigitem.cxx | 4 ++--
sw/source/ui/dbui/mmlayoutpage.cxx | 4 ++--
tools/inc/tools/resary.hxx | 30 ++++++------------------------
13 files changed, 28 insertions(+), 49 deletions(-)
New commits:
commit a16b4676a53fdc94c63821cf14e7f24e0fe20959
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu May 24 07:36:47 2012 +0100
convert ResStringArray to rtl::OUString
Change-Id: I51b86a10caa5da6e12583c2b22404b0d9282b13d
diff --git a/dbaccess/source/ui/misc/charsets.cxx b/dbaccess/source/ui/misc/charsets.cxx
index d0789ab..e8fbf30 100644
--- a/dbaccess/source/ui/misc/charsets.cxx
+++ b/dbaccess/source/ui/misc/charsets.cxx
@@ -63,7 +63,7 @@ namespace dbaui
if ( RTL_TEXTENCODING_DONTKNOW == _eEncoding )
return sal_True;
- return 0 != GetTextString( _eEncoding ).Len();
+ return !GetTextString(_eEncoding).isEmpty();
}
//-------------------------------------------------------------------------
diff --git a/starmath/source/parse.cxx b/starmath/source/parse.cxx
index 9ecd5ae..d3999a5 100644
--- a/starmath/source/parse.cxx
+++ b/starmath/source/parse.cxx
@@ -2376,7 +2376,7 @@ void SmParser::Special()
sal_uInt16 nCount = sal::static_int_cast< sal_uInt16 >(pFrom->Count());
for (sal_uInt16 i = 0; i < nCount; ++i)
{
- if (pFrom->GetString(i) == rName)
+ if (pFrom->GetString(i).equals(rName))
{
aNewName = pTo->GetString(i);
bReplace = true;
diff --git a/starmath/source/smmod.cxx b/starmath/source/smmod.cxx
index 8b85ad2..d757bcb 100644
--- a/starmath/source/smmod.cxx
+++ b/starmath/source/smmod.cxx
@@ -100,7 +100,7 @@ const String SmLocalizedSymbolData::GetUiSymbolName( const String &rExportName )
sal_uInt16 nCount = sal::static_int_cast< xub_StrLen >(rExportNames.Count());
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);
break;
@@ -121,7 +121,7 @@ const String SmLocalizedSymbolData::GetExportSymbolName( const String &rUiName )
sal_uInt16 nCount = sal::static_int_cast< xub_StrLen >(rUiNames.Count());
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);
break;
@@ -142,7 +142,7 @@ const String SmLocalizedSymbolData::GetUiSymbolSetName( const String &rExportNam
sal_uInt16 nCount = sal::static_int_cast< xub_StrLen >(rExportNames.Count());
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);
break;
@@ -163,7 +163,7 @@ const String SmLocalizedSymbolData::GetExportSymbolSetName( const String &rUiNam
sal_uInt16 nCount = sal::static_int_cast< xub_StrLen >(rUiNames.Count());
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);
break;
diff --git a/svtools/inc/svtools/langtab.hxx b/svtools/inc/svtools/langtab.hxx
index 5785322..0d1ab3a 100644
--- a/svtools/inc/svtools/langtab.hxx
+++ b/svtools/inc/svtools/langtab.hxx
@@ -49,7 +49,7 @@ public:
Tools->Options->LanguageSettings->UserInterface listbox.
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;
sal_uInt32 GetEntryCount() const;
diff --git a/svtools/source/misc/langtab.cxx b/svtools/source/misc/langtab.cxx
index 64af70e..9168daf 100644
--- a/svtools/source/misc/langtab.cxx
+++ b/svtools/source/misc/langtab.cxx
@@ -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);
sal_uInt32 nPos = FindIndex( eLang );
@@ -154,8 +154,7 @@ const String& SvtLanguageTable::GetString( const LanguageType eType, bool bUserI
if ( RESARRAY_INDEX_NOTFOUND != nPos && nPos < Count() )
return ResStringArray::GetString( nPos );
}
- static String aEmptyStr;
- return aEmptyStr;
+ return rtl::OUString();
}
String SvtLanguageTable::GetLanguageString( const LanguageType eType )
@@ -173,7 +172,7 @@ LanguageType SvtLanguageTable::GetType( const String& rStr ) const
for ( sal_uInt32 i = 0; i < nCount; ++i )
{
- if ( rStr == ResStringArray::GetString( i ) )
+ if (ResStringArray::GetString( i ).equals(rStr))
{
eType = LanguageType( GetValue( i ) );
break;
diff --git a/svx/inc/svx/strarray.hxx b/svx/inc/svx/strarray.hxx
index 2583612..5a6b1df 100644
--- a/svx/inc/svx/strarray.hxx
+++ b/svx/inc/svx/strarray.hxx
@@ -42,7 +42,7 @@ public:
SvxStringArray( const ResId& rResId );
~SvxStringArray();
- const String& GetStringByPos( sal_uInt32 nPos ) const;
+ const rtl::OUString GetStringByPos( sal_uInt32 nPos ) const;
};
diff --git a/svx/inc/svx/txenctab.hxx b/svx/inc/svx/txenctab.hxx
index a923c5f..eef7651 100644
--- a/svx/inc/svx/txenctab.hxx
+++ b/svx/inc/svx/txenctab.hxx
@@ -45,7 +45,7 @@ public:
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;
};
diff --git a/svx/source/dialog/strarray.cxx b/svx/source/dialog/strarray.cxx
index d3e9b1d..ec79603 100644
--- a/svx/source/dialog/strarray.cxx
+++ b/svx/source/dialog/strarray.cxx
@@ -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() )
return ResStringArray::GetString( nPos );
- else
- return String::EmptyString();
+ return rtl::OUString();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/dialog/txenctab.cxx b/svx/source/dialog/txenctab.cxx
index 34bc1a3..7b86577 100644
--- a/svx/source/dialog/txenctab.cxx
+++ b/svx/source/dialog/txenctab.cxx
@@ -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 );
if ( RESARRAY_INDEX_NOTFOUND != nPos && nPos < Count() )
return ResStringArray::GetString( nPos );
- static String aEmptyString;
- return aEmptyString;
+ return rtl::OUString();
}
//------------------------------------------------------------------------
@@ -67,7 +66,7 @@ rtl_TextEncoding SvxTextEncodingTable::GetTextEncoding( const String& rStr ) con
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_DONTKNOW;
diff --git a/sw/source/ui/dbui/mailmergehelper.cxx b/sw/source/ui/dbui/mailmergehelper.cxx
index b2058ad..8d90fdf 100644
--- a/sw/source/ui/dbui/mailmergehelper.cxx
+++ b/sw/source/ui/dbui/mailmergehelper.cxx
@@ -505,7 +505,7 @@ String SwAddressPreview::FillData(
nColumn < rDefHeaders.Count() && nColumn < aAssignment.getLength();
++nColumn)
{
- if(rDefHeaders.GetString(nColumn) == aItem.sText &&
+ if (rDefHeaders.GetString(nColumn).equals(aItem.sText) &&
!pAssignment[nColumn].isEmpty())
{
sConvertedColumn = pAssignment[nColumn];
diff --git a/sw/source/ui/dbui/mmconfigitem.cxx b/sw/source/ui/dbui/mmconfigitem.cxx
index a8aa927..af6473a 100644
--- a/sw/source/ui/dbui/mmconfigitem.cxx
+++ b/sw/source/ui/dbui/mmconfigitem.cxx
@@ -1330,7 +1330,7 @@ bool SwMailMergeConfigItem::IsAddressFieldsAssigned() const
nColumn < rHeaders.Count() && nColumn < aAssignment.getLength();
++nColumn)
{
- if(rHeaders.GetString(nColumn) == aItem.sText &&
+ if (rHeaders.GetString(nColumn).equals(aItem.sText) &&
!pAssignment[nColumn].isEmpty())
{
sConvertedColumn = pAssignment[nColumn];
@@ -1389,7 +1389,7 @@ bool SwMailMergeConfigItem::IsGreetingFieldsAssigned() const
nColumn < rHeaders.Count() && nColumn < aAssignment.getLength();
++nColumn)
{
- if(rHeaders.GetString(nColumn) == aItem.sText &&
+ if (rHeaders.GetString(nColumn).equals(aItem.sText) &&
!pAssignment[nColumn].isEmpty())
{
sConvertedColumn = pAssignment[nColumn];
diff --git a/sw/source/ui/dbui/mmlayoutpage.cxx b/sw/source/ui/dbui/mmlayoutpage.cxx
index 55c019c..d9d96d9 100644
--- a/sw/source/ui/dbui/mmlayoutpage.cxx
+++ b/sw/source/ui/dbui/mmlayoutpage.cxx
@@ -370,7 +370,7 @@ SwFrmFmt* SwMailMergeLayoutPage::InsertAddressFrame(
nColumn < rHeaders.Count() && nColumn < aAssignment.getLength();
++nColumn)
{
- if(rHeaders.GetString(nColumn) == aItem.sText &&
+ if (rHeaders.GetString(nColumn).equals(aItem.sText) &&
!pAssignment[nColumn].isEmpty())
{
sConvertedColumn = pAssignment[nColumn];
@@ -627,7 +627,7 @@ void SwMailMergeLayoutPage::InsertGreeting(SwWrtShell& rShell, SwMailMergeConfig
nColumn < rHeaders.Count() && nColumn < aAssignment.getLength();
++nColumn)
{
- if(rHeaders.GetString(nColumn) == aItem.sText &&
+ if (rHeaders.GetString(nColumn).equals(aItem.sText) &&
!pAssignment[nColumn].isEmpty())
{
sConvertedColumn = pAssignment[nColumn];
diff --git a/tools/inc/tools/resary.hxx b/tools/inc/tools/resary.hxx
index caa23d7..cf4d443 100644
--- a/tools/inc/tools/resary.hxx
+++ b/tools/inc/tools/resary.hxx
@@ -48,10 +48,10 @@ class TOOLS_DLLPUBLIC ResStringArray : private boost::noncopyable
// ---------------------
struct ImplResStringItem
{
- XubString m_aStr;
+ rtl::OUString m_aStr;
long m_nValue;
- ImplResStringItem( const XubString& rStr, long nValue = 0 ) :
+ ImplResStringItem( const rtl::OUString& rStr, long nValue = 0 ) :
m_aStr( rStr ),
m_nValue( nValue )
{}
@@ -63,8 +63,8 @@ class TOOLS_DLLPUBLIC ResStringArray : private boost::noncopyable
ResStringArray( const ResId& rResId );
~ResStringArray();
- const XubString& GetString( sal_uInt32 nIndex ) const
- { return (nIndex < m_aStrings.size()) ? m_aStrings[nIndex].m_aStr : String::EmptyString(); }
+ const rtl::OUString GetString( sal_uInt32 nIndex ) const
+ { return (nIndex < m_aStrings.size()) ? m_aStrings[nIndex].m_aStr : rtl::OUString(); }
long GetValue( sal_uInt32 nIndex ) const
{ return (nIndex < m_aStrings.size()) ? m_aStrings[nIndex].m_nValue : -1; }
sal_uInt32 Count() const { return sal_uInt32(m_aStrings.size()); }
commit 2862d842b3ca24cbf8c882fb59b30edc330c5fde
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed May 23 23:15:53 2012 +0100
strangely duplicated inner/outer ImplResStringItem struct
Change-Id: I12884e58505d94b76eb0ad955815ae1702716f0f
diff --git a/tools/inc/tools/resary.hxx b/tools/inc/tools/resary.hxx
index cfdeee4..caa23d7 100644
--- a/tools/inc/tools/resary.hxx
+++ b/tools/inc/tools/resary.hxx
@@ -34,21 +34,6 @@
#include <tools/string.hxx>
#include <tools/resid.hxx>
-// ---------------------
-// - ImplResStringItem -
-// ---------------------
-
-struct ImplResStringItem
-{
- XubString maStr;
- long mnValue;
-
-#ifdef _TOOLS_RESARY_CXX
- ImplResStringItem( const XubString& rStr ) :
- maStr( rStr ) {}
-#endif
-};
-
// ------------------
// - ResStringArray -
// ------------------
commit d7ab6a7d4322a0412978638d1ddeb0a3f0131e12
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed May 23 23:09:49 2012 +0100
use boost::noncopyable
Change-Id: I862a4223c955c3a9e9a366b0f3a85465f38e76be
diff --git a/tools/inc/tools/resary.hxx b/tools/inc/tools/resary.hxx
index 429c05d..cfdeee4 100644
--- a/tools/inc/tools/resary.hxx
+++ b/tools/inc/tools/resary.hxx
@@ -28,6 +28,7 @@
#ifndef _TOOLS_RESARY_HXX
#define _TOOLS_RESARY_HXX
+#include "boost/noncopyable.hpp"
#include <vector>
#include "tools/toolsdllapi.h"
#include <tools/string.hxx>
@@ -54,7 +55,7 @@ struct ImplResStringItem
#define RESARRAY_INDEX_NOTFOUND (0xffffffff)
-class TOOLS_DLLPUBLIC ResStringArray
+class TOOLS_DLLPUBLIC ResStringArray : private boost::noncopyable
{
private:
// ---------------------
@@ -84,10 +85,6 @@ class TOOLS_DLLPUBLIC ResStringArray
sal_uInt32 Count() const { return sal_uInt32(m_aStrings.size()); }
sal_uInt32 FindIndex( long nValue ) const;
-
- private:
- ResStringArray( const ResStringArray& );
- ResStringArray& operator=( const ResStringArray& );
};
#endif // _TOOLS_RESARY_HXX
More information about the Libreoffice-commits
mailing list