[Libreoffice-commits] .: svl/inc svl/source svx/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Tue Oct 9 14:24:21 PDT 2012
svl/inc/svl/zformat.hxx | 4 ++--
svl/source/numbers/numfmuno.cxx | 9 +++++----
svl/source/numbers/zforfind.cxx | 6 +++---
svl/source/numbers/zforlist.cxx | 8 ++++----
svl/source/numbers/zformat.cxx | 14 +++++++-------
svx/source/items/numfmtsh.cxx | 2 +-
6 files changed, 22 insertions(+), 21 deletions(-)
New commits:
commit c90e0064357f78ffc9ee8261c6c100c15d904beb
Author: Noel Grandin <noel at peralex.com>
Date: Fri Oct 5 08:42:18 2012 +0200
String->OUString in svl::ImpSvNumFor::GetNewCurrencySymbol method
Change-Id: Ie283a02903b0bf420291e1e4e1e29232cc7ff3a9
Reviewed-on: https://gerrit.libreoffice.org/771
Reviewed-by: Michael Stahl <mstahl at redhat.com>
Tested-by: Michael Stahl <mstahl at redhat.com>
diff --git a/svl/inc/svl/zformat.hxx b/svl/inc/svl/zformat.hxx
index ead212c..1dbb973 100644
--- a/svl/inc/svl/zformat.hxx
+++ b/svl/inc/svl/zformat.hxx
@@ -146,7 +146,7 @@ public:
// new SYMBOLTYPE_CURRENCY in subformat?
bool HasNewCurrency() const;
- bool GetNewCurrencySymbol( String& rSymbol, String& rExtension ) const;
+ bool GetNewCurrencySymbol( OUString& rSymbol, OUString& rExtension ) const;
void SaveNewCurrencyMap( SvStream& rStream ) const;
void LoadNewCurrencyMap( SvStream& rStream );
@@ -344,7 +344,7 @@ public:
// If a new SYMBOLTYPE_CURRENCY is contained if the format is of type
// NUMBERFORMAT_CURRENCY, and if so the symbol xxx and the extension nnn
// of [$xxx-nnn] are returned
- bool GetNewCurrencySymbol( String& rSymbol, String& rExtension ) const;
+ bool GetNewCurrencySymbol( OUString& rSymbol, OUString& rExtension ) const;
static bool HasStringNegativeSign( const String& rStr );
diff --git a/svl/source/numbers/numfmuno.cxx b/svl/source/numbers/numfmuno.cxx
index 461ff8b..6b60052 100644
--- a/svl/source/numbers/numfmuno.cxx
+++ b/svl/source/numbers/numfmuno.cxx
@@ -802,19 +802,19 @@ uno::Any SAL_CALL SvNumberFormatObj::getPropertyValue( const rtl::OUString& aPro
}
else if (aString.EqualsAscii( PROPERTYNAME_CURRSYM ))
{
- String aSymbol, aExt;
+ OUString aSymbol, aExt;
pFormat->GetNewCurrencySymbol( aSymbol, aExt );
aRet <<= rtl::OUString( aSymbol );
}
else if (aString.EqualsAscii( PROPERTYNAME_CURREXT ))
{
- String aSymbol, aExt;
+ OUString aSymbol, aExt;
pFormat->GetNewCurrencySymbol( aSymbol, aExt );
aRet <<= rtl::OUString( aExt );
}
else if (aString.EqualsAscii( PROPERTYNAME_CURRABB ))
{
- String aSymbol, aExt;
+ OUString aSymbol, aExt;
bool bBank = false;
pFormat->GetNewCurrencySymbol( aSymbol, aExt );
const NfCurrencyEntry* pCurr = pFormatter->GetCurrencyEntry( bBank,
@@ -876,7 +876,8 @@ uno::Sequence<beans::PropertyValue> SAL_CALL SvNumberFormatObj::getPropertyValue
const SvNumberformat* pFormat = pFormatter ? pFormatter->GetEntry(nKey) : NULL;
if (pFormat)
{
- String aSymbol, aExt, aAbb;
+ OUString aSymbol, aExt;
+ String aAbb;
bool bBank = false;
pFormat->GetNewCurrencySymbol( aSymbol, aExt );
const NfCurrencyEntry* pCurr = pFormatter->GetCurrencyEntry( bBank,
diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx
index 69d6761..085d567 100644
--- a/svl/source/numbers/zforfind.cxx
+++ b/svl/source/numbers/zforfind.cxx
@@ -673,15 +673,15 @@ bool ImpSvNumberInputScan::GetCurrency( const String& rString, xub_StrLen& nPos,
}
if ( pFormat )
{
- String aSymbol, aExtension;
+ OUString aSymbol, aExtension;
if ( pFormat->GetNewCurrencySymbol( aSymbol, aExtension ) )
{
- if ( aSymbol.Len() <= rString.Len() - nPos )
+ if ( aSymbol.getLength() <= rString.Len() - nPos )
{
aSymbol = pFormatter->GetCharClass()->uppercase(aSymbol);
if ( StringContains( aSymbol, rString, nPos ) )
{
- nPos = nPos + aSymbol.Len();
+ nPos = nPos + aSymbol.getLength();
return true;
}
}
diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx
index 22872d1..692b228 100644
--- a/svl/source/numbers/zforlist.cxx
+++ b/svl/source/numbers/zforlist.cxx
@@ -3307,7 +3307,7 @@ bool SvNumberFormatter::GetNewCurrencySymbolString( sal_uInt32 nFormat,
const SvNumberformat* pFormat = GetFormatEntry(nFormat);
if ( pFormat )
{
- String aSymbol, aExtension;
+ OUString aSymbol, aExtension;
if ( pFormat->GetNewCurrencySymbol( aSymbol, aExtension ) )
{
if ( ppEntry )
@@ -3329,8 +3329,8 @@ bool SvNumberFormatter::GetNewCurrencySymbolString( sal_uInt32 nFormat,
{ // analog to BuildSymbolString
rStr = '[';
rStr += '$';
- if ( aSymbol.Search( '-' ) != STRING_NOTFOUND ||
- aSymbol.Search( ']' ) != STRING_NOTFOUND )
+ if ( aSymbol.indexOf( '-' ) != -1 ||
+ aSymbol.indexOf( ']' ) != -1 )
{
rStr += '"';
rStr += aSymbol;
@@ -3338,7 +3338,7 @@ bool SvNumberFormatter::GetNewCurrencySymbolString( sal_uInt32 nFormat,
}
else
rStr += aSymbol;
- if ( aExtension.Len() )
+ if ( aExtension.getLength() )
rStr += aExtension;
rStr += ']';
}
diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx
index ed20ade..b5c583c 100644
--- a/svl/source/numbers/zformat.cxx
+++ b/svl/source/numbers/zformat.cxx
@@ -404,8 +404,8 @@ bool ImpSvNumFor::HasNewCurrency() const
return false;
}
-bool ImpSvNumFor::GetNewCurrencySymbol( String& rSymbol,
- String& rExtension ) const
+bool ImpSvNumFor::GetNewCurrencySymbol( OUString& rSymbol,
+ OUString& rExtension ) const
{
for ( sal_uInt16 j=0; j<nAnzStrings; j++ )
{
@@ -415,7 +415,7 @@ bool ImpSvNumFor::GetNewCurrencySymbol( String& rSymbol,
if ( j < nAnzStrings-1 && aI.nTypeArray[j+1] == NF_SYMBOLTYPE_CURREXT )
rExtension = aI.sStrArray[j+1];
else
- rExtension.Erase();
+ rExtension = "";
return true;
}
}
@@ -1849,16 +1849,16 @@ bool SvNumberformat::HasNewCurrency() const
return false;
}
-bool SvNumberformat::GetNewCurrencySymbol( String& rSymbol,
- String& rExtension ) const
+bool SvNumberformat::GetNewCurrencySymbol( OUString& rSymbol,
+ OUString& rExtension ) const
{
for ( sal_uInt16 j=0; j<4; j++ )
{
if ( NumFor[j].GetNewCurrencySymbol( rSymbol, rExtension ) )
return true;
}
- rSymbol.Erase();
- rExtension.Erase();
+ rSymbol = "";
+ rExtension = "";
return false;
}
diff --git a/svx/source/items/numfmtsh.cxx b/svx/source/items/numfmtsh.cxx
index be29114..c249531 100644
--- a/svx/source/items/numfmtsh.cxx
+++ b/svx/source/items/numfmtsh.cxx
@@ -1696,7 +1696,7 @@ sal_uInt16 SvxNumberFormatShell::FindCurrencyTableEntry( const String& rFmtStrin
sal_uInt16 nCount=rCurrencyTable.size();
const SvNumberformat* pFormat;
- String aSymbol, aExtension;
+ OUString aSymbol, aExtension;
sal_uInt32 nFound = pFormatter->TestNewString( rFmtString, eCurLanguage );
if ( nFound != NUMBERFORMAT_ENTRY_NOT_FOUND &&
((pFormat = pFormatter->GetEntry( nFound )) != 0) &&
More information about the Libreoffice-commits
mailing list