diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-08-22 18:38:15 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-08-22 18:38:15 +0200 |
commit | 130fc2f9951e0bb9eb1d17f99f277483d401b01c (patch) | |
tree | b265b864543f558dcae9e2d65e16748f819a3ded /sw | |
parent | e85bf96baac4691a4c1ea139cfb0e3551b9d6c1e (diff) |
Avoid undef member function call with this == nullptr
(in which case SwFrm::FindPageFrm, sw/source/core/layout/findfrm.cxx, happened
to return nullptr, so all used to go well; but still...)
Change-Id: Ib513d9a157d0135ca234930bbcbeeacf814bb80e
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/unocore/unocrsrhelper.cxx | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/sw/source/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx index 6b511ae2fcca..75203aa24cb9 100644 --- a/sw/source/core/unocore/unocrsrhelper.cxx +++ b/sw/source/core/unocore/unocrsrhelper.cxx @@ -898,11 +898,15 @@ void GetCurPageStyle(SwPaM& rPaM, OUString &rString) { if (!rPaM.GetCntntNode()) return; // TODO: is there an easy way to get it for tables/sections? - const SwPageFrm* pPage = rPaM.GetCntntNode()->getLayoutFrm(rPaM.GetDoc()->getIDocumentLayoutAccess().GetCurrentLayout())->FindPageFrm(); - if(pPage) + SwCntntFrm* pFrame = rPaM.GetCntntNode()->getLayoutFrm(rPaM.GetDoc()->getIDocumentLayoutAccess().GetCurrentLayout()); + if(pFrame) { - SwStyleNameMapper::FillProgName(pPage->GetPageDesc()->GetName(), - rString, nsSwGetPoolIdFromName::GET_POOLID_PAGEDESC, true); + const SwPageFrm* pPage = pFrame->FindPageFrm(); + if(pPage) + { + SwStyleNameMapper::FillProgName(pPage->GetPageDesc()->GetName(), + rString, nsSwGetPoolIdFromName::GET_POOLID_PAGEDESC, true); + } } } |