diff options
author | Matteo Casalin <matteo.casalin@yahoo.com> | 2015-01-07 15:46:57 +0100 |
---|---|---|
committer | Matteo Casalin <matteo.casalin@yahoo.com> | 2015-01-07 21:04:35 +0100 |
commit | c257db1401e2b356306aa38e528c37ccb1073cea (patch) | |
tree | 7b2d7e256b5872f55782eff2072f691cc158eb79 /sw | |
parent | 4931c9521d739e813a3cdea04e23e79cbff802cb (diff) |
sal_uInt16 to more proper types
Change-Id: I5e4d1edd78b4c39c4624f72de0541b46ed4ec9b2
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/calc.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/bastyp/calc.cxx | 17 |
2 files changed, 9 insertions, 10 deletions
diff --git a/sw/inc/calc.hxx b/sw/inc/calc.hxx index 007e5371810f..fbb4c6648c14 100644 --- a/sw/inc/calc.hxx +++ b/sw/inc/calc.hxx @@ -193,7 +193,7 @@ public: OUString GetStrResult( double, bool bRound = true ); SwCalcExp* VarInsert( const OUString& r ); - SwCalcExp* VarLook( const OUString &rStr, sal_uInt16 ins = 0 ); + SwCalcExp* VarLook( const OUString &rStr, bool bIns = false ); void VarChange( const OUString& rStr, const SwSbxValue& rValue ); void VarChange( const OUString& rStr, double ); SwHash** GetVarTable() { return VarTable; } diff --git a/sw/source/core/bastyp/calc.cxx b/sw/source/core/bastyp/calc.cxx index 10c7d453c4cd..ece708398578 100644 --- a/sw/source/core/bastyp/calc.cxx +++ b/sw/source/core/bastyp/calc.cxx @@ -196,7 +196,7 @@ SwHash* Find( const OUString& rStr, SwHash** ppTable, ii %= nTblSize; if( pPos ) - *pPos = (sal_uInt16)ii; + *pPos = static_cast<sal_uInt16>(ii); for( SwHash* pEntry = *(ppTable+ii); pEntry; pEntry = pEntry->pNext ) { @@ -430,11 +430,11 @@ OUString SwCalc::GetStrResult( double nValue, bool ) default : return RESOURCE->aCalc_Default; } - sal_uInt16 nDec = 15; + const sal_Int32 nDecPlaces = 15; OUString aRetStr( ::rtl::math::doubleToUString( nValue, rtl_math_StringFormat_Automatic, - nDec, + nDecPlaces, pLclData->getNumDecimalSep()[0], true )); return aRetStr; @@ -443,10 +443,10 @@ OUString SwCalc::GetStrResult( double nValue, bool ) SwCalcExp* SwCalc::VarInsert( const OUString &rStr ) { OUString aStr = pCharClass->lowercase( rStr ); - return VarLook( aStr, 1 ); + return VarLook( aStr, true ); } -SwCalcExp* SwCalc::VarLook( const OUString& rStr, sal_uInt16 ins ) +SwCalcExp* SwCalc::VarLook( const OUString& rStr, bool bIns ) { aErrExpr.nValue.SetVoidValue(false); @@ -515,7 +515,7 @@ SwCalcExp* SwCalc::VarLook( const OUString& rStr, sal_uInt16 ins ) // At this point the "real" case variable has to be used OUString const sTmpName( ::ReplacePoint(rStr) ); - if( !ins ) + if( !bIns ) { #if HAVE_FEATURE_DBCONNECTIVITY SwDBManager *pMgr = rDoc.GetDBManager(); @@ -1171,15 +1171,14 @@ SwSbxValue SwCalc::Term() return left; } fVal = left.GetDouble(); - sal_uInt16 i; if( nDec >= 0) { - for (i = 0; i < (sal_uInt16) nDec; ++i ) + for (sal_Int32 i = 0; i < nDec; ++i ) fFac *= 10.0; } else { - for (i = 0; i < (sal_uInt16) -nDec; ++i ) + for (sal_Int32 i = 0; i < -nDec; ++i ) fFac /= 10.0; } |