From 2779984709d24ad263547407069a5da0fda36ceb Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 31 Oct 2023 13:45:27 +0200 Subject: WW8PLCFx_PCDAttrs::m_aShortSprm can be local found by a new loplugin Change-Id: Ie31d3fe32b9a8267d941d17d4a0a8749a7341165 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158754 Tested-by: Jenkins Reviewed-by: Noel Grandin --- sw/source/filter/ww8/ww8scan.cxx | 17 ++++++++++------- sw/source/filter/ww8/ww8scan.hxx | 2 -- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx index c7b175f56e61..6f801b929d57 100644 --- a/sw/source/filter/ww8/ww8scan.cxx +++ b/sw/source/filter/ww8/ww8scan.cxx @@ -1023,12 +1023,13 @@ void WW8PLCFx_PCDAttrs::GetSprms(WW8PLCFxDesc* p) if (IsSevenMinus(GetFIBVersion())) { - m_aShortSprm[0] = static_cast( ( nPrm & 0xfe) >> 1 ); - m_aShortSprm[1] = static_cast( nPrm >> 8 ); + SVBT32 aShortSprm; // mini storage: can contain ONE sprm with 1 byte param + aShortSprm[0] = static_cast( ( nPrm & 0xfe) >> 1 ); + aShortSprm[1] = static_cast( nPrm >> 8 ); p->nSprmsLen = nPrm ? 2 : 0; // length // store Position of internal mini storage in Data Pointer - p->pMemPos = m_aShortSprm; + p->pMemPos = aShortSprm; } else { @@ -1119,16 +1120,18 @@ void WW8PLCFx_PCDAttrs::GetSprms(WW8PLCFxDesc* p) if( nSprmId ) { + SVBT32 aShortSprm; // mini storage: can contain ONE sprm with 1 byte param + // move Sprm Id and Sprm Param to internal mini storage: - m_aShortSprm[0] = static_cast( nSprmId & 0x00ff) ; - m_aShortSprm[1] = static_cast( ( nSprmId & 0xff00) >> 8 ); - m_aShortSprm[2] = static_cast( nPrm >> 8 ); + aShortSprm[0] = static_cast( nSprmId & 0x00ff) ; + aShortSprm[1] = static_cast( ( nSprmId & 0xff00) >> 8 ); + aShortSprm[2] = static_cast( nPrm >> 8 ); // store Sprm Length in member: p->nSprmsLen = nPrm ? 3 : 0; // store Position of internal mini storage in Data Pointer - p->pMemPos = m_aShortSprm; + p->pMemPos = aShortSprm; } } } diff --git a/sw/source/filter/ww8/ww8scan.hxx b/sw/source/filter/ww8/ww8scan.hxx index d69a822554f5..d8fc08334bd6 100644 --- a/sw/source/filter/ww8/ww8scan.hxx +++ b/sw/source/filter/ww8/ww8scan.hxx @@ -437,8 +437,6 @@ private: WW8PLCFpcd_Iter* m_pPcdI; WW8PLCFx_PCD* m_pPcd; std::vector> const & mrGrpprls; // attribute of Piece-table - SVBT32 m_aShortSprm; // mini storage: can contain ONE sprm with - // 1 byte param WW8PLCFx_PCDAttrs(const WW8PLCFx_PCDAttrs&) = delete; WW8PLCFx_PCDAttrs& operator=(const WW8PLCFx_PCDAttrs&) = delete; -- cgit