[Libreoffice-commits] .: sw/source
Miklos Vajna
vmiklos at kemper.freedesktop.org
Fri Jul 6 05:17:37 PDT 2012
sw/source/core/layout/frmtool.cxx | 9 +++------
sw/source/core/layout/laycache.cxx | 3 ---
2 files changed, 3 insertions(+), 9 deletions(-)
New commits:
commit 9ff68a2848e82e817abc96fd862a488e016c7ec5
Author: Miklos Vajna <vmiklos at suse.cz>
Date: Fri Jul 6 14:16:55 2012 +0200
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
diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx
index 1a61f72..7cb768e 100644
--- a/sw/source/core/layout/frmtool.cxx
+++ b/sw/source/core/layout/frmtool.cxx
@@ -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
diff --git a/sw/source/core/layout/laycache.cxx b/sw/source/core/layout/laycache.cxx
index a05572a..ee6a02d 100644
--- a/sw/source/core/layout/laycache.cxx
+++ b/sw/source/core/layout/laycache.cxx
@@ -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 )
More information about the Libreoffice-commits
mailing list