sw/source/filter/ww8/ww8graf.cxx |   17 ++++++-----------
 1 file changed, 6 insertions(+), 11 deletions(-)

New commits:
commit 1a38ff09bef969ad13877e3e752b04e1d590323e
Author:     Justin Luth <jl...@mail.com>
AuthorDate: Tue May 14 21:29:29 2024 -0400
Commit:     Justin Luth <jl...@mail.com>
CommitDate: Thu May 16 13:07:16 2024 +0200

    NFC use more GetTrueWhichIDFromSlotID
    
    We already check if nWhich is not equal to 0,
    so instead of returning nWhich == nSlotId
    (which we immediately check for an reject),
    use this version of the function which returns a 0
    instead of the slotid when there is no nWhich.
    
    Change-Id: I7ee3286f535db2c89ec458decd0ab6bdc4d3cc5a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167713
    Reviewed-by: Justin Luth <jl...@mail.com>
    Tested-by: Jenkins

diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx
index a0209e002d8e..97420da84945 100644
--- a/sw/source/filter/ww8/ww8graf.cxx
+++ b/sw/source/filter/ww8/ww8graf.cxx
@@ -536,12 +536,10 @@ void SwWW8ImplReader::InsertTxbxStyAttrs(SfxItemSet& rS, 
sal_uInt16 nColl, ManTy
                 aLR.SetRight(pStyInf->m_pFormat->GetRightMargin().GetRight());
                 rS.Put(aLR);
             }
-            else if (
-                nSlotId && nWhich != nSlotId &&
-                0 != (nWhich = pEditPool->GetWhichIDFromSlotID(nSlotId)) &&
-                nWhich != nSlotId &&
-                ( SfxItemState::SET != rS.GetItemState(nWhich, false) )
-               )
+            else if (nSlotId && nWhich != nSlotId
+                     && 0 != (nWhich = 
pEditPool->GetTrueWhichIDFromSlotID(nSlotId))
+                     && SfxItemState::SET != rS.GetItemState(nWhich, false))
+
             {
                 rS.Put( pItem->CloneSetWhich(nWhich) );
             }
@@ -794,11 +792,8 @@ void SwWW8ImplReader::InsertAttrsAsDrawingAttrs(WW8_CP 
nStartCp, WW8_CP nEndCp,
                             }
                             pS->Put(aLR);
                         }
-                        else if (
-                            nSlotId && nWhich != nSlotId &&
-                            0 != (nWhich = 
pEditPool->GetWhichIDFromSlotID(nSlotId)) &&
-                            nWhich != nSlotId
-                        )
+                        else if (nSlotId && nWhich != nSlotId
+                                 && 0 != (nWhich = 
pEditPool->GetTrueWhichIDFromSlotID(nSlotId)))
                         {
                             pS->Put( pItem->CloneSetWhich(nWhich) );
                         }

Reply via email to