diff options
author | Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> | 2011-05-16 22:09:46 +0200 |
---|---|---|
committer | Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> | 2011-05-16 22:09:46 +0200 |
commit | dca0391318ca9a88ef89ce89da7588732a47f43b (patch) | |
tree | 40d7d1874ea8128434bf2c674ed8663503bd4a50 /sc | |
parent | 080f1432c76bc235aa9d084b6a3b69711ab07dd6 (diff) |
WaE - add explicit casting (decimal-types → integer types)
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/data/drwlayer.cxx | 8 | ||||
-rw-r--r-- | sc/source/filter/excel/xeescher.cxx | 8 | ||||
-rw-r--r-- | sc/source/ui/dbgui/fieldwnd.cxx | 10 | ||||
-rw-r--r-- | sc/source/ui/vba/vbasheetobjects.cxx | 4 |
4 files changed, 15 insertions, 15 deletions
diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx index 7524f25627d0..e170dba9aace 100644 --- a/sc/source/core/data/drwlayer.cxx +++ b/sc/source/core/data/drwlayer.cxx @@ -552,8 +552,8 @@ namespace Point lcl_calcAvailableDiff(ScDocument &rDoc, SCCOL nCol, SCROW nRow, SCTAB nTab, const Point &aWantedDiff) { Point aAvailableDiff(aWantedDiff); - long nHeight = rDoc.GetRowHeight( nRow, nTab ) * HMM_PER_TWIPS; - long nWidth = rDoc.GetColWidth( nCol, nTab ) * HMM_PER_TWIPS; + long nHeight = static_cast<long>(rDoc.GetRowHeight( nRow, nTab ) * HMM_PER_TWIPS); + long nWidth = static_cast<long>(rDoc.GetColWidth( nCol, nTab ) * HMM_PER_TWIPS); if (aAvailableDiff.Y() > nHeight) aAvailableDiff.Y() = nHeight; if (aAvailableDiff.X() > nWidth) @@ -565,8 +565,8 @@ namespace { rCalcPoly.setB2DPoint(nWhichPoint, basegfx::B2DPoint(rPos.X(), rPos.Y())); basegfx::B2DRange aRange(basegfx::tools::getRange(rCalcPoly)); - return Rectangle(aRange.getMinX(), aRange.getMinY(), - aRange.getMaxX(), aRange.getMaxY()); + return Rectangle(static_cast<long>(aRange.getMinX()), static_cast<long>(aRange.getMinY()), + static_cast<long>(aRange.getMaxX()), static_cast<long>(aRange.getMaxY())); } } diff --git a/sc/source/filter/excel/xeescher.cxx b/sc/source/filter/excel/xeescher.cxx index b80d4c90acad..e0faf0ea0c93 100644 --- a/sc/source/filter/excel/xeescher.cxx +++ b/sc/source/filter/excel/xeescher.cxx @@ -196,8 +196,8 @@ static void lcl_GetFromTo( const XclExpRoot& rRoot, const Rectangle &aRect, sal_ } if( r.Left() > aRect.Left() && r.Top() > aRect.Top() ) { - aFrom = Rectangle( nCol-1, HMM2XL( nColOff ), - nRow-1, HMM2XL( nRowOff ) ); + aFrom = Rectangle( nCol-1, static_cast<long>(HMM2XL( nColOff )), + nRow-1, static_cast<long>(HMM2XL( nRowOff )) ); bTo=true; } } @@ -209,8 +209,8 @@ static void lcl_GetFromTo( const XclExpRoot& rRoot, const Rectangle &aRect, sal_ nRow++; if( r.Right() >= aRect.Right() && r.Bottom() >= aRect.Bottom() ) { - aTo = Rectangle( nCol, HMM2XL( aRect.Right() - r.Left() ), - nRow, HMM2XL( aRect.Bottom() - r.Top() )); + aTo = Rectangle( nCol, static_cast<long>(HMM2XL( aRect.Right() - r.Left() )), + nRow, static_cast<long>(HMM2XL( aRect.Bottom() - r.Top() ))); break; } } diff --git a/sc/source/ui/dbgui/fieldwnd.cxx b/sc/source/ui/dbgui/fieldwnd.cxx index 061900ce5e4d..412d10ceebb8 100644 --- a/sc/source/ui/dbgui/fieldwnd.cxx +++ b/sc/source/ui/dbgui/fieldwnd.cxx @@ -846,8 +846,8 @@ size_t ScDPHorFieldControl::CalcNewFieldIndex(SCsCOL nDX, SCsROW nDY) const size_t nFldCount = GetFieldCount(); SCsROW nRow = nSel % mnFieldBtnRowCount; SCsCOL nCol = nSel / mnFieldBtnRowCount; - SCsCOL nColUpper = ceil( - static_cast<double>(nFldCount) / static_cast<double>(mnFieldBtnRowCount)) - 1; + SCsCOL nColUpper = static_cast<SCsCOL>(ceil( + static_cast<double>(nFldCount) / static_cast<double>(mnFieldBtnRowCount)) - 1); SCsROW nRowUpper = mnFieldBtnRowCount - 1; nCol += nDX; @@ -912,8 +912,8 @@ void ScDPHorFieldControl::ScrollToShowSelection() void ScDPHorFieldControl::ResetScrollBar() { long nOldMax = maScroll.GetRangeMax(); - long nNewMax = ceil( - static_cast<double>(GetFieldCount()) / static_cast<double>(mnFieldBtnRowCount)); + long nNewMax = static_cast<long>(ceil( + static_cast<double>(GetFieldCount()) / static_cast<double>(mnFieldBtnRowCount))); if (nOldMax != nNewMax) { @@ -1281,7 +1281,7 @@ ScDPFieldType ScDPDataFieldControl::GetFieldType() const Size ScDPDataFieldControl::GetFieldSize() const { Size aWndSize = GetSizePixel(); - long nFieldObjWidth = aWndSize.Width() / 2.0 - OUTER_MARGIN_HOR - DATA_FIELD_BTN_GAP/2; + long nFieldObjWidth = static_cast<long>(aWndSize.Width() / 2.0 - OUTER_MARGIN_HOR - DATA_FIELD_BTN_GAP/2); Size aFieldSize(nFieldObjWidth, FIELD_BTN_HEIGHT); return aFieldSize; } diff --git a/sc/source/ui/vba/vbasheetobjects.cxx b/sc/source/ui/vba/vbasheetobjects.cxx index 3847209989f9..0277a203a7dc 100644 --- a/sc/source/ui/vba/vbasheetobjects.cxx +++ b/sc/source/ui/vba/vbasheetobjects.cxx @@ -342,8 +342,8 @@ uno::Any SAL_CALL ScVbaGraphicObjectsBase::Add( const uno::Any& rLeft, const uno /* Extract double values from passed Anys (the lclPointsToHmm() helper function will throw a RuntimeException on any error), and convert from points to 1/100 mm. */ - awt::Point aPos( lclPointsToHmm( rLeft ), lclPointsToHmm( rTop ) ); - awt::Size aSize( lclPointsToHmm( rWidth ), lclPointsToHmm( rHeight ) ); + awt::Point aPos( static_cast<sal_Int32>(lclPointsToHmm( rLeft )), static_cast<sal_Int32>(lclPointsToHmm( rTop )) ); + awt::Size aSize( static_cast<sal_Int32>(lclPointsToHmm( rWidth )), static_cast<sal_Int32>(lclPointsToHmm( rHeight )) ); // TODO: translate coordinates for RTL sheets if( (aPos.X < 0) || (aPos.Y < 0) || (aSize.Width <= 0) || (aSize.Height <= 0) ) throw uno::RuntimeException(); |