diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-07-01 16:11:14 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-07-01 16:43:07 +0100 |
commit | 4d22b8f7b46c6e93f682ac26aee1403cd5288a88 (patch) | |
tree | 7191a5dcae828c064b2361e1a9bae61454c5fb43 /starmath | |
parent | coverity#735883 Unchecked dynamic_cast (diff) | |
download | core-4d22b8f7b46c6e93f682ac26aee1403cd5288a88.tar.gz core-4d22b8f7b46c6e93f682ac26aee1403cd5288a88.zip |
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
Diffstat (limited to 'starmath')
-rw-r--r-- | starmath/inc/dialog.hxx | 6 | ||||
-rw-r--r-- | starmath/source/dialog.cxx | 12 |
2 files changed, 9 insertions, 9 deletions
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<sal_uInt16>(1, nColumns); - nRows = std::max<sal_uInt16>(1, nRows); + nRows = aOutputSize.Height() / nLen; + nColumns = std::max<long>(1, nColumns); + nRows = std::max<long>(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<size_t>(nColumns * nRows)) { m_pVScrollBar->SetRange(Range(0, ((aSymbolSet.size() + (nColumns - 1)) / nColumns) - nRows)); m_pVScrollBar->Enable(true); |