svtools: Drop unnecessary write to local var
The value of `n` is only used in the first branch.
Reduce the variable scope to that one.
Addresses this warning shown in Qt Creator:
/home/michi/development/git/libreoffice/svtools/source/control/valueset.cxx:1522:8: Value stored to 'n' is never read [clang-analyzer-deadcode.DeadStores]
Change-Id: Ib6e74fb35152c1d6098274e1fd5a9a60253b4900
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211897
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
This commit is contained in:
@@ -1506,10 +1506,10 @@ Size ValueSet::CalcWindowSizePixel( const Size& rItemSize, sal_uInt16 nDesireCol
|
||||
Size aSize( rItemSize.Width() * nCalcCols, rItemSize.Height() * nCalcLines );
|
||||
WinBits nStyle = GetStyle();
|
||||
tools::Long nTxtHeight = GetTextHeight();
|
||||
tools::Long n;
|
||||
|
||||
if ( nStyle & WB_ITEMBORDER )
|
||||
{
|
||||
tools::Long n;
|
||||
if ( nStyle & WB_DOUBLEBORDER )
|
||||
n = ITEM_OFFSET_DOUBLE;
|
||||
else
|
||||
@@ -1518,8 +1518,6 @@ Size ValueSet::CalcWindowSizePixel( const Size& rItemSize, sal_uInt16 nDesireCol
|
||||
aSize.AdjustWidth(n * nCalcCols );
|
||||
aSize.AdjustHeight(n * nCalcLines );
|
||||
}
|
||||
else
|
||||
n = 0;
|
||||
|
||||
if ( mnSpacing )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user