diff options
-rw-r--r-- | sc/source/filter/excel/xestyle.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/viewfunc.cxx | 12 | ||||
-rw-r--r-- | svl/inc/svl/zformat.hxx | 9 | ||||
-rw-r--r-- | svl/source/numbers/zforlist.cxx | 20 | ||||
-rw-r--r-- | svl/source/numbers/zformat.cxx | 10 | ||||
-rw-r--r-- | sw/source/ui/utlui/numfmtlb.cxx | 10 |
6 files changed, 32 insertions, 31 deletions
diff --git a/sc/source/filter/excel/xestyle.cxx b/sc/source/filter/excel/xestyle.cxx index 772b36e581f8..655594ca8cfc 100644 --- a/sc/source/filter/excel/xestyle.cxx +++ b/sc/source/filter/excel/xestyle.cxx @@ -1329,7 +1329,7 @@ String GetNumberFormatCode(XclRoot& rRoot, const sal_uInt16 nScNumFmt, SvNumberF { // build Boolean number format Color* pColor = 0; - String aTemp; + OUString aTemp; const_cast< SvNumberformat* >( pEntry )->GetOutputString( 1.0, aTemp, &pColor ); aFormatStr.Append( '"' ).Append( aTemp ).AppendAscii( "\";\"" ).Append( aTemp ).AppendAscii( "\";\"" ); const_cast< SvNumberformat* >( pEntry )->GetOutputString( 0.0, aTemp, &pColor ); diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx index 22f6eccf4120..f695475ac17e 100644 --- a/sc/source/ui/view/viewfunc.cxx +++ b/sc/source/ui/view/viewfunc.cxx @@ -2686,20 +2686,20 @@ void ScViewFunc::ChangeNumFmtDecimals( sal_Bool bIncrement ) double nVal = pDoc->GetValue( ScAddress( nCol, nRow, nTab ) ); // the ways of the Numberformatters are unfathomable, so try: - String aOut; + OUString aOut; Color* pCol; ((SvNumberformat*)pOldEntry)->GetOutputString( nVal, aOut, &pCol ); nPrecision = 0; // 'E' for exponential is fixed in Numberformatter - if ( aOut.Search('E') != STRING_NOTFOUND ) + if ( aOut.indexOf((sal_Unicode)'E') >= 0 ) bError = sal_True; // exponential not changed else { - String aDecSep( pFormatter->GetFormatDecimalSep( nOldFormat ) ); - xub_StrLen nPos = aOut.Search( aDecSep ); - if ( nPos != STRING_NOTFOUND ) - nPrecision = aOut.Len() - nPos - aDecSep.Len(); + OUString aDecSep( pFormatter->GetFormatDecimalSep( nOldFormat ) ); + sal_Int32 nPos = aOut.indexOf( aDecSep ); + if ( nPos >= 0 ) + nPrecision = aOut.getLength() - nPos - aDecSep.getLength(); // else keep 0 } } diff --git a/svl/inc/svl/zformat.hxx b/svl/inc/svl/zformat.hxx index 8958663626fd..965c92d31b18 100644 --- a/svl/inc/svl/zformat.hxx +++ b/svl/inc/svl/zformat.hxx @@ -20,7 +20,6 @@ #define _ZFORMAT_HXX #include "svl/svldllapi.h" -#include <tools/string.hxx> #include <i18npool/mslangid.hxx> #include <svl/zforlist.hxx> #include <svl/nfversi.hxx> @@ -173,7 +172,7 @@ class SVL_DLLPUBLIC SvNumberformat sal_uInt8 mnCalendarType; LanguageType meLanguage; - ::rtl::OUString generateCode() const; + OUString generateCode() const; LocaleType(); LocaleType(sal_uInt32 nRawCode); @@ -239,7 +238,7 @@ public: // Load a string which might contain an Euro symbol, // in fact that could be any string used in number formats. - static rtl::OUString LoadString( SvStream& rStream ); + static OUString LoadString( SvStream& rStream ); /** * Get output string from a numeric value that fits the number of @@ -247,7 +246,7 @@ public: */ bool GetOutputString( double fNumber, sal_uInt16 nCharCount, OUString& rOutString ) const; - bool GetOutputString( double fNumber, String& OutString, Color** ppColor ); + bool GetOutputString( double fNumber, OUString& OutString, Color** ppColor ); bool GetOutputString( OUString& sString, OUString& OutString, Color** ppColor ); // True if type text @@ -282,7 +281,7 @@ public: // nPos == 0xFFFF => last substring // bString==true: first/last SYMBOLTYPE_STRING or SYMBOLTYPE_CURRENCY const OUString* GetNumForString( sal_uInt16 nNumFor, sal_uInt16 nPos, - bool bString = false ) const; + bool bString = false ) const; // Subtype of a subformat code nNumFor (0..3) // nPos == 0xFFFF => last substring diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx index 9496d9acb841..a1376e1111cc 100644 --- a/svl/source/numbers/zforlist.cxx +++ b/svl/source/numbers/zforlist.cxx @@ -1449,7 +1449,9 @@ void SvNumberFormatter::GetInputLineString(const double& fOutNumber, ChangeStandardPrec(INPUTSTRING_PRECISION); bPrecChanged = true; } - pFormat->GetOutputString(fOutNumber, sOutString, &pColor); + OUString sTemp(sOutString); + pFormat->GetOutputString(fOutNumber, sTemp, &pColor); + sOutString = sTemp; } if (bPrecChanged) ChangeStandardPrec(nOldPrec); @@ -1481,7 +1483,9 @@ void SvNumberFormatter::GetOutputString(const double& fOutNumber, ChangeIntl(pFormat->GetLanguage()); if ( bUseStarFormat ) pFormat->SetStarFormatSupport( true ); - pFormat->GetOutputString(fOutNumber, sOutString, ppColor); + OUString sTemp(sOutString); + pFormat->GetOutputString(fOutNumber, sTemp, ppColor); + sOutString = sTemp; if ( bUseStarFormat ) pFormat->SetStarFormatSupport( false ); } @@ -1532,13 +1536,11 @@ void SvNumberFormatter::GetOutputString(const double& fOutNumber, if (!pFormat) pFormat = GetFormatEntry(ZF_STANDARD); ChangeIntl(pFormat->GetLanguage()); - String aOutString; if ( bUseStarFormat ) pFormat->SetStarFormatSupport( true ); - pFormat->GetOutputString(fOutNumber, aOutString, ppColor); + pFormat->GetOutputString(fOutNumber, sOutString, ppColor); if ( bUseStarFormat ) pFormat->SetStarFormatSupport( false ); - sOutString = aOutString; } bool SvNumberFormatter::GetPreviewString(const String& sFormatString, @@ -1579,7 +1581,9 @@ bool SvNumberFormatter::GetPreviewString(const String& sFormatString, { p_Entry->SetStarFormatSupport( true ); } - p_Entry->GetOutputString(fPreviewNumber, sOutString, ppColor); + OUString sTemp(sOutString); + p_Entry->GetOutputString(fPreviewNumber, sTemp, ppColor); + sOutString = sTemp; if ( bUseStarFormat ) { p_Entry->SetStarFormatSupport( false ); @@ -1688,7 +1692,9 @@ bool SvNumberFormatter::GetPreviewStringGuess( const String& sFormatString, if (nCheckPos == 0) // String ok { ImpGenerateCL( eLnge ); // create new standard formats if necessary - pEntry->GetOutputString( fPreviewNumber, sOutString, ppColor ); + OUString sTemp(sOutString); + pEntry->GetOutputString( fPreviewNumber, sTemp, ppColor ); + sOutString = sTemp; delete pEntry; return true; } diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx index 15d98d0e7f64..3dc994adc5d8 100644 --- a/svl/source/numbers/zformat.cxx +++ b/svl/source/numbers/zformat.cxx @@ -49,8 +49,6 @@ #include <cmath> using namespace svt; -using ::rtl::OUString; -using ::rtl::OUStringBuffer; namespace { struct Gregorian : public rtl::StaticWithInit<const OUString, Gregorian> @@ -2393,12 +2391,12 @@ bool SvNumberformat::GetOutputString(double fNumber, sal_uInt16 nCharCount, OUSt } bool SvNumberformat::GetOutputString(double fNumber, - String& OutString, + OUString& OutString, Color** ppColor) { bool bRes = false; OUStringBuffer sBuff; - OutString.Erase(); + OutString = ""; *ppColor = NULL; // keine Farbaenderung if (eType & NUMBERFORMAT_LOGICAL) { @@ -2423,9 +2421,7 @@ bool SvNumberformat::GetOutputString(double fNumber, { if (rScan.GetStandardPrec() == SvNumberFormatter::INPUTSTRING_PRECISION) // alle Zahlformate InputLine { - OUString sTemp; - ImpGetOutputInputLine(fNumber, sTemp); - OutString = sTemp; + ImpGetOutputInputLine(fNumber, OutString); return false; } switch (eType) diff --git a/sw/source/ui/utlui/numfmtlb.cxx b/sw/source/ui/utlui/numfmtlb.cxx index a04a8a05ed90..5ed6985086a7 100644 --- a/sw/source/ui/utlui/numfmtlb.cxx +++ b/sw/source/ui/utlui/numfmtlb.cxx @@ -220,7 +220,7 @@ void NumFormatListBox::SetFormatType(const short nFormatType) sal_uLong nFormat; Color* pCol; double fVal = GetDefValue( nFormatType ); - String sValue; + OUString sValue; sal_uLong nSysNumFmt = pFormatter->GetFormatIndex( NF_NUMBER_SYSTEM, eCurLanguage ); @@ -239,13 +239,13 @@ void NumFormatListBox::SetFormatType(const short nFormatType) eCurLanguage ) || ((SvNumberformat*)pFmt)->GetOutputString( fVal, sValue, &pCol ) || nFormatType == NUMBERFORMAT_UNDEFINED ) - sValue = pFmt->GetFormatstring(); + { + sValue = pFmt->GetFormatstring(); + } else if( nFormatType == NUMBERFORMAT_TEXT ) { OUString sTxt("\"ABC\""); - OUString sTempOut(sValue); - pFormatter->GetOutputString( sTxt, nFormat, sTempOut, &pCol); - sValue = sTempOut; + pFormatter->GetOutputString( sTxt, nFormat, sValue, &pCol); } if (nFormat != nSysNumFmt && |