diff options
author | Noel Grandin <noel@peralex.com> | 2012-10-05 08:15:43 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2012-10-09 21:20:19 +0000 |
commit | be5f517a37086ee270a954cf8461585be7c39242 (patch) | |
tree | a2994601efda2ad39f4a9502f0eeaa7fb0d31b0c /svl | |
parent | 58528348fad0609c4d7af7943bc76df4261b8508 (diff) |
String->OUString in svl::SvNumberFormat::GetMappedFormatstring method
Change-Id: I80512acbcd639ee20f56f9ac95efc00bd3209b76
Reviewed-on: https://gerrit.libreoffice.org/770
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'svl')
-rw-r--r-- | svl/inc/svl/zformat.hxx | 2 | ||||
-rw-r--r-- | svl/source/numbers/zformat.cxx | 48 |
2 files changed, 25 insertions, 25 deletions
diff --git a/svl/inc/svl/zformat.hxx b/svl/inc/svl/zformat.hxx index 1a352825e617..ead212c9eb68 100644 --- a/svl/inc/svl/zformat.hxx +++ b/svl/inc/svl/zformat.hxx @@ -224,7 +224,7 @@ public: const OUString& GetFormatstring() const { return sFormatstring; } // Build a format string of application defined keywords - String GetMappedFormatstring( const NfKeywordTable& rKeywords, + OUString GetMappedFormatstring( const NfKeywordTable& rKeywords, const LocaleDataWrapper& rLoc, bool bDontQuote = false ) const; diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx index 5c4c31c7fcf3..ed20ade4112d 100644 --- a/svl/source/numbers/zformat.cxx +++ b/svl/source/numbers/zformat.cxx @@ -4543,11 +4543,11 @@ void lcl_SvNumberformat_AddLimitStringImpl( String& rStr, } } -String SvNumberformat::GetMappedFormatstring( +OUString SvNumberformat::GetMappedFormatstring( const NfKeywordTable& rKeywords, const LocaleDataWrapper& rLocWrp, bool bDontQuote ) const { - String aStr; + OUStringBuffer aStr; bool bDefault[4]; // 1 subformat matches all if no condition specified, bDefault[0] = ( NumFor[1].GetCount() == 0 && eOp1 == NUMBERFORMAT_OP_NO ); @@ -4628,13 +4628,13 @@ String SvNumberformat::GetMappedFormatstring( if ( nSem && (nAnz || aPrefix.Len()) ) { for ( ; nSem; --nSem ) - aStr += ';'; + aStr.append( ';' ); for ( ; nSub <= n; ++nSub ) bDefault[nSub] = false; } if ( aPrefix.Len() ) - aStr += aPrefix; + aStr.append( aPrefix ); if ( nAnz ) { @@ -4644,64 +4644,64 @@ String SvNumberformat::GetMappedFormatstring( { if ( 0 <= pType[j] && pType[j] < NF_KEYWORD_ENTRIES_COUNT ) { - aStr += rKeywords[pType[j]]; + aStr.append( rKeywords[pType[j]] ); if( NF_KEY_NNNN == pType[j] ) - aStr += rLocWrp.getLongDateDayOfWeekSep(); + aStr.append( rLocWrp.getLongDateDayOfWeekSep() ); } else { switch ( pType[j] ) { case NF_SYMBOLTYPE_DECSEP : - aStr += rLocWrp.getNumDecimalSep(); + aStr.append( rLocWrp.getNumDecimalSep() ); break; case NF_SYMBOLTYPE_THSEP : - aStr += rLocWrp.getNumThousandSep(); + aStr.append( rLocWrp.getNumThousandSep() ); break; case NF_SYMBOLTYPE_DATESEP : - aStr += rLocWrp.getDateSep(); + aStr.append( rLocWrp.getDateSep() ); break; case NF_SYMBOLTYPE_TIMESEP : - aStr += rLocWrp.getTimeSep(); + aStr.append( rLocWrp.getTimeSep() ); break; case NF_SYMBOLTYPE_TIME100SECSEP : - aStr += rLocWrp.getTime100SecSep(); + aStr.append( rLocWrp.getTime100SecSep() ); break; case NF_SYMBOLTYPE_STRING : if( bDontQuote ) - aStr += pStr[j]; + aStr.append( pStr[j] ); else if ( pStr[j].getLength() == 1 ) { - aStr += '\\'; - aStr += pStr[j]; + aStr.append( '\\' ); + aStr.append( pStr[j] ); } else { - aStr += '"'; - aStr += pStr[j]; - aStr += '"'; + aStr.append( '"' ); + aStr.append( pStr[j] ); + aStr.append( '"' ); } break; case NF_SYMBOLTYPE_CALDEL : if ( pStr[j+1].equalsAscii("buddhist") ) { - aStr.InsertAscii( "[$-", 0 ); + aStr.insert( 0, "[$-" ); if ( rNum.IsSet() && rNum.GetNatNum() == 1 && MsLangId::getRealLanguage( rNum.GetLang() ) == LANGUAGE_THAI ) { - aStr.InsertAscii( "D07041E]", 3 ); // date in Thai digit, Buddhist era + aStr.insert( 3, "D07041E]" ); // date in Thai digit, Buddhist era } else { - aStr.InsertAscii( "107041E]", 3 ); // date in Arabic digit, Buddhist era + aStr.insert( 3, "107041E]" ); // date in Arabic digit, Buddhist era } j = j+2; } LCIDInserted = true; break; default: - aStr += pStr[j]; + aStr.append( pStr[j] ); } } @@ -4714,14 +4714,14 @@ String SvNumberformat::GetMappedFormatstring( LANGUAGE_THAI && !LCIDInserted ) { - aStr.InsertAscii( "[$-D00041E]", 0 ); // number in Thai digit + aStr.insert( 0, "[$-D00041E]" ); // number in Thai digit } } for ( ; nSub<4 && bDefault[nSub]; ++nSub ) { // append empty subformats - aStr += ';'; + aStr.append( ';' ); } - return aStr; + return aStr.getStr(); } String SvNumberformat::ImpGetNatNumString( const SvNumberNatNum& rNum, |