diff options
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); + } } } |