Kaydet (Commit) 4d22b8f7 authored tarafından Caolán McNamara's avatar Caolán McNamara

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
üst 8a9bc476
...@@ -259,9 +259,9 @@ class SmShowSymbolSetWindow : public Control ...@@ -259,9 +259,9 @@ class SmShowSymbolSetWindow : public Control
SymbolPtrVec_t aSymbolSet; SymbolPtrVec_t aSymbolSet;
Link aSelectHdlLink; Link aSelectHdlLink;
Link aDblClickHdlLink; Link aDblClickHdlLink;
sal_uInt16 nLen; long nLen;
sal_uInt16 nRows, nColumns; long nRows, nColumns;
sal_uInt16 nXOffset, nYOffset; long nXOffset, nYOffset;
sal_uInt16 nSelectSymbol; sal_uInt16 nSelectSymbol;
void SetScrollBarRange(); void SetScrollBarRange();
......
...@@ -1200,16 +1200,16 @@ extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeSmShowSymbolSet(Window *pPa ...@@ -1200,16 +1200,16 @@ extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeSmShowSymbolSet(Window *pPa
void SmShowSymbolSetWindow::calccols() void SmShowSymbolSetWindow::calccols()
{ {
// Height of 16pt in pixels (matching 'aOutputSize') // 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(); Size aOutputSize = GetOutputSizePixel();
nColumns = sal::static_int_cast< sal_uInt16 >(aOutputSize.Width() / nLen); nColumns = aOutputSize.Width() / nLen;
if (nColumns > 2 && nColumns % 2 != 0) if (nColumns > 2 && nColumns % 2 != 0)
--nColumns; --nColumns;
nRows = sal::static_int_cast< sal_uInt16 >(aOutputSize.Height() / nLen); nRows = aOutputSize.Height() / nLen;
nColumns = std::max<sal_uInt16>(1, nColumns); nColumns = std::max<long>(1, nColumns);
nRows = std::max<sal_uInt16>(1, nRows); nRows = std::max<long>(1, nRows);
nXOffset = (aOutputSize.Width() - (nColumns * nLen)) / 2; nXOffset = (aOutputSize.Width() - (nColumns * nLen)) / 2;
nYOffset = (aOutputSize.Height() - (nRows * nLen)) / 2; nYOffset = (aOutputSize.Height() - (nRows * nLen)) / 2;
...@@ -1232,7 +1232,7 @@ void SmShowSymbolSetWindow::SetSymbolSet(const SymbolPtrVec_t& rSymbolSet) ...@@ -1232,7 +1232,7 @@ void SmShowSymbolSetWindow::SetSymbolSet(const SymbolPtrVec_t& rSymbolSet)
void SmShowSymbolSetWindow::SetScrollBarRange() 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->SetRange(Range(0, ((aSymbolSet.size() + (nColumns - 1)) / nColumns) - nRows));
m_pVScrollBar->Enable(true); m_pVScrollBar->Enable(true);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment