[Libreoffice-commits] core.git: sw/source
Stephan Bergmann
sbergman at redhat.com
Fri Aug 22 09:39:55 PDT 2014
sw/source/core/unocore/unocrsrhelper.cxx | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
New commits:
commit 130fc2f9951e0bb9eb1d17f99f277483d401b01c
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Aug 22 18:38:15 2014 +0200
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
diff --git a/sw/source/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx
index 6b511ae..75203aa 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);
+ }
}
}
More information about the Libreoffice-commits
mailing list