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:
Michael Weghorn
2026-10-07 17:49:47 +02:00
parent a0e94744f0
commit e0d0f4ca38
+1 -3
View File
@@ -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 )
{