String->OUString in svl::ImpSvNumFor::GetNewCurrencySymbol method

Change-Id: Ie283a02903b0bf420291e1e4e1e29232cc7ff3a9
Reviewed-on: https://gerrit.libreoffice.org/771
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Michael Stahl <mstahl@redhat.com>
This commit is contained in:
Noel Grandin 2012-10-05 08:42:18 +02:00 committed by Michael Stahl
parent be5f517a37
commit c90e006435
6 changed files with 22 additions and 21 deletions

View file

@ -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 );

View file

@ -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,

View file

@ -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;
}
}

View file

@ -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 += ']';
}

View file

@ -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;
}

View file

@ -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) &&