summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuergen Funk <juergen.funk_ml@cib.de>2018-09-07 10:25:16 +0200
committerAndras Timar <andras.timar@collabora.com>2018-09-11 18:44:11 +0200
commite32e0ed42bb3f0ebda56a5ce33c9f11e99d4fc5c (patch)
tree770c07300e196b49fac9ae78630319a1e8221dda
parent814332a95d2ff0e9246e90a9e056f6839bc2bcc3 (diff)
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@cib.de> Tested-by: Michael Stahl <Michael.Stahl@cib.de> (cherry picked from commit 77d075facaf4fc8954666ad541ed14f75d964fba) Reviewed-on: https://gerrit.libreoffice.org/60302 Tested-by: Jenkins (cherry picked from commit 6a8b0d2a9c52b0706772c3b05edc4da995211dc6)
-rw-r--r--sw/source/core/crsr/crstrvl.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx
index 798793238edd..f4df137fe82d 100644
--- a/sw/source/core/crsr/crstrvl.cxx
+++ b/sw/source/core/crsr/crstrvl.cxx
@@ -200,7 +200,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();