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
This commit is contained in:
@@ -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();
|
||||
|
@@ -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);
|
||||
|
Reference in New Issue
Block a user