[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Sep 10 16:46:40 UTC 2018


 sw/source/core/crsr/crstrvl.cxx |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 860eca91ed159db46b527ebb2fc592e8d5423356
Author:     Juergen Funk <juergen.funk_ml at cib.de>
AuthorDate: Fri Sep 7 10:25:16 2018 +0200
Commit:     Michael Stahl <Michael.Stahl at cib.de>
CommitDate: Mon Sep 10 18:46:29 2018 +0200

    sw: tdf#119742 fix null pointer in SetCursorInHdFt
    
    In SwWrtShell::ChangeHeaderOrFooter the ChgPageDesc destroys the frames
    of the header, that's why GetCurrFrame returns null later.
    
    Change-Id: I26915237c8b455a5b8ad0bbd5c2de38537dfef08
    Reviewed-on: https://gerrit.libreoffice.org/60130
    Reviewed-by: Michael Stahl <Michael.Stahl at cib.de>
    Tested-by: Michael Stahl <Michael.Stahl at cib.de>
    (cherry picked from commit 77d075facaf4fc8954666ad541ed14f75d964fba)
    Reviewed-on: https://gerrit.libreoffice.org/60249
    Tested-by: Jenkins

diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx
index 7a7d67d4fe86..cef97092485c 100644
--- a/sw/source/core/crsr/crstrvl.cxx
+++ b/sw/source/core/crsr/crstrvl.cxx
@@ -199,7 +199,8 @@ bool SwCursorShell::SetCursorInHdFt( size_t nDescNo, bool bInHeader )
     if( SIZE_MAX == nDescNo )
     {
         // take the current one
-        const SwPageFrame* pPage = GetCurrFrame()->FindPageFrame();
+        const SwContentFrame *pCurrFrame = GetCurrFrame();
+        const SwPageFrame* pPage = (pCurrFrame == nullptr) ? nullptr : pCurrFrame->FindPageFrame();
         if( pPage && pMyDoc->ContainsPageDesc(
                 pPage->GetPageDesc(), &nDescNo) )
             pDesc = pPage->GetPageDesc();


More information about the Libreoffice-commits mailing list