diff options
-rw-r--r-- | sw/source/core/inc/frame.hxx | 1 | ||||
-rw-r--r-- | sw/source/core/layout/flowfrm.cxx | 3 | ||||
-rw-r--r-- | sw/source/core/layout/pagechg.cxx | 3 | ||||
-rw-r--r-- | sw/source/core/layout/trvlfrm.cxx | 17 |
4 files changed, 20 insertions, 4 deletions
diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx index df4b0fe269ee..716738b268d0 100644 --- a/sw/source/core/inc/frame.hxx +++ b/sw/source/core/inc/frame.hxx @@ -671,6 +671,7 @@ public: sal_uInt16 GetVirtPageNum() const; // page number with offset sal_Bool OnRightPage() const { return 0 != GetPhyPageNum() % 2; }; sal_Bool WannaRightPage() const; + bool OnFirstPage() const; inline const SwLayoutFrm *GetPrevLayoutLeaf() const; inline const SwLayoutFrm *GetNextLayoutLeaf() const; diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx index 7ca710788cc5..7281703fe29d 100644 --- a/sw/source/core/layout/flowfrm.cxx +++ b/sw/source/core/layout/flowfrm.cxx @@ -925,8 +925,7 @@ sal_Bool SwFrm::WrongPageDesc( SwPageFrm* pNew ) if ( !pDesc ) pDesc = pNew->FindPageDesc(); - SwPageFrm* pPrevFrm = dynamic_cast<SwPageFrm*>(pNew->GetPrev()); - bool bFirst = pPrevFrm && pPrevFrm->GetPageDesc() != pDesc && !pDesc->IsFirstShared(); + bool bFirst = pNew->OnFirstPage(); const SwFlowFrm *pNewFlow = pNew->FindFirstBodyCntnt(); // Did we find ourselves? diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx index 7eaa58c879a7..42f361ef1335 100644 --- a/sw/source/core/layout/pagechg.cxx +++ b/sw/source/core/layout/pagechg.cxx @@ -1105,8 +1105,7 @@ void SwFrm::CheckPageDescs( SwPageFrm *pStart, sal_Bool bNotifyFields ) sal_Bool bCheckEmpty = pPage->IsEmptyPage(); sal_Bool bActOdd = pPage->OnRightPage(); sal_Bool bOdd = pPage->WannaRightPage(); - SwPageFrm* pPrevFrm = dynamic_cast<SwPageFrm*>(pPage->GetPrev()); - bool bFirst = pPrevFrm && pPrevFrm->GetPageDesc() != pPage->GetPageDesc() && !pDesc->IsFirstShared(); + bool bFirst = pPage->OnFirstPage(); SwFrmFmt *pFmtWish = 0; if (bFirst) pFmtWish = pDesc->GetFirstFmt(); diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx index 3c0b1e3368be..577705c916df 100644 --- a/sw/source/core/layout/trvlfrm.cxx +++ b/sw/source/core/layout/trvlfrm.cxx @@ -1811,6 +1811,23 @@ sal_Bool SwFrm::WannaRightPage() const return bOdd; } +bool SwFrm::OnFirstPage() const +{ + bool bRet = false; + const SwPageFrm *pPage = FindPageFrm(); + + if (pPage) + { + const SwPageFrm* pPrevFrm = dynamic_cast<const SwPageFrm*>(pPage->GetPrev()); + if (pPrevFrm) + { + const SwPageDesc* pDesc = pPage->GetPageDesc(); + bRet = pPrevFrm->GetPageDesc() != pDesc && !pDesc->IsFirstShared(); + } + } + return bRet; +} + /************************************************************************* |* |* SwFrm::GetVirtPageNum() |