diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-04-06 08:59:07 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-04-06 07:47:30 +0000 |
commit | 7662e92c64ec194a2089f633a363d9dc45a4aa9d (patch) | |
tree | 1086154f31c0c9c6386b44ab83bd382f5308df8c /sc | |
parent | 823a8f3117a8be1de92168226f561ed804db3e93 (diff) |
loplugin:redundantcast find cstyle double casts
Change-Id: I5507be190dac781e5cdb545a60acf3d50056c9f8
Reviewed-on: https://gerrit.libreoffice.org/36187
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/tool/docoptio.cxx | 2 | ||||
-rw-r--r-- | sc/source/core/tool/interpr2.cxx | 14 | ||||
-rw-r--r-- | sc/source/core/tool/interpr3.cxx | 2 | ||||
-rw-r--r-- | sc/source/filter/excel/excform.cxx | 2 | ||||
-rw-r--r-- | sc/source/filter/excel/impop.cxx | 3 | ||||
-rw-r--r-- | sc/source/filter/excel/xestream.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/unoobj/funcuno.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/unoobj/optuno.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/vba/vbarange.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/drawutil.cxx | 4 |
10 files changed, 17 insertions, 18 deletions
diff --git a/sc/source/core/tool/docoptio.cxx b/sc/source/core/tool/docoptio.cxx index cbc6172d6231..2a1b23a09b3d 100644 --- a/sc/source/core/tool/docoptio.cxx +++ b/sc/source/core/tool/docoptio.cxx @@ -339,7 +339,7 @@ IMPL_LINK_NOARG(ScDocCfg, CalcCommitHdl, ScLinkConfigItem&, void) pValues[nProp] <<= (sal_Int32) GetIterCount(); break; case SCCALCOPT_ITER_MINCHG: - pValues[nProp] <<= (double) GetIterEps(); + pValues[nProp] <<= GetIterEps(); break; case SCCALCOPT_DATE_DAY: pValues[nProp] <<= (sal_Int32) nDateDay; diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx index 381bb07e9395..3d517987f6f9 100644 --- a/sc/source/core/tool/interpr2.cxx +++ b/sc/source/core/tool/interpr2.cxx @@ -767,7 +767,7 @@ void ScInterpreter::ScGetDiffDate360() else aDate2.SetDay(30); } - PushDouble( fSign * (double) + PushDouble( fSign * ( (double) aDate2.GetDay() + (double) aDate2.GetMonth() * 30.0 + (double) aDate2.GetYear() * 360.0 - (double) aDate1.GetDay() - (double) aDate1.GetMonth() * 30.0 @@ -1310,7 +1310,7 @@ void ScInterpreter::ScNPV() { case svDouble : { - nVal += (GetDouble() / pow(1.0 + nInterest, (double)nCount)); + nVal += (GetDouble() / pow(1.0 + nInterest, nCount)); nCount++; } break; @@ -1322,7 +1322,7 @@ void ScInterpreter::ScNPV() if (!aCell.hasEmptyValue() && aCell.hasNumeric()) { double nCellVal = GetCellValue(aAdr, aCell); - nVal += (nCellVal / pow(1.0 + nInterest, (double)nCount)); + nVal += (nCellVal / pow(1.0 + nInterest, nCount)); nCount++; } } @@ -1336,7 +1336,7 @@ void ScInterpreter::ScNPV() ScHorizontalValueIterator aValIter( pDok, aRange ); while ((nErr == FormulaError::NONE) && aValIter.GetNext(nCellVal, nErr)) { - nVal += (nCellVal / pow(1.0 + nInterest, (double)nCount)); + nVal += (nCellVal / pow(1.0 + nInterest, nCount)); nCount++; } if ( nErr != FormulaError::NONE ) @@ -1428,13 +1428,13 @@ void ScInterpreter::ScIRR() if (aValIter.GetFirst(fValue, nErr)) { double nCount = 0.0; - fNom += fValue / pow(1.0+x,(double)nCount); + fNom += fValue / pow(1.0+x,nCount); fDenom += -nCount * fValue / pow(1.0+x,nCount+1.0); nCount++; while ((nErr == FormulaError::NONE) && aValIter.GetNext(fValue, nErr)) { - fNom += fValue / pow(1.0+x,(double)nCount); - fDenom += -nCount * fValue / pow(1.0+x,nCount+1.0); + fNom += fValue / pow(1.0+x,nCount); + fDenom += -nCount * fValue / pow(1.0+x,nCount+1.0); nCount++; } SetError(nErr); diff --git a/sc/source/core/tool/interpr3.cxx b/sc/source/core/tool/interpr3.cxx index 959023e5466a..aa4b94899f10 100644 --- a/sc/source/core/tool/interpr3.cxx +++ b/sc/source/core/tool/interpr3.cxx @@ -2992,7 +2992,7 @@ void ScInterpreter::ScHarMean() } } if (nGlobalError == FormulaError::NONE) - PushDouble((double)nValCount/nVal); + PushDouble( nValCount / nVal ); else PushError( nGlobalError); } diff --git a/sc/source/filter/excel/excform.cxx b/sc/source/filter/excel/excform.cxx index fefac2e70c6e..3ae86c0c4d58 100644 --- a/sc/source/filter/excel/excform.cxx +++ b/sc/source/filter/excel/excform.cxx @@ -1601,7 +1601,7 @@ void ExcelToSc::DoMulArgs( DefTokenId eId, sal_uInt8 nAnz ) if( aPool.IsSingleOp( eParam[ nLauf ], ocMissing ) ) { if( !nNullParam ) - nNullParam = (sal_uInt16) aPool.Store( ( double ) 0.0 ); + nNullParam = (sal_uInt16) aPool.Store( 0.0 ); eParam[ nLauf ] = nNullParam; } } diff --git a/sc/source/filter/excel/impop.cxx b/sc/source/filter/excel/impop.cxx index ba26604d3568..ee9e04ac8bb2 100644 --- a/sc/source/filter/excel/impop.cxx +++ b/sc/source/filter/excel/impop.cxx @@ -86,8 +86,7 @@ using namespace ::com::sun::star; -const double ImportExcel::fExcToTwips = - ( double ) TWIPS_PER_CHAR / 256.0; +const double ImportExcel::fExcToTwips = TWIPS_PER_CHAR / 256.0; ImportTyp::ImportTyp( ScDocument* pDoc, rtl_TextEncoding eQ ) { diff --git a/sc/source/filter/excel/xestream.cxx b/sc/source/filter/excel/xestream.cxx index d8a0f18d9b80..75951cd6d4ae 100644 --- a/sc/source/filter/excel/xestream.cxx +++ b/sc/source/filter/excel/xestream.cxx @@ -910,7 +910,7 @@ sax_fastparser::FSHelperPtr XclXmlUtils::WriteFontData( sax_fastparser::FSHelper lcl_WriteValue( pStream, XML_shadow, rFontData.mbShadow ? XclXmlUtils::ToPsz( rFontData.mbShadow ) : nullptr ); lcl_WriteValue( pStream, XML_u, bHaveUnderline ? pUnderline : nullptr ); lcl_WriteValue( pStream, XML_vertAlign, bHaveVertAlign ? pVertAlign : nullptr ); - lcl_WriteValue( pStream, XML_sz, OString::number( (double) (rFontData.mnHeight / 20.0) ).getStr() ); // Twips->Pt + lcl_WriteValue( pStream, XML_sz, OString::number( rFontData.mnHeight / 20.0 ).getStr() ); // Twips->Pt if( rFontData.maColor != Color( 0xFF, 0xFF, 0xFF, 0xFF ) ) pStream->singleElement( XML_color, // OOXTODO: XML_auto, bool diff --git a/sc/source/ui/unoobj/funcuno.cxx b/sc/source/ui/unoobj/funcuno.cxx index 2309993d6f57..d2d0d6dc1961 100644 --- a/sc/source/ui/unoobj/funcuno.cxx +++ b/sc/source/ui/unoobj/funcuno.cxx @@ -609,7 +609,7 @@ uno::Any SAL_CALL ScFunctionAccess::callFunction( const OUString& aName, else if ( pFormula->IsValue() ) { // numeric value - aRet <<= (double) pFormula->GetValue(); + aRet <<= pFormula->GetValue(); } else { diff --git a/sc/source/ui/unoobj/optuno.cxx b/sc/source/ui/unoobj/optuno.cxx index 0731ef75cb06..0c66d0772c07 100644 --- a/sc/source/ui/unoobj/optuno.cxx +++ b/sc/source/ui/unoobj/optuno.cxx @@ -152,7 +152,7 @@ uno::Any ScDocOptionsHelper::getPropertyValue( aRet <<= (sal_Int32)( rOptions.GetIterCount() ); break; case PROP_UNO_ITEREPSILON: - aRet <<= (double)( rOptions.GetIterEps() ); + aRet <<= rOptions.GetIterEps(); break; case PROP_UNO_LOOKUPLABELS: aRet <<= rOptions.IsLookUpColRowNames(); diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx index 83cffc745268..8339a5ea538e 100644 --- a/sc/source/ui/vba/vbarange.cxx +++ b/sc/source/ui/vba/vbarange.cxx @@ -191,7 +191,7 @@ const double fExtraWidth = 182.0 / 256.0; // * 1 point = 1/72 inch = 20 twips // * 1 inch = 72 points = 1440 twips // * 1 cm = 567 twips -static double lcl_hmmToPoints( double nVal ) { return ( (double)((nVal /1000 ) * 567 ) / 20 ); } +static double lcl_hmmToPoints( double nVal ) { return nVal / 1000 * 567 / 20; } static const sal_Int16 supportedIndexTable[] = { excel::XlBordersIndex::xlEdgeLeft, excel::XlBordersIndex::xlEdgeTop, excel::XlBordersIndex::xlEdgeBottom, excel::XlBordersIndex::xlEdgeRight, excel::XlBordersIndex::xlDiagonalDown, excel::XlBordersIndex::xlDiagonalUp, excel::XlBordersIndex::xlInsideVertical, excel::XlBordersIndex::xlInsideHorizontal }; diff --git a/sc/source/ui/view/drawutil.cxx b/sc/source/ui/view/drawutil.cxx index 5f5c969c27ce..c25292e7c3ef 100644 --- a/sc/source/ui/view/drawutil.cxx +++ b/sc/source/ui/view/drawutil.cxx @@ -66,7 +66,7 @@ void ScDrawUtil::CalcScale( ScDocument* pDoc, SCTAB nTab, rScaleX = Fraction( ((double)aPixelLog.X()) * ((double)rZoomX.GetNumerator()) / ((double)nTwipsX) / - ((double)HMM_PER_TWIPS) / + HMM_PER_TWIPS / ((double)rZoomX.GetDenominator()) ); else rScaleX = Fraction( 1, 1 ); @@ -75,7 +75,7 @@ void ScDrawUtil::CalcScale( ScDocument* pDoc, SCTAB nTab, rScaleY = Fraction( ((double)aPixelLog.Y()) * ((double)rZoomY.GetNumerator()) / ((double)nTwipsY) / - ((double)HMM_PER_TWIPS) / + HMM_PER_TWIPS / ((double)rZoomY.GetDenominator()) ); else rScaleY = Fraction( 1, 1 ); |