Kaydet (Commit) 9ff68a28 authored tarafından Miklos Vajna's avatar Miklos Vajna

sw: InsertNewPage() should ignore GetFirstFmt() if it's shared

This allows to get rid of the ugly hack in
SwLayHelper::CheckInsertPage() and has the same effect.

Change-Id: I491eb617c42bbca3ca1676d7bf44795e947ce6f9
üst 180a6725
......@@ -2701,13 +2701,10 @@ SwPageFrm * InsertNewPage( SwPageDesc &rDesc, SwFrm *pUpper,
SwPageFrm *pRet;
SwDoc *pDoc = ((SwLayoutFrm*)pUpper)->GetFmt()->GetDoc();
SwFrmFmt *pFmt = 0;
if (bFirst)
{
// rDesc can't know if the first page will be 'left' or 'right', so if
// first is shared, let's ignore first here.
if (bFirst && !rDesc.IsHeaderSharedFirst())
pFmt = rDesc.GetFirstFmt();
// If there is no first format, use what is relevant anyway.
if (!pFmt)
pFmt = bOdd ? rDesc.GetRightFmt() : rDesc.GetLeftFmt();
}
else
pFmt = bOdd ? rDesc.GetRightFmt() : rDesc.GetLeftFmt();
//Wenn ich kein FrmFmt fuer die Seite gefunden habe, muss ich eben
......
......@@ -654,9 +654,6 @@ sal_Bool SwLayHelper::CheckInsertPage()
}
// If the page style is changing, we'll have a first page.
bool bNextPageFirst = pDesc != rpPage->GetPageDesc();
// Considering the page after the first page would be confusing.
if (rpPage->GetPageDesc() == pDoc->GetPageDescFromPool(RES_POOLPAGE_FIRST))
bNextPageFirst = false;
::InsertNewPage( (SwPageDesc&)*pDesc, rpPage->GetUpper(),
bNextPageOdd, bNextPageFirst, bInsertEmpty, sal_False, rpPage->GetNext() );
if ( bEnd )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment