basic/source/sbx/sbxdate.cxx | 4 --- basic/source/sbx/sbxscan.cxx | 3 -- editeng/source/items/flditem.cxx | 2 - sc/qa/unit/ucalc.cxx | 4 +-- sc/source/core/data/table4.cxx | 8 +----- sc/source/core/data/validat.cxx | 4 --- sc/source/core/tool/cellform.cxx | 8 +++--- sc/source/filter/rtf/eeimpars.cxx | 4 --- sc/source/ui/formdlg/formula.cxx | 12 ++------- sc/source/ui/unoobj/chart2uno.cxx | 4 --- svl/source/numbers/numfmuno.cxx | 6 +--- svtools/source/control/fmtfield.cxx | 15 ++++------- svx/source/items/numfmtsh.cxx | 31 +++++------------------- sw/source/core/fields/fldbas.cxx | 4 +-- sw/source/core/table/swtable.cxx | 9 ++---- sw/source/core/text/EnhancedPDFExportHelper.cxx | 5 --- sw/source/ui/utlui/numfmtlb.cxx | 8 +++--- 17 files changed, 42 insertions(+), 89 deletions(-)
New commits: commit 83aa6d8180f289e5ae4034560dbd95ab160b1ac2 Author: Matteo Casalin <matteo.casa...@yahoo.com> Date: Mon Feb 24 09:05:50 2014 +0100 Remove some temporaries around calls to SvNumberFormatter methods Change-Id: Ib03c97a52df120bac1ac9b2b9d2e52431ead1027 diff --git a/basic/source/sbx/sbxdate.cxx b/basic/source/sbx/sbxdate.cxx index 65d4940..0ed08e7 100644 --- a/basic/source/sbx/sbxdate.cxx +++ b/basic/source/sbx/sbxdate.cxx @@ -313,9 +313,7 @@ start: nIndex, LANGUAGE_GERMAN, eLangType ); - OUString aTmpString; - pFormatter->GetOutputString( n, nIndex, aTmpString, &pColor ); - *p->pOUString = aTmpString; + pFormatter->GetOutputString( n, nIndex, *p->pOUString, &pColor ); delete pFormatter; break; } diff --git a/basic/source/sbx/sbxscan.cxx b/basic/source/sbx/sbxscan.cxx index c3b52f0..7ec18a7 100644 --- a/basic/source/sbx/sbxscan.cxx +++ b/basic/source/sbx/sbxscan.cxx @@ -799,8 +799,7 @@ void SbxValue::Format( OUString& rRes, const OUString* pFmt ) const aFormatter.PutandConvertEntry( aFmtStr, nCheckPos, nType, nIndex, LANGUAGE_ENGLISH, eLangType ); OUString aTime; aFormatter.GetOutputString( nNumber, nIndex, aTime, &pCol ); - rRes += " "; - rRes += aTime; + rRes += " " + aTime; } } else diff --git a/editeng/source/items/flditem.cxx b/editeng/source/items/flditem.cxx index 99f0575..03fc0da 100644 --- a/editeng/source/items/flditem.cxx +++ b/editeng/source/items/flditem.cxx @@ -502,7 +502,7 @@ OUString SvxDateField::GetFormatted( Date& aDate, SvxDateFormat eFormat, SvNumbe double fDiffDate = aDate - *(rFormatter.GetNullDate()); OUString aStr; - Color* pColor = NULL; + Color* pColor = NULL; rFormatter.GetOutputString( fDiffDate, nFormatKey, aStr, &pColor ); return aStr; } diff --git a/sc/source/core/data/table4.cxx b/sc/source/core/data/table4.cxx index d37620a..e44d3f2 100644 --- a/sc/source/core/data/table4.cxx +++ b/sc/source/core/data/table4.cxx @@ -911,9 +911,7 @@ OUString ScTable::GetAutoFillPreview( const ScRange& rSource, SCCOL nEndX, SCROW Color* pColor; sal_uLong nNumFmt = GetNumberFormat( nSrcX, nSrcY ); - OUString sTmp(aValue); - pDocument->GetFormatTable()->GetOutputString( nVal, nNumFmt, sTmp, &pColor ); - aValue = sTmp; + pDocument->GetFormatTable()->GetOutputString( nVal, nNumFmt, aValue, &pColor ); } break; // not for formulas @@ -997,9 +995,7 @@ OUString ScTable::GetAutoFillPreview( const ScRange& rSource, SCCOL nEndX, SCROW //! Zahlformat je nach Index holen? Color* pColor; sal_uLong nNumFmt = GetNumberFormat( nCol1, nRow1 ); - OUString sTmp(aValue); - pDocument->GetFormatTable()->GetOutputString( nStart, nNumFmt, sTmp, &pColor ); - aValue = sTmp; + pDocument->GetFormatTable()->GetOutputString( nStart, nNumFmt, aValue, &pColor ); } } } diff --git a/sc/source/core/data/validat.cxx b/sc/source/core/data/validat.cxx index 67de694e..5e684d2 100644 --- a/sc/source/core/data/validat.cxx +++ b/sc/source/core/data/validat.cxx @@ -764,9 +764,7 @@ bool ScValidationData::GetSelectionFromFormula( } else { - OUString sTmp(aValStr); - pFormatter->GetInputLineString( nMatVal.fVal, 0, sTmp ); - aValStr = sTmp; + pFormatter->GetInputLineString( nMatVal.fVal, 0, aValStr ); } } diff --git a/sc/source/core/tool/cellform.cxx b/sc/source/core/tool/cellform.cxx index 6a23ba2..7e9b2dc 100644 --- a/sc/source/core/tool/cellform.cxx +++ b/sc/source/core/tool/cellform.cxx @@ -118,8 +118,8 @@ void ScCellFormat::GetString( ScRefCellValue& rCell, sal_uLong nFormat, OUString } else { - OUString aCellString = pFCell->GetString().getString(); - rFormatter.GetOutputString( aCellString, nFormat, rString, ppColor, bUseStarFormat ); + rFormatter.GetOutputString( pFCell->GetString().getString(), + nFormat, rString, ppColor, bUseStarFormat ); } } } @@ -212,8 +212,8 @@ OUString ScCellFormat::GetString( } else { - OUString aCellString = pFCell->GetString().getString(); - rFormatter.GetOutputString(aCellString, nFormat, aString, ppColor, bUseStarFormat); + rFormatter.GetOutputString(pFCell->GetString().getString(), + nFormat, aString, ppColor, bUseStarFormat); } } } diff --git a/sc/source/filter/rtf/eeimpars.cxx b/sc/source/filter/rtf/eeimpars.cxx index 20595e6..199772b 100644 --- a/sc/source/filter/rtf/eeimpars.cxx +++ b/sc/source/filter/rtf/eeimpars.cxx @@ -372,9 +372,7 @@ void ScEEImport::WriteToDocument( bool bSizeColsRows, double nOutputFactor, SvNu pFormatter->GetFormatForLanguageIfBuiltIn( nIndex, LANGUAGE_SYSTEM); OSL_ENSURE( nNewIndex != nIndex, "ScEEImport::WriteToDocument: NumbersEnglishUS not a built-in format?"); - OUString sTemp(aStr); - pFormatter->GetInputLineString( fEnVal, nNewIndex, sTemp); - aStr = sTemp; + pFormatter->GetInputLineString( fEnVal, nNewIndex, aStr); } else bTextFormat = true; diff --git a/sc/source/ui/formdlg/formula.cxx b/sc/source/ui/formdlg/formula.cxx index 38b9f5b..fda461c 100644 --- a/sc/source/ui/formdlg/formula.cxx +++ b/sc/source/ui/formdlg/formula.cxx @@ -341,23 +341,17 @@ bool ScFormulaDlg::calculateValue( const OUString& rStrExp, OUString& rStrResult if ( pFCell->IsValue() ) { double n = pFCell->GetValue(); - OUString sTempOut(rStrResult); sal_uLong nFormat = aFormatter.GetStandardFormat( n, 0, pFCell->GetFormatType(), ScGlobal::eLnge ); - aFormatter.GetOutputString( n, nFormat, - sTempOut, &pColor ); - rStrResult = sTempOut; + rStrResult, &pColor ); } else { - OUString aStr = pFCell->GetString().getString(); - OUString sTempOut(rStrResult); sal_uLong nFormat = aFormatter.GetStandardFormat( pFCell->GetFormatType(), ScGlobal::eLnge); - aFormatter.GetOutputString( aStr, nFormat, - sTempOut, &pColor ); - rStrResult = sTempOut; + aFormatter.GetOutputString( pFCell->GetString().getString(), nFormat, + rStrResult, &pColor ); } ScRange aTestRange; diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx index 795cfdf..009b860 100644 --- a/sc/source/ui/unoobj/chart2uno.cxx +++ b/sc/source/ui/unoobj/chart2uno.cxx @@ -2731,7 +2731,6 @@ sal_Int32 ScChart2DataSequence::FillCacheFromExternalRef(const ScTokenRef& pToke SvNumberFormatter* pFormatter = m_pDocument->GetFormatTable(); if (pFormatter) { - OUString aStr; const double fVal = rItem.mfValue; Color* pColor = NULL; sal_uInt32 nFmt = 0; @@ -2742,8 +2741,7 @@ sal_Int32 ScChart2DataSequence::FillCacheFromExternalRef(const ScTokenRef& pToke SCROW nRow = aRange.aStart.Row() + static_cast<SCROW>(nR); pTable->getCell(nCol, nRow, &nFmt); } - pFormatter->GetOutputString(fVal, nFmt, aStr, &pColor); - rItem.maString = aStr; + pFormatter->GetOutputString(fVal, nFmt, rItem.maString, &pColor); } } else if (pMat->IsString(nC, nR)) diff --git a/svl/source/numbers/numfmuno.cxx b/svl/source/numbers/numfmuno.cxx index 3b36695..066ae28 100644 --- a/svl/source/numbers/numfmuno.cxx +++ b/svl/source/numbers/numfmuno.cxx @@ -243,9 +243,8 @@ OUString SAL_CALL SvNumberFormatterServiceObj::formatString( sal_Int32 nKey, SvNumberFormatter* pFormatter = xSupplier.is() ? xSupplier->GetNumberFormatter() : NULL; if (pFormatter) { - OUString aTemp = aString; Color* pColor = NULL; - pFormatter->GetOutputString(aTemp, nKey, aRet, &pColor); + pFormatter->GetOutputString(aString, nKey, aRet, &pColor); } else { @@ -265,10 +264,9 @@ util::Color SAL_CALL SvNumberFormatterServiceObj::queryColorForString( sal_Int32 SvNumberFormatter* pFormatter = xSupplier.is() ? xSupplier->GetNumberFormatter() : NULL; if (pFormatter) { - OUString aTemp = aString; OUString aStr; Color* pColor = NULL; - pFormatter->GetOutputString(aTemp, nKey, aStr, &pColor); + pFormatter->GetOutputString(aString, nKey, aStr, &pColor); if (pColor) { nRet = pColor->GetColor(); diff --git a/svtools/source/control/fmtfield.cxx b/svtools/source/control/fmtfield.cxx index b422d0c..67049c8 100644 --- a/svtools/source/control/fmtfield.cxx +++ b/svtools/source/control/fmtfield.cxx @@ -382,11 +382,10 @@ void FormattedField::SetTextFormatted(const OUString& rStr) } else { - OUString sTempIn(m_sCurrentTextValue); - OUString sTempOut(sFormatted); - ImplGetFormatter()->GetOutputString(sTempIn, m_nFormatKey, sTempOut, &m_pLastOutputColor); - m_sCurrentTextValue = sTempIn; - sFormatted = sTempOut; + ImplGetFormatter()->GetOutputString(m_sCurrentTextValue, + m_nFormatKey, + sFormatted, + &m_pLastOutputColor); } // calculate the new selection @@ -913,10 +912,8 @@ void FormattedField::ImplSetValue(double dVal, sal_Bool bForce) // first convert the number as string in standard format OUString sTemp; ImplGetFormatter()->GetOutputString(dVal, 0, sTemp, &m_pLastOutputColor); - // than encode the string in the corresponding text format - { - ImplGetFormatter()->GetOutputString(sTemp, m_nFormatKey, sNewText, &m_pLastOutputColor); - } + // then encode the string in the corresponding text format + ImplGetFormatter()->GetOutputString(sTemp, m_nFormatKey, sNewText, &m_pLastOutputColor); } else { diff --git a/svx/source/items/numfmtsh.cxx b/svx/source/items/numfmtsh.cxx index 7fbaae3..402f03f 100644 --- a/svx/source/items/numfmtsh.cxx +++ b/svx/source/items/numfmtsh.cxx @@ -429,11 +429,8 @@ void SvxNumberFormatShell::MakePreviewString( const OUString& rFormatStr, if ( nExistingFormat == NUMBERFORMAT_ENTRY_NOT_FOUND ) { // real preview - not implemented in NumberFormatter for text formats - OUString sTempOut(rPreviewStr); - - pFormatter->GetPreviewString( rFormatStr, nValNum, sTempOut, + pFormatter->GetPreviewString( rFormatStr, nValNum, rPreviewStr, &rpFontColor, eCurLanguage, bUseStarFormat ); - rPreviewStr = sTempOut; } else { @@ -444,19 +441,13 @@ void SvxNumberFormatShell::MakePreviewString( const OUString& rFormatStr, ( !aValStr.isEmpty() && ( pFormatter->GetType(nExistingFormat) & NUMBERFORMAT_TEXT ) ) ); if ( bUseText ) { - OUString sTempIn(aValStr); - OUString sTempOut(rPreviewStr); - pFormatter->GetOutputString( sTempIn, nExistingFormat, - sTempOut, &rpFontColor ); - aValStr = sTempIn; - rPreviewStr = sTempOut; + pFormatter->GetOutputString( aValStr, nExistingFormat, + rPreviewStr, &rpFontColor ); } else { - OUString sTemp(rPreviewStr); pFormatter->GetOutputString( nValNum, nExistingFormat, - sTemp, &rpFontColor, bUseStarFormat ); - rPreviewStr = sTemp; + rPreviewStr, &rpFontColor, bUseStarFormat ); } } } @@ -1134,17 +1125,11 @@ void SvxNumberFormatShell::GetPreviewString_Impl( OUString& rString, Color*& rpC if ( bUseText ) { - OUString sTempIn(aValStr); - OUString sTempOut(rString); - pFormatter->GetOutputString( sTempIn, nCurFormatKey, sTempOut, &rpColor ); - aValStr = sTempIn; - rString = sTempOut; + pFormatter->GetOutputString( aValStr, nCurFormatKey, rString, &rpColor ); } else { - OUString sTemp(rString); - pFormatter->GetOutputString( nValNum, nCurFormatKey, sTemp, &rpColor, bUseStarFormat ); - rString = sTemp; + pFormatter->GetOutputString( nValNum, nCurFormatKey, rString, &rpColor, bUseStarFormat ); } } @@ -1246,9 +1231,7 @@ void SvxNumberFormatShell::MakePrevStringFromVal( double nValue) { rpFontColor = NULL; - OUString sTempOut(rPreviewStr); - pFormatter->GetPreviewString( rFormatStr, nValue, sTempOut, &rpFontColor, eCurLanguage ); - rPreviewStr = sTempOut; + pFormatter->GetPreviewString( rFormatStr, nValue, rPreviewStr, &rpFontColor, eCurLanguage ); } /************************************************************************* diff --git a/sw/source/core/fields/fldbas.cxx b/sw/source/core/fields/fldbas.cxx index 553b1ec..1931d82 100644 --- a/sw/source/core/fields/fldbas.cxx +++ b/sw/source/core/fields/fldbas.cxx @@ -478,8 +478,8 @@ OUString SwValueFieldType::ExpandValue( const double& rVal, if( pFormatter->IsTextFormat( nFmt ) ) { - OUString sTempIn(DoubleToString(rVal, nFmtLng)); - pFormatter->GetOutputString(sTempIn, nFmt, sExpand, &pCol); + pFormatter->GetOutputString(DoubleToString(rVal, nFmtLng), nFmt, + sExpand, &pCol); } else { diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx index 25ed11e..11c3161 100644 --- a/sw/source/core/table/swtable.cxx +++ b/sw/source/core/table/swtable.cxx @@ -2142,12 +2142,9 @@ void ChgNumToText( SwTableBox& rBox, sal_uLong nFmt ) if( NUMBERFORMAT_TEXT != nFmt ) { // special text format: - OUString sTmp, sTxt( pTNd->GetTxt() ); - OUString sTempIn(sTxt); - OUString sTempOut; - pDoc->GetNumberFormatter()->GetOutputString( sTempIn, nFmt, sTempOut, &pCol ); - sTxt = sTempIn; - sTmp = sTempOut; + OUString sTmp; + const OUString sTxt( pTNd->GetTxt() ); + pDoc->GetNumberFormatter()->GetOutputString( sTxt, nFmt, sTmp, &pCol ); if( sTxt != sTmp ) { // exchange text diff --git a/sw/source/core/text/EnhancedPDFExportHelper.cxx b/sw/source/core/text/EnhancedPDFExportHelper.cxx index 42ebd32..3460d33 100644 --- a/sw/source/core/text/EnhancedPDFExportHelper.cxx +++ b/sw/source/core/text/EnhancedPDFExportHelper.cxx @@ -1634,10 +1634,7 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport() pNumFormatter->GetOutputString( aDateDiff.GetDate(), nFormat, sDate, &pColor ); // The title should consist of the author and the date: - OUString sTitle( pField->GetPar1() ); - sTitle += ", "; - sTitle += sDate; - aNote.Title = sTitle; + aNote.Title = pField->GetPar1() + ", " + sDate; // Guess what the contents contains... aNote.Contents = pField->GetTxt(); diff --git a/sw/source/ui/utlui/numfmtlb.cxx b/sw/source/ui/utlui/numfmtlb.cxx index 6ec8700..9942762 100644 --- a/sw/source/ui/utlui/numfmtlb.cxx +++ b/sw/source/ui/utlui/numfmtlb.cxx @@ -234,8 +234,7 @@ void NumFormatListBox::SetFormatType(const short nFormatType) } else if( nFormatType == NUMBERFORMAT_TEXT ) { - OUString sTxt("\"ABC\""); - pFormatter->GetOutputString( sTxt, nFormat, sValue, &pCol); + pFormatter->GetOutputString( "\"ABC\"", nFormat, sValue, &pCol); } if (nFormat != nSysNumFmt && @@ -309,11 +308,12 @@ void NumFormatListBox::SetDefFormat(const sal_uLong nDefFmt) if (nType == NUMBERFORMAT_TEXT) { - OUString sTxt("\"ABC\""); - pFormatter->GetOutputString(sTxt, nDefFmt, sValue, &pCol); + pFormatter->GetOutputString("\"ABC\"", nDefFmt, sValue, &pCol); } else + { pFormatter->GetOutputString(fValue, nDefFmt, sValue, &pCol); + } sal_uInt16 nPos = 0; while ((sal_uLong)GetEntryData(nPos) == ULONG_MAX) commit c1e06b7a91e0a2f2ddcf9d669bccb0eb488dc4f8 Author: Matteo Casalin <matteo.casa...@yahoo.com> Date: Sun Feb 23 11:22:01 2014 +0100 Fix -Werror=shadow Change-Id: I30312e039c98007d6f379c3ee9b1500ddfbfc39d diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index 2afd4f8..58c2128 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -3389,11 +3389,11 @@ void Test::testCopyPasteSkipEmpty() bool mbHasNote; }; - struct Test + struct TestRange { ScDocument* mpDoc; - Test( ScDocument* pDoc ) : mpDoc(pDoc) {} + TestRange( ScDocument* pDoc ) : mpDoc(pDoc) {} bool checkRange( const ScAddress& rPos, const Check* p, const Check* pEnd ) { _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits