sw/source/core/doc/docedt.cxx |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 80cdd9aa5fea4123f71efcaac2b7640e4689ded0
Author:     Justin Luth <jl...@mail.com>
AuthorDate: Wed Sep 17 09:37:06 2025 -0400
Commit:     Justin Luth <jl...@mail.com>
CommitDate: Thu Sep 18 15:14:02 2025 +0200

    NFC cleanup redundant null check
    
    and then I decided to clean it up a bit
    (which helps the lines fit inside formatting guidelines too)
    
    HasSwAttrSet() is not less expensive than GetpSwAttrSet()
    so since we need to use it multiple times anyway,
    just get it into a variable first and then null check.
    
    Change-Id: I467d01f11b42a1a5704c16ab55f2ffe47caf07a9
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191106
    Tested-by: Jenkins
    Reviewed-by: Justin Luth <jl...@mail.com>

diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx
index 5d584f2a326f..6eca6e6ab1ca 100644
--- a/sw/source/core/doc/docedt.cxx
+++ b/sw/source/core/doc/docedt.cxx
@@ -384,21 +384,21 @@ bool sw_JoinText( SwPaM& rPam, bool bJoinPrev )
 
                 /* The MarkNode */
                 pTextNd = aIdx.GetNode().GetTextNode();
-                if (pTextNd->HasSwAttrSet())
+                const SfxItemSet* pSet = pTextNd->GetpSwAttrSet();
+                if (pSet)
                 {
-                    if( SfxItemState::SET == 
pTextNd->GetpSwAttrSet()->GetItemState( RES_BREAK, false) )
+                    if (SfxItemState::SET == pSet->GetItemState(RES_BREAK, 
false))
                         pTextNd->ResetAttr( RES_BREAK );
-                    if( pTextNd->HasSwAttrSet() &&
-                        SfxItemState::SET == 
pTextNd->GetpSwAttrSet()->GetItemState( RES_PAGEDESC, false ) )
+                    if (SfxItemState::SET == pSet->GetItemState(RES_PAGEDESC, 
false))
                         pTextNd->ResetAttr( RES_PAGEDESC );
                 }
 
                 /* The PointNode */
-                if( pOldTextNd->HasSwAttrSet() )
+                pSet = pOldTextNd->GetpSwAttrSet();
+                if (pSet)
                 {
                     const SfxPoolItem* pItem;
                     SfxItemSet aSet( rDoc.GetAttrPool(), aBreakSetRange );
-                    const SfxItemSet* pSet = pOldTextNd->GetpSwAttrSet();
                     if( SfxItemState::SET == pSet->GetItemState( RES_BREAK,
                         false, &pItem ) )
                         aSet.Put( *pItem );

Reply via email to