diff options
-rw-r--r-- | sw/source/core/layout/frmtool.cxx | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx index 1f190aa0f87b..815ffcdd6d8c 100644 --- a/sw/source/core/layout/frmtool.cxx +++ b/sw/source/core/layout/frmtool.cxx @@ -2742,10 +2742,28 @@ SwPageFrm * InsertNewPage( SwPageDesc &rDesc, SwFrm *pUpper, SwPageFrm *pRet; SwDoc *pDoc = ((SwLayoutFrm*)pUpper)->GetFmt()->GetDoc(); SwFrmFmt *pFmt = 0; - // 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.IsFirstShared()) + if (bFirst) + { + if (rDesc.IsFirstShared()) + { + // We need to fallback to left or right page format, decide it now. + if (bOdd) + { + rDesc.GetFirst().SetFmtAttr( rDesc.GetMaster().GetHeader() ); + rDesc.GetFirst().SetFmtAttr( rDesc.GetMaster().GetFooter() ); + } + else + { + rDesc.GetFirst().SetFmtAttr( rDesc.GetLeft().GetHeader() ); + rDesc.GetFirst().SetFmtAttr( rDesc.GetLeft().GetFooter() ); + } + } pFmt = rDesc.GetFirstFmt(); + 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 |