summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorAndreas Martens <ama@openoffice.org>2001-03-02 09:47:13 +0000
committerAndreas Martens <ama@openoffice.org>2001-03-02 09:47:13 +0000
commit03a3677c1ae676830b1619b5ef96ba511e9cfd60 (patch)
tree792f950a8a60833f172a417945a74aea3888d288 /sw/source
parent1a7ae2937ebb7badae51bcc15d059ec985316825 (diff)
Fix #65244#: Right and left pages, virtual page numbering
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/core/layout/flowfrm.cxx22
-rw-r--r--sw/source/core/layout/fly.cxx7
-rw-r--r--sw/source/core/layout/flycnt.cxx6
-rw-r--r--sw/source/core/layout/ftnfrm.cxx12
-rw-r--r--sw/source/core/layout/newfrm.cxx14
5 files changed, 37 insertions, 24 deletions
diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx
index 985f602f3e31..3f39b4531e0d 100644
--- a/sw/source/core/layout/flowfrm.cxx
+++ b/sw/source/core/layout/flowfrm.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: flowfrm.cxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: ama $ $Date: 2000-10-30 16:22:11 $
+ * last change: $Author: ama $ $Date: 2001-03-02 10:47:13 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -761,17 +761,27 @@ BOOL SwFrm::WrongPageDesc( SwPageFrm* pNew )
//Mein Pagedesc zaehlt nicht, wenn ich ein Follow bin!
SwPageDesc *pDesc = 0;
+ USHORT nTmp = 0;
SwFlowFrm *pFlow = SwFlowFrm::CastFlowFrm( this );
if ( !pFlow || !pFlow->IsFollow() )
+ {
pDesc = (SwPageDesc*)rFmtDesc.GetPageDesc();
+ if( pDesc )
+ {
+ if( !pDesc->GetRightFmt() )
+ nTmp = 2;
+ else if( !pDesc->GetLeftFmt() )
+ nTmp = 1;
+ else if( rFmtDesc.GetNumOffset() )
+ nTmp = rFmtDesc.GetNumOffset();
+ }
+ }
//Bringt der Cntnt einen Pagedesc mit oder muss zaehlt die
//virtuelle Seitennummer des neuen Layoutleafs?
// Bei Follows zaehlt der PageDesc nicht
- const USHORT nTmp = ( pDesc && rFmtDesc.GetNumOffset() )
- ? rFmtDesc.GetNumOffset()
- : pNew->GetVirtPageNum();
- const BOOL bOdd = nTmp % 2 ? TRUE : FALSE;
+ const BOOL bOdd = nTmp ? ( nTmp % 2 ? TRUE : FALSE )
+ : pNew->OnRightPage();
if ( !pDesc )
pDesc = pNew->FindPageDesc();
const SwFlowFrm *pNewFlow = pNew->FindFirstBodyCntnt();
diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx
index 05c243aa8920..896d5009ffbb 100644
--- a/sw/source/core/layout/fly.cxx
+++ b/sw/source/core/layout/fly.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: fly.cxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: ama $ $Date: 2000-10-11 12:16:07 $
+ * last change: $Author: ama $ $Date: 2001-03-02 10:42:31 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1499,8 +1499,7 @@ void SwFlyFrm::MakeFlyPos()
//Jetzt die Horizontale Position
- const BOOL bToggle = aHori.IsPosToggle() &&
- !(FindPageFrm()->GetVirtPageNum() % 2);
+ const BOOL bToggle = aHori.IsPosToggle()&&!FindPageFrm()->OnRightPage();
BOOL bTmpToggle = bToggle;
//und wieder erst der Bezugsrahmen
SwTwips nRel, nAdd;
diff --git a/sw/source/core/layout/flycnt.cxx b/sw/source/core/layout/flycnt.cxx
index d21be35901e0..5ffd14ae4597 100644
--- a/sw/source/core/layout/flycnt.cxx
+++ b/sw/source/core/layout/flycnt.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: flycnt.cxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: ama $ $Date: 2000-10-10 12:19:47 $
+ * last change: $Author: ama $ $Date: 2001-03-02 10:43:36 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1712,7 +1712,7 @@ void SwFlyAtCntFrm::MakeFlyPos()
pPage = pPage->GetUpper();
}
- const BOOL bEven = !(pPage->FindPageFrm()->GetVirtPageNum() % 2);
+ const BOOL bEven = !pPage->OnRightPage();
const BOOL bToggle = aHori.IsPosToggle() && bEven;
BOOL bTmpToggle = bToggle;
BOOL bPageRel = FALSE;
diff --git a/sw/source/core/layout/ftnfrm.cxx b/sw/source/core/layout/ftnfrm.cxx
index 7f26f79b06bc..8aad1aecc0af 100644
--- a/sw/source/core/layout/ftnfrm.cxx
+++ b/sw/source/core/layout/ftnfrm.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ftnfrm.cxx,v $
*
- * $Revision: 1.1.1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: hr $ $Date: 2000-09-19 00:08:22 $
+ * last change: $Author: ama $ $Date: 2001-03-02 10:45:12 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1757,8 +1757,8 @@ void SwFtnBossFrm::AppendFtn( SwCntntFrm *pRef, SwTxtFtn *pAttr )
if ( !pPage->IsEndNotePage() )
{
SwPageDesc *pDesc = pDoc->GetEndNoteInfo().GetPageDesc( *pDoc );
- BOOL bOdd = pPage->GetVirtPageNum() % 2 ? FALSE : TRUE;
- pPage = ::InsertNewPage( *pDesc, pPage->GetUpper(), bOdd, TRUE, 0 );
+ pPage = ::InsertNewPage( *pDesc, pPage->GetUpper(),
+ !pPage->OnRightPage(), FALSE, TRUE, 0 );
pPage->SetEndNotePage( TRUE );
bChgPage = TRUE;
}
@@ -1801,8 +1801,8 @@ void SwFtnBossFrm::AppendFtn( SwCntntFrm *pRef, SwTxtFtn *pAttr )
if ( !pPage->IsFtnPage() )
{
SwPageDesc *pDesc = pDoc->GetFtnInfo().GetPageDesc( *pDoc );
- BOOL bOdd = pPage->GetVirtPageNum() % 2 ? FALSE : TRUE;
- pPage = ::InsertNewPage( *pDesc, pPage->GetUpper(), bOdd, TRUE, pPage->GetNext() );
+ pPage = ::InsertNewPage( *pDesc, pPage->GetUpper(),
+ !pPage->OnRightPage(), FALSE, TRUE, pPage->GetNext() );
bChgPage = TRUE;
}
else
diff --git a/sw/source/core/layout/newfrm.cxx b/sw/source/core/layout/newfrm.cxx
index 765aae762d1d..5c3e71dcb6d1 100644
--- a/sw/source/core/layout/newfrm.cxx
+++ b/sw/source/core/layout/newfrm.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: newfrm.cxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: jp $ $Date: 2000-10-30 20:32:29 $
+ * last change: $Author: ama $ $Date: 2001-03-02 10:41:34 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -123,6 +123,9 @@
#ifndef _NOTXTFRM_HXX
#include <notxtfrm.hxx>
#endif
+#ifndef _PAGEDESC_HXX
+#include <pagedesc.hxx>
+#endif
PtPtr pX = &Point::nA;
@@ -332,13 +335,14 @@ SwRootFrm::SwRootFrm( SwFrmFmt *pFmt, ViewShell * pSh ) :
//#19104# Seitennummeroffset beruecksictigen!!
bIsVirtPageNum = 0 != ( nPgNum = rDesc.GetNumOffset() );
}
+ else
+ bIsVirtPageNum = FALSE;
if ( !pDesc )
pDesc = (SwPageDesc*)&pDoc->GetPageDesc( 0 );
- if( !nPgNum )
- nPgNum = 1;
+ const BOOL bOdd = !nPgNum || 0 != ( nPgNum % 2 );
//Eine Seite erzeugen und in das Layout stellen
- SwPageFrm *pPage = ::InsertNewPage( *pDesc, this, 0 != nPgNum % 2 , FALSE, 0 );
+ SwPageFrm *pPage = ::InsertNewPage( *pDesc, this, bOdd, FALSE, FALSE, 0 );
//Erstes Blatt im Bodytext-Bereich suchen.
SwLayoutFrm *pLay = pPage->FindBodyCont();