From e0d0f4ca38e305ae2b3090aa95f3fbb02da713e7 Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Tue, 6 Oct 2026 12:11:50 +0200 Subject: [PATCH] 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 --- svtools/source/control/valueset.cxx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/svtools/source/control/valueset.cxx b/svtools/source/control/valueset.cxx index d2e3f09d8184..abe8375deb10 100644 --- a/svtools/source/control/valueset.cxx +++ b/svtools/source/control/valueset.cxx @@ -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 ) {