sw/inc/numrule.hxx            |    2 +-
 sw/source/core/doc/docnum.cxx |    8 ++++----
 sw/source/core/doc/number.cxx |    6 +++---
 3 files changed, 8 insertions(+), 8 deletions(-)

New commits:
commit 597a746b38c4b3cb860cc997d532029d56a9f75a
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Thu Oct 1 20:48:26 2020 +0100
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Fri Oct 2 13:19:39 2020 +0200

    SwNumRule::CheckCharFormats never passed null SwDoc*
    
    Change-Id: I9f33af6cdf02e24a2a4da0694dda3a266832c0a6
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103822
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/sw/inc/numrule.hxx b/sw/inc/numrule.hxx
index a4e986a9ae9c..ae6405424518 100644
--- a/sw/inc/numrule.hxx
+++ b/sw/inc/numrule.hxx
@@ -218,7 +218,7 @@ public:
 
     /** Tests whether the CharFormats are from the given doc
        and copies them if appropriate. */
-    void CheckCharFormats( SwDoc* pDoc );
+    void CheckCharFormats( SwDoc& rDoc );
 
     const OUString& GetName() const { return msName; }
 
diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx
index b0a38c0f406e..5d466edbd942 100644
--- a/sw/source/core/doc/docnum.cxx
+++ b/sw/source/core/doc/docnum.cxx
@@ -129,7 +129,7 @@ void SwDoc::SetOutlineNumRule( const SwNumRule& rRule )
     mpOutlineRule->SetAutoRule( true );
 
     // test whether the optional CharFormats are defined in this Document
-    mpOutlineRule->CheckCharFormats( this );
+    mpOutlineRule->CheckCharFormats( *this );
 
     // notify text nodes, which are registered at the outline style, about the
     // changed outline style
@@ -813,7 +813,7 @@ static void lcl_ChgNumRule( SwDoc& rDoc, const SwNumRule& 
rRule )
     if( !nChgFormatLevel )         // Nothing has been changed?
     {
         const bool bInvalidateNumRule( pOld->IsContinusNum() != 
rRule.IsContinusNum() );
-        pOld->CheckCharFormats( &rDoc );
+        pOld->CheckCharFormats( rDoc );
         pOld->SetContinusNum( rRule.IsContinusNum() );
 
         if ( bInvalidateNumRule )
@@ -844,7 +844,7 @@ static void lcl_ChgNumRule( SwDoc& rDoc, const SwNumRule& 
rRule )
         if ( nChgFormatLevel & ( 1 << n ) )
             pOld->Set( n, rRule.GetNumFormat( n ) );
 
-    pOld->CheckCharFormats( &rDoc );
+    pOld->CheckCharFormats( rDoc );
     pOld->SetInvalidRule( true );
     pOld->SetContinusNum( rRule.IsContinusNum() );
 
@@ -2464,7 +2464,7 @@ sal_uInt16 SwDoc::MakeNumRule( const OUString &rName,
             pNew->SetPoolHlpFileId( UCHAR_MAX );
             pNew->SetDefaultListId( OUString() );
         }
-        pNew->CheckCharFormats( this );
+        pNew->CheckCharFormats( *this );
     }
     else
     {
diff --git a/sw/source/core/doc/number.cxx b/sw/source/core/doc/number.cxx
index a565e22ce1fd..a75c2478320d 100644
--- a/sw/source/core/doc/number.cxx
+++ b/sw/source/core/doc/number.cxx
@@ -512,18 +512,18 @@ SwNumRule::~SwNumRule()
     maParagraphStyleList.clear();
 }
 
-void SwNumRule::CheckCharFormats( SwDoc* pDoc )
+void SwNumRule::CheckCharFormats( SwDoc& rDoc )
 {
     for(auto& rpNumFormat : maFormats)
     {
         if( rpNumFormat )
         {
             SwCharFormat* pFormat = rpNumFormat->GetCharFormat();
-            if( pFormat && pFormat->GetDoc() != pDoc )
+            if( pFormat && pFormat->GetDoc() != &rDoc )
             {
                 // copy
                 SwNumFormat* pNew = new SwNumFormat( *rpNumFormat );
-                pNew->SetCharFormat( pDoc->CopyCharFormat( *pFormat ) );
+                pNew->SetCharFormat( rDoc.CopyCharFormat( *pFormat ) );
                 rpNumFormat.reset(pNew);
             }
         }
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to