[Libreoffice-commits] core.git: sw/inc sw/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Fri Oct 2 07:44:14 UTC 2020


 sw/inc/doc.hxx                  |    2 +-
 sw/source/core/doc/doc.cxx      |   14 +++++++-------
 sw/source/uibase/app/docsh2.cxx |    2 +-
 3 files changed, 9 insertions(+), 9 deletions(-)

New commits:
commit 344ae518165cbe49b11a518212b8470a18d4d09d
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu Oct 1 20:46:14 2020 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Fri Oct 2 09:43:29 2020 +0200

    SwDoc::Summary never called with null pExtDoc arg
    
    Change-Id: I492e83716b84f7ad9a5e918594df42a5aec65841
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103779
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx
index 3253ad0c118e..6d2d785dc655 100644
--- a/sw/inc/doc.hxx
+++ b/sw/inc/doc.hxx
@@ -650,7 +650,7 @@ public:
     // Glossary Document
     bool IsInsOnlyTextGlossary() const      { return mbInsOnlyTextGlssry; }
 
-    void Summary( SwDoc* pExtDoc, sal_uInt8 nLevel, sal_uInt8 nPara, bool bImpress );
+    void Summary(SwDoc& rExtDoc, sal_uInt8 nLevel, sal_uInt8 nPara, bool bImpress);
 
     void ChangeAuthorityData(const SwAuthEntry* pNewData);
 
diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx
index b78cbe662ef6..a346a4c3148a 100644
--- a/sw/source/core/doc/doc.cxx
+++ b/sw/source/core/doc/doc.cxx
@@ -1219,14 +1219,14 @@ const SwFormatINetFormat* SwDoc::FindINetAttr( const OUString& rName ) const
     return nullptr;
 }
 
-void SwDoc::Summary( SwDoc* pExtDoc, sal_uInt8 nLevel, sal_uInt8 nPara, bool bImpress )
+void SwDoc::Summary(SwDoc& rExtDoc, sal_uInt8 nLevel, sal_uInt8 nPara, bool bImpress)
 {
     const SwOutlineNodes& rOutNds = GetNodes().GetOutLineNds();
-    if( !pExtDoc || rOutNds.empty() )
+    if (rOutNds.empty())
         return;
 
     ::StartProgress( STR_STATSTR_SUMMARY, 0, rOutNds.size(), GetDocShell() );
-    SwNodeIndex aEndOfDoc( pExtDoc->GetNodes().GetEndOfContent(), -1 );
+    SwNodeIndex aEndOfDoc( rExtDoc.GetNodes().GetEndOfContent(), -1 );
     for( SwOutlineNodes::size_type i = 0; i < rOutNds.size(); ++i )
     {
         ::SetProgressState( static_cast<long>(i), GetDocShell() );
@@ -1253,10 +1253,10 @@ void SwDoc::Summary( SwDoc* pExtDoc, sal_uInt8 nLevel, sal_uInt8 nPara, bool bIm
         SwNodeRange aRange( *rOutNds[ i ], 0, *rOutNds[ i ], nEndOfs );
         GetNodes().Copy_( aRange, aEndOfDoc );
     }
-    const SwTextFormatColls *pColl = pExtDoc->GetTextFormatColls();
+    const SwTextFormatColls *pColl = rExtDoc.GetTextFormatColls();
     for( SwTextFormatColls::size_type i = 0; i < pColl->size(); ++i )
         (*pColl)[ i ]->ResetFormatAttr( RES_PAGEDESC, RES_BREAK );
-    SwNodeIndex aIndx( pExtDoc->GetNodes().GetEndOfExtras() );
+    SwNodeIndex aIndx( rExtDoc.GetNodes().GetEndOfExtras() );
     ++aEndOfDoc;
     while( aIndx < aEndOfDoc )
     {
@@ -1275,14 +1275,14 @@ void SwDoc::Summary( SwDoc* pExtDoc, sal_uInt8 nLevel, sal_uInt8 nPara, bool bIm
                             !pMyColl->IsAssignedToListLevelOfOutlineStyle()
                             ? RES_POOLCOLL_HEADLINE2
                             : RES_POOLCOLL_HEADLINE1 );
-                pMyColl = pExtDoc->getIDocumentStylePoolAccess().GetTextCollFromPool( nHeadLine );
+                pMyColl = rExtDoc.getIDocumentStylePoolAccess().GetTextCollFromPool( nHeadLine );
                 pNd->ChgFormatColl( pMyColl );
             }
             if( !pNd->Len() &&
                 pNd->StartOfSectionIndex()+2 < pNd->EndOfSectionIndex() )
             {
                 bDelete = true;
-                pExtDoc->GetNodes().Delete( aIndx );
+                rExtDoc.GetNodes().Delete( aIndx );
             }
         }
         if( !bDelete )
diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx
index 13c15a461832..fbabf863490d 100644
--- a/sw/source/uibase/app/docsh2.cxx
+++ b/sw/source/uibase/app/docsh2.cxx
@@ -756,7 +756,7 @@ void SwDocShell::Execute(SfxRequest& rReq)
                 xDocSh->DoInitNew();
 
                 bool bImpress = FN_ABSTRACT_STARIMPRESS == nWhich;
-                m_xDoc->Summary( pSmryDoc, nLevel, nPara, bImpress );
+                m_xDoc->Summary(*pSmryDoc, nLevel, nPara, bImpress);
                 if( bImpress )
                 {
                     WriterRef xWrt;


More information about the Libreoffice-commits mailing list