sw/source/filter/ww8/ww8scan.cxx  |   17 ++++++++++-------
 sw/source/filter/ww8/ww8scan.hxx  |    2 --
 sw/source/uibase/fldui/fldmgr.cxx |   15 ---------------
 sw/source/uibase/inc/fldmgr.hxx   |    1 -
 4 files changed, 10 insertions(+), 25 deletions(-)

New commits:
commit 2779984709d24ad263547407069a5da0fda36ceb
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Tue Oct 31 13:45:27 2023 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Wed Nov 1 18:39:41 2023 +0100

    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 <noel.gran...@collabora.co.uk>

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<sal_uInt8>( ( nPrm & 0xfe) >> 1 );
-            m_aShortSprm[1] = static_cast<sal_uInt8>(   nPrm         >> 8 );
+            SVBT32 aShortSprm; // mini storage: can contain ONE sprm with 1 
byte param
+            aShortSprm[0] = static_cast<sal_uInt8>( ( nPrm & 0xfe) >> 1 );
+            aShortSprm[1] = static_cast<sal_uInt8>(   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<sal_uInt8>( nSprmId & 
0x00ff)       ;
-                    m_aShortSprm[1] = static_cast<sal_uInt8>( ( nSprmId & 
0xff00) >> 8 );
-                    m_aShortSprm[2] = static_cast<sal_uInt8>( nPrm >> 8 );
+                    aShortSprm[0] = static_cast<sal_uInt8>( nSprmId & 0x00ff)  
     ;
+                    aShortSprm[1] = static_cast<sal_uInt8>( ( nSprmId & 
0xff00) >> 8 );
+                    aShortSprm[2] = static_cast<sal_uInt8>( 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<std::unique_ptr<sal_uInt8[]>> 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;
commit fbd558d0d13f3fac3267aff7c22baff27c5de43f
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Tue Oct 31 13:33:34 2023 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Wed Nov 1 18:39:32 2023 +0100

    SwFieldMgr::m_nCurFormat is unused
    
    found by a new loplugin of mine
    
    Change-Id: I2947d7c9f57b385053e50df4970f113a39432b18
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158752
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/sw/source/uibase/fldui/fldmgr.cxx 
b/sw/source/uibase/fldui/fldmgr.cxx
index 9187afa08832..ec509c92cd0c 100644
--- a/sw/source/uibase/fldui/fldmgr.cxx
+++ b/sw/source/uibase/fldui/fldmgr.cxx
@@ -441,30 +441,15 @@ SwField* SwFieldMgr::GetCurField()
     m_aCurPar1.clear();
     m_aCurPar2.clear();
     m_sCurFrame.clear();
-    m_nCurFormat = 0;
 
     if(!m_pCurField)
         return nullptr;
 
     // preprocess current values; determine parameter 1 and parameter 2
-    // as well as the format
-    const SwFieldTypesEnum nTypeId = m_pCurField->GetTypeId();
 
-    m_nCurFormat     = m_pCurField->GetFormat();
     m_aCurPar1    = m_pCurField->GetPar1();
     m_aCurPar2    = m_pCurField->GetPar2();
 
-    switch( nTypeId )
-    {
-        case SwFieldTypesEnum::PageNumber:
-        case SwFieldTypesEnum::NextPage:
-        case SwFieldTypesEnum::PreviousPage:
-        case SwFieldTypesEnum::GetRefPage:
-            if( m_nCurFormat == SVX_NUM_PAGEDESC )
-                m_nCurFormat -= 2;
-            break;
-        default: break;
-    }
     return m_pCurField;
 }
 
diff --git a/sw/source/uibase/inc/fldmgr.hxx b/sw/source/uibase/inc/fldmgr.hxx
index 4bf88db3c3f3..48d4500513c4 100644
--- a/sw/source/uibase/inc/fldmgr.hxx
+++ b/sw/source/uibase/inc/fldmgr.hxx
@@ -109,7 +109,6 @@ private:
     OUString          m_sMacroPath;
     OUString          m_sMacroName;
 
-    sal_uInt32          m_nCurFormat;
     bool            m_bEvalExp;
 
     SAL_DLLPRIVATE LanguageType    GetCurrLanguage() const;

Reply via email to