summaryrefslogtreecommitdiffstats
path: root/sw/source/core/layout/flowfrm.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/core/layout/flowfrm.cxx')
-rw-r--r--sw/source/core/layout/flowfrm.cxx18
1 files changed, 9 insertions, 9 deletions
diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx
index fb87c6025061..c84bc17f9359 100644
--- a/sw/source/core/layout/flowfrm.cxx
+++ b/sw/source/core/layout/flowfrm.cxx
@@ -847,7 +847,7 @@ bool SwFrame::WrongPageDesc( SwPageFrame* pNew )
//My Pagedesc doesn't count if I'm a follow!
const SwPageDesc *pDesc = nullptr;
- int nTmp = 0;
+ boost::optional<sal_uInt16> oTmp;
SwFlowFrame *pFlow = SwFlowFrame::CastFlowFrame( this );
if ( !pFlow || !pFlow->IsFollow() )
{
@@ -856,18 +856,18 @@ bool SwFrame::WrongPageDesc( SwPageFrame* pNew )
if( pDesc )
{
if( !pDesc->GetRightFormat() )
- nTmp = 2;
+ oTmp = 2;
else if( !pDesc->GetLeftFormat() )
- nTmp = 1;
+ oTmp = 1;
else if( rFormatDesc.GetNumOffset() )
- nTmp = rFormatDesc.GetNumOffset().get();
+ oTmp = rFormatDesc.GetNumOffset();
}
}
// Does the Content bring a Pagedesc or do we need the
// virtual page number of the new layout leaf?
// PageDesc isn't allowed with Follows
- const bool bOdd = nTmp ? (nTmp % 2) !=0 : pNew->OnRightPage();
+ const bool isRightPage = oTmp ? sw::IsRightPageByNumber(*mpRoot, *oTmp) : pNew->OnRightPage();
if ( !pDesc )
pDesc = pNew->FindPageDesc();
@@ -885,14 +885,14 @@ bool SwFrame::WrongPageDesc( SwPageFrame* pNew )
SAL_INFO( "sw.pageframe", "WrongPageDesc p: " << pNew << " phys: " << pNew->GetPhyPageNum() );
SAL_INFO( "sw.pageframe", "WrongPageDesc " << pNew->GetPageDesc() << " " << pDesc );
- SAL_INFO( "sw.pageframe", "WrongPageDesc odd: " << bOdd
+ SAL_INFO( "sw.pageframe", "WrongPageDesc right: " << isRightPage
<< " first: " << bFirst << " " << pNew->GetFormat() << " == "
- << (bOdd ? pDesc->GetRightFormat(bFirst) : pDesc->GetLeftFormat(bFirst)) << " "
- << (bOdd ? pDesc->GetLeftFormat(bFirst) : pDesc->GetRightFormat(bFirst)) );
+ << (isRightPage ? pDesc->GetRightFormat(bFirst) : pDesc->GetLeftFormat(bFirst)) << " "
+ << (isRightPage ? pDesc->GetLeftFormat(bFirst) : pDesc->GetRightFormat(bFirst)) );
return (pNew->GetPageDesc() != pDesc) // own desc ?
|| (pNew->GetFormat() !=
- (bOdd ? pDesc->GetRightFormat(bFirst) : pDesc->GetLeftFormat(bFirst)))
+ (isRightPage ? pDesc->GetRightFormat(bFirst) : pDesc->GetLeftFormat(bFirst)))
|| (pNewDesc && pNewDesc == pDesc);
}