From 4d22b8f7b46c6e93f682ac26aee1403cd5288a88 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 1 Jul 2014 16:11:14 +0100 Subject: coverity#1038321 Unintended sign extension and coverity#1038320 Unintended sign extension coverity#1038319 Unintended sign extension coverity#1038318 Unintended sign extension coverity#1038317 Unintended sign extension coverity#1038316 Unintended sign extension coverity#1038315 Unintended sign extension coverity#1038314 Unintended sign extension Change-Id: Ib8015baf8ffec48e1b2d6ce1e7ce284fb36303b0 --- starmath/inc/dialog.hxx | 6 +++--- starmath/source/dialog.cxx | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'starmath') diff --git a/starmath/inc/dialog.hxx b/starmath/inc/dialog.hxx index 24b563092aa2..25b003d44815 100644 --- a/starmath/inc/dialog.hxx +++ b/starmath/inc/dialog.hxx @@ -259,9 +259,9 @@ class SmShowSymbolSetWindow : public Control SymbolPtrVec_t aSymbolSet; Link aSelectHdlLink; Link aDblClickHdlLink; - sal_uInt16 nLen; - sal_uInt16 nRows, nColumns; - sal_uInt16 nXOffset, nYOffset; + long nLen; + long nRows, nColumns; + long nXOffset, nYOffset; sal_uInt16 nSelectSymbol; void SetScrollBarRange(); diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index 06c111549c25..83850e64ecc3 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -1200,16 +1200,16 @@ extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeSmShowSymbolSet(Window *pPa void SmShowSymbolSetWindow::calccols() { // Height of 16pt in pixels (matching 'aOutputSize') - nLen = (sal_uInt16) LogicToPixel(Size(0, 16), MapMode(MAP_POINT)).Height(); + nLen = LogicToPixel(Size(0, 16), MapMode(MAP_POINT)).Height(); Size aOutputSize = GetOutputSizePixel(); - nColumns = sal::static_int_cast< sal_uInt16 >(aOutputSize.Width() / nLen); + nColumns = aOutputSize.Width() / nLen; if (nColumns > 2 && nColumns % 2 != 0) --nColumns; - nRows = sal::static_int_cast< sal_uInt16 >(aOutputSize.Height() / nLen); - nColumns = std::max(1, nColumns); - nRows = std::max(1, nRows); + nRows = aOutputSize.Height() / nLen; + nColumns = std::max(1, nColumns); + nRows = std::max(1, nRows); nXOffset = (aOutputSize.Width() - (nColumns * nLen)) / 2; nYOffset = (aOutputSize.Height() - (nRows * nLen)) / 2; @@ -1232,7 +1232,7 @@ void SmShowSymbolSetWindow::SetSymbolSet(const SymbolPtrVec_t& rSymbolSet) void SmShowSymbolSetWindow::SetScrollBarRange() { - if (static_cast< sal_uInt16 >(aSymbolSet.size()) > (nColumns * nRows)) + if (aSymbolSet.size() > static_cast(nColumns * nRows)) { m_pVScrollBar->SetRange(Range(0, ((aSymbolSet.size() + (nColumns - 1)) / nColumns) - nRows)); m_pVScrollBar->Enable(true); -- cgit