diff options
-rw-r--r-- | sw/source/core/inc/frmtool.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/layout/frmtool.cxx | 8 | ||||
-rw-r--r-- | sw/source/core/layout/ftnfrm.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/layout/laycache.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/layout/newfrm.cxx | 3 |
5 files changed, 12 insertions, 7 deletions
diff --git a/sw/source/core/inc/frmtool.hxx b/sw/source/core/inc/frmtool.hxx index 04d740cc7cf3..3444a1771316 100644 --- a/sw/source/core/inc/frmtool.hxx +++ b/sw/source/core/inc/frmtool.hxx @@ -101,7 +101,7 @@ long CalcRowRstHeight( SwLayoutFrm *pRow ); long CalcHeightWidthFlys( const SwFrm *pFrm ); SwPageFrm *InsertNewPage( SwPageDesc &rDesc, SwFrm *pUpper, - sal_Bool bOdd, sal_Bool bInsertEmpty, sal_Bool bFtn, + sal_Bool bOdd, bool bFirst, sal_Bool bInsertEmpty, sal_Bool bFtn, SwFrm *pSibling ); // connect Flys with page diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx index 2c330680eb63..1f8576d0368a 100644 --- a/sw/source/core/layout/frmtool.cxx +++ b/sw/source/core/layout/frmtool.cxx @@ -2695,12 +2695,16 @@ sal_uLong SqRt( BigInt nX ) /*************************************************************************/ SwPageFrm * InsertNewPage( SwPageDesc &rDesc, SwFrm *pUpper, - sal_Bool bOdd, sal_Bool bInsertEmpty, sal_Bool bFtn, + sal_Bool bOdd, bool bFirst, sal_Bool bInsertEmpty, sal_Bool bFtn, SwFrm *pSibling ) { SwPageFrm *pRet; SwDoc *pDoc = ((SwLayoutFrm*)pUpper)->GetFmt()->GetDoc(); - SwFrmFmt *pFmt = bOdd ? rDesc.GetRightFmt() : rDesc.GetLeftFmt(); + SwFrmFmt *pFmt = 0; + if (bFirst) + pFmt = rDesc.GetFirstFmt(); + else + pFmt = bOdd ? rDesc.GetRightFmt() : rDesc.GetLeftFmt(); //Wenn ich kein FrmFmt fuer die Seite gefunden habe, muss ich eben //eine Leerseite einfuegen. if ( !pFmt ) diff --git a/sw/source/core/layout/ftnfrm.cxx b/sw/source/core/layout/ftnfrm.cxx index 5f78c91ee923..d469bd46947b 100644 --- a/sw/source/core/layout/ftnfrm.cxx +++ b/sw/source/core/layout/ftnfrm.cxx @@ -1646,7 +1646,7 @@ void SwFtnBossFrm::AppendFtn( SwCntntFrm *pRef, SwTxtFtn *pAttr ) { SwPageDesc *pDesc = pDoc->GetEndNoteInfo().GetPageDesc( *pDoc ); pPage = ::InsertNewPage( *pDesc, pPage->GetUpper(), - !pPage->OnRightPage(), sal_False, sal_True, 0 ); + !pPage->OnRightPage(), false, sal_False, sal_True, 0 ); pPage->SetEndNotePage( sal_True ); bChgPage = sal_True; } @@ -1690,7 +1690,7 @@ void SwFtnBossFrm::AppendFtn( SwCntntFrm *pRef, SwTxtFtn *pAttr ) { SwPageDesc *pDesc = pDoc->GetFtnInfo().GetPageDesc( *pDoc ); pPage = ::InsertNewPage( *pDesc, pPage->GetUpper(), - !pPage->OnRightPage(), sal_False, sal_True, pPage->GetNext() ); + !pPage->OnRightPage(), false, sal_False, sal_True, pPage->GetNext() ); bChgPage = sal_True; } else diff --git a/sw/source/core/layout/laycache.cxx b/sw/source/core/layout/laycache.cxx index 835d58f891a3..8416c89d6d8f 100644 --- a/sw/source/core/layout/laycache.cxx +++ b/sw/source/core/layout/laycache.cxx @@ -652,7 +652,7 @@ sal_Bool SwLayHelper::CheckInsertPage() bInsertEmpty = sal_True; } ::InsertNewPage( (SwPageDesc&)*pDesc, rpPage->GetUpper(), - bNextPageOdd, bInsertEmpty, sal_False, rpPage->GetNext() ); + bNextPageOdd, nPgNum == 1, bInsertEmpty, sal_False, rpPage->GetNext() ); if ( bEnd ) { OSL_ENSURE( rpPage->GetNext(), "No new page?" ); diff --git a/sw/source/core/layout/newfrm.cxx b/sw/source/core/layout/newfrm.cxx index 64755d591a04..96897edd16fb 100644 --- a/sw/source/core/layout/newfrm.cxx +++ b/sw/source/core/layout/newfrm.cxx @@ -555,9 +555,10 @@ void SwRootFrm::Init( SwFrmFmt* pFmt ) if ( !pDesc ) pDesc = &pDoc->GetPageDesc( 0 ); const sal_Bool bOdd = !nPgNum || 0 != ( nPgNum % 2 ); + bool bFirst = !nPgNum || 1 == nPgNum; // Create a page and put it in the layout - SwPageFrm *pPage = ::InsertNewPage( *pDesc, this, bOdd, sal_False, sal_False, 0 ); + SwPageFrm *pPage = ::InsertNewPage( *pDesc, this, bOdd, bFirst, sal_False, sal_False, 0 ); // Find the first page in the Bodytext section. SwLayoutFrm *pLay = pPage->FindBodyCont(); |