diff options
author | Norbert Thiebaud <nthiebaud@gmail.com> | 2012-11-24 01:30:57 -0600 |
---|---|---|
committer | Norbert Thiebaud <nthiebaud@gmail.com> | 2012-11-27 22:59:27 -0600 |
commit | db650a359b350e10be3ad28ecb9b5b69300203a7 (patch) | |
tree | 2ae96bfa18e9b7be82f76c27f09c12d39359537b /svl | |
parent | 087dd70dac798ffe0448e2183614182442ebcc60 (diff) |
remove String usage from SvNumberformat::Save
Change-Id: I07d379c9a38a60b5950ff4e2970e46f18cac2de2
Diffstat (limited to 'svl')
-rw-r--r-- | svl/inc/svl/zformat.hxx | 6 | ||||
-rw-r--r-- | svl/source/numbers/zformat.cxx | 18 |
2 files changed, 12 insertions, 12 deletions
diff --git a/svl/inc/svl/zformat.hxx b/svl/inc/svl/zformat.hxx index 18f5a359fb11..69c1394b3334 100644 --- a/svl/inc/svl/zformat.hxx +++ b/svl/inc/svl/zformat.hxx @@ -335,12 +335,12 @@ public: bool HasNewCurrency() const; // Build string from NewCurrency for saving it SO50 compatible - void Build50Formatstring( String& rStr ) const; + void Build50Formatstring( OUString& rStr ) const; // strip [$-yyy] from all [$xxx-yyy] leaving only xxx's, // if bQuoteSymbol==true the xxx will become "xxx" - static String StripNewCurrencyDelimiters( const String& rStr, - bool bQuoteSymbol ); + static OUString StripNewCurrencyDelimiters( const OUString& rStr, + bool bQuoteSymbol ); // 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 diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx index 3b9f457de3a9..0af4be999fbd 100644 --- a/svl/source/numbers/zformat.cxx +++ b/svl/source/numbers/zformat.cxx @@ -1913,16 +1913,16 @@ rtl::OUString SvNumberformat::LoadString( SvStream& rStream ) void SvNumberformat::Save( SvStream& rStream, ImpSvNumMultipleWriteHeader& rHdr ) const { - String aFormatstring( sFormatstring ); - String aComment( sComment ); + OUString aFormatstring( sFormatstring ); + OUStringBuffer aComment( sComment.getLength() + sFormatstring.getLength() + 2 ); bool bNewCurrency = HasNewCurrency(); if ( bNewCurrency ) { // SV_NUMBERFORMATTER_VERSION_NEW_CURR im Kommentar speichern - aComment.Insert( cNewCurrencyMagic, 0 ); - aComment.Insert( cNewCurrencyMagic, 0 ); - aComment.Insert( aFormatstring, 1 ); + aComment.insert( 0, cNewCurrencyMagic ); + aComment.insert( 0, cNewCurrencyMagic ); + aComment.insert( 1, aFormatstring ); Build50Formatstring( aFormatstring ); // alten Formatstring generieren } @@ -1955,7 +1955,7 @@ void SvNumberformat::Save( SvStream& rStream, ImpSvNumMultipleWriteHeader& rHdr NumFor[i].Save(rStream); } // ab SV_NUMBERFORMATTER_VERSION_NEWSTANDARD - rStream.WriteUniOrByteString( aComment, rStream.GetStreamCharSet() ); + rStream.WriteUniOrByteString( aComment.makeStringAndClear(), rStream.GetStreamCharSet() ); rStream << nNewStandardDefined; // ab SV_NUMBERFORMATTER_VERSION_NEW_CURR rStream << nNewCurrencyVersionId; @@ -2006,8 +2006,8 @@ bool SvNumberformat::GetNewCurrencySymbol( OUString& rSymbol, } // static -String SvNumberformat::StripNewCurrencyDelimiters( const String& rStr, - bool bQuoteSymbol ) +OUString SvNumberformat::StripNewCurrencyDelimiters( const OUString& rStr, + bool bQuoteSymbol ) { OUString aTmp; OUString aSource(rStr); @@ -2075,7 +2075,7 @@ String SvNumberformat::StripNewCurrencyDelimiters( const String& rStr, return aTmp; } -void SvNumberformat::Build50Formatstring( String& rStr ) const +void SvNumberformat::Build50Formatstring( OUString& rStr ) const { rStr = StripNewCurrencyDelimiters( sFormatstring, true ); } |