sw/inc/numrule.hxx                            |    2 +-
 sw/source/core/attr/swatrset.cxx              |    2 +-
 sw/source/core/doc/DocumentSettingManager.cxx |    2 +-
 sw/source/core/doc/docfmt.cxx                 |    2 +-
 sw/source/core/doc/docnum.cxx                 |    8 ++++----
 sw/source/core/doc/number.cxx                 |    6 +++---
 sw/source/core/docnode/node.cxx               |    2 +-
 sw/source/core/docnode/nodes.cxx              |    2 +-
 sw/source/filter/html/htmlgrin.cxx            |    2 +-
 sw/source/filter/html/htmlnumreader.cxx       |    4 ++--
 10 files changed, 16 insertions(+), 16 deletions(-)

New commits:
commit 8aeddf624dca4a34a4f2cf84c32cab0c99ef4db8
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Wed Jan 10 11:13:05 2024 +0600
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Wed Jan 10 08:27:04 2024 +0100

    SwNumRule: SetInvalidRule(bool) -> Invalidate()
    
    It should only be validated using Validate().
    In SwHTMLParser::SetNodeNum, it was setting the "invalid" flag to false,
    while the comment was telling the opposite. It was this way since commit
    7b0b5cdfeed656b279bc32cd929630d5fc25878b (initial import, 2000-09-18).
    It seems that the call could be safely removed (it looks wrong to set it
    valid forcefully; but then, if it worked, why change it?); but first,
    let's change it to what the comment says, and see if something fixes
    magically.
    
    In fact, it also seems wrong to invalidate it explicitly from outer code:
    other setters should do it automatically; TODO/LATER.
    
    Change-Id: I0efb01434f77a53494272745e93482bb21612351
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161849
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>

diff --git a/sw/inc/numrule.hxx b/sw/inc/numrule.hxx
index af0655272936..aaa09236c8e4 100644
--- a/sw/inc/numrule.hxx
+++ b/sw/inc/numrule.hxx
@@ -232,7 +232,7 @@ public:
     void SetAutoRule( bool bFlag )      { mbAutoRuleFlag = bFlag; }
 
     bool IsInvalidRule() const          { return mbInvalidRuleFlag; }
-    void SetInvalidRule(bool bFlag) { mbInvalidRuleFlag = bFlag; }
+    void Invalidate() { mbInvalidRuleFlag = true; }
 
     bool IsContinusNum() const          { return mbContinusNum; }
     void SetContinusNum( bool bFlag )   { mbContinusNum = bFlag; }
diff --git a/sw/source/core/attr/swatrset.cxx b/sw/source/core/attr/swatrset.cxx
index fc4612757dcc..c0155317c76e 100644
--- a/sw/source/core/attr/swatrset.cxx
+++ b/sw/source/core/attr/swatrset.cxx
@@ -396,7 +396,7 @@ void SwAttrSet::CopyToModify( sw::BroadcastingModify& rMod 
) const
                 {
                     SwNumRule* pDestRule = pDstDoc->FindNumRulePtr( rNm );
                     if( pDestRule )
-                        pDestRule->SetInvalidRule( true );
+                        pDestRule->Invalidate();
                     else
                         pDstDoc->MakeNumRule( rNm, pSrcDoc->FindNumRulePtr( 
rNm ) );
                 }
diff --git a/sw/source/core/doc/DocumentSettingManager.cxx 
b/sw/source/core/doc/DocumentSettingManager.cxx
index 355b704a3a05..81079008b023 100644
--- a/sw/source/core/doc/DocumentSettingManager.cxx
+++ b/sw/source/core/doc/DocumentSettingManager.cxx
@@ -300,7 +300,7 @@ void sw::DocumentSettingManager::set(/*[in]*/ 
DocumentSettingId id, /*[in]*/ boo
 
                 const SwNumRuleTable& rNmTable = m_rDoc.GetNumRuleTable();
                 for( SwNumRuleTable::size_type n = 0; n < rNmTable.size(); ++n 
)
-                    rNmTable[n]->SetInvalidRule(true);
+                    rNmTable[n]->Invalidate();
 
                 m_rDoc.UpdateNumRule();
 
diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index 21a4da06dc6b..26a9e2a5f69a 100644
--- a/sw/source/core/doc/docfmt.cxx
+++ b/sw/source/core/doc/docfmt.cxx
@@ -1229,7 +1229,7 @@ SwTextFormatColl* SwDoc::CopyTextColl( const 
SwTextFormatColl& rColl )
                 {
                     SwNumRule* pDestRule = FindNumRulePtr( rName );
                     if( pDestRule )
-                        pDestRule->SetInvalidRule( true );
+                        pDestRule->Invalidate();
                     else
                         MakeNumRule( rName, pRule );
                 }
diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx
index 0735380e5dc2..1c7d1792abe5 100644
--- a/sw/source/core/doc/docnum.cxx
+++ b/sw/source/core/doc/docnum.cxx
@@ -156,7 +156,7 @@ void SwDoc::SetOutlineNumRule( const SwNumRule& rRule )
     }
 
     PropagateOutlineRule();
-    mpOutlineRule->SetInvalidRule(true);
+    mpOutlineRule->Invalidate();
     UpdateNumRule();
 
     // update if we have foot notes && numbering by chapter
@@ -825,7 +825,7 @@ static void lcl_ChgNumRule( SwDoc& rDoc, const SwNumRule& 
rRule )
 
         if ( bInvalidateNumRule )
         {
-            pOld->SetInvalidRule(true);
+            pOld->Invalidate();
         }
 
         return ;
@@ -852,7 +852,7 @@ static void lcl_ChgNumRule( SwDoc& rDoc, const SwNumRule& 
rRule )
             pOld->Set( n, rRule.GetNumFormat( n ) );
 
     pOld->CheckCharFormats( rDoc );
-    pOld->SetInvalidRule( true );
+    pOld->Invalidate();
     pOld->SetContinusNum( rRule.IsContinusNum() );
 
     rDoc.UpdateNumRule();
@@ -1386,7 +1386,7 @@ void SwDoc::DelNumRules(const SwPaM& rPam, SwRootFrame 
const*const pLayout)
 void SwDoc::InvalidateNumRules()
 {
     for (size_t n = 0; n < mpNumRuleTable->size(); ++n)
-        (*mpNumRuleTable)[n]->SetInvalidRule(true);
+        (*mpNumRuleTable)[n]->Invalidate();
 }
 
 // To the next/preceding Bullet at the same Level
diff --git a/sw/source/core/doc/number.cxx b/sw/source/core/doc/number.cxx
index 8b7b22059467..b842c9e9a391 100644
--- a/sw/source/core/doc/number.cxx
+++ b/sw/source/core/doc/number.cxx
@@ -1089,7 +1089,7 @@ void SwNumRule::ChangeIndent( const sal_Int32 nDiff )
         Set( i, aTmpNumFormat );
     }
 
-    SetInvalidRule( true );
+    mbInvalidRuleFlag = true;
 }
 
 /// set indent of certain list level to given value
@@ -1117,7 +1117,7 @@ void SwNumRule::SetIndent( const short nNewIndent,
         aTmpNumFormat.SetIndentAt( nNewIndent );
     }
 
-    SetInvalidRule( true );
+    mbInvalidRuleFlag = true;
 }
 
 /// set indent of first list level to given value and change other list level's
@@ -1160,7 +1160,7 @@ void SwNumRule::Validate(const SwDoc& rDoc)
     for ( auto aList : aLists )
         aList->ValidateListTree(rDoc);
 
-    SetInvalidRule(false);
+    mbInvalidRuleFlag = false;
 }
 
 void SwNumRule::SetCountPhantoms(bool bCountPhantoms)
diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx
index b2419bd132ec..75aa5e9c0736 100644
--- a/sw/source/core/docnode/node.cxx
+++ b/sw/source/core/docnode/node.cxx
@@ -1218,7 +1218,7 @@ bool SwContentNode::InvalidateNumRule()
         nullptr != (pRule = GetDoc().FindNumRulePtr(
                                 static_cast<const 
SwNumRuleItem*>(pItem)->GetValue() ) ) )
     {
-        pRule->SetInvalidRule( true );
+        pRule->Invalidate();
     }
     return nullptr != pRule;
 }
diff --git a/sw/source/core/docnode/nodes.cxx b/sw/source/core/docnode/nodes.cxx
index c6ecb9ccf974..79efa02cf417 100644
--- a/sw/source/core/docnode/nodes.cxx
+++ b/sw/source/core/docnode/nodes.cxx
@@ -231,7 +231,7 @@ void SwNodes::ChgNode( SwNodeIndex const & rDelPos, 
SwNodeOffset nSz,
                         sNumRule = pNumRule->GetName();
                         SwNumRule* pDestRule = pDestDoc->FindNumRulePtr( 
sNumRule );
                         if( pDestRule )
-                            pDestRule->SetInvalidRule( true );
+                            pDestRule->Invalidate();
                         else
                             pDestDoc->MakeNumRule( sNumRule, pNumRule );
                     }
diff --git a/sw/source/filter/html/htmlgrin.cxx 
b/sw/source/filter/html/htmlgrin.cxx
index 072b8945d234..2b30c167bfe0 100644
--- a/sw/source/filter/html/htmlgrin.cxx
+++ b/sw/source/filter/html/htmlgrin.cxx
@@ -480,7 +480,7 @@ IMAGE_SETEVENT:
             // It's necessary to invalidate the rule, because between the 
reading
             // of LI and the graphic an EndAction could be called.
             if( GetNumInfo().GetNumRule() )
-                GetNumInfo().GetNumRule()->SetInvalidRule( true );
+                GetNumInfo().GetNumRule()->Invalidate();
 
             // Set the style again, so that indent of the first line is 
correct.
             SetTextCollAttrs();
diff --git a/sw/source/filter/html/htmlnumreader.cxx 
b/sw/source/filter/html/htmlnumreader.cxx
index c21a45e87768..d9ecc21f3d3b 100644
--- a/sw/source/filter/html/htmlnumreader.cxx
+++ b/sw/source/filter/html/htmlnumreader.cxx
@@ -526,7 +526,7 @@ void SwHTMLParser::NewNumberBulletListItem( HtmlTokenId 
nToken )
     }
 
     if( GetNumInfo().GetNumRule() )
-        GetNumInfo().GetNumRule()->SetInvalidRule( true );
+        GetNumInfo().GetNumRule()->Invalidate();
 
     // parse styles
     if( HasStyleOptions( aStyle, aId, aClass, &aLang, &aDir ) )
@@ -614,7 +614,7 @@ void SwHTMLParser::SetNodeNum( sal_uInt8 nLevel )
     pTextNode->SetCountedInList( false );
 
     // Invalidate NumRule, it may have been set valid because of an EndAction
-    GetNumInfo().GetNumRule()->SetInvalidRule( false );
+    GetNumInfo().GetNumRule()->Invalidate();
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Reply via email to