diff options
-rw-r--r-- | sw/inc/swrect.hxx | 12 | ||||
-rw-r--r-- | sw/source/core/bastyp/swrect.cxx | 12 | ||||
-rw-r--r-- | sw/source/core/inc/frame.hxx | 22 | ||||
-rw-r--r-- | sw/source/core/inc/rootfrm.hxx | 6 | ||||
-rw-r--r-- | sw/source/core/layout/calcmove.cxx | 145 | ||||
-rw-r--r-- | sw/source/core/layout/findfrm.cxx | 8 | ||||
-rw-r--r-- | sw/source/core/layout/newfrm.cxx | 12 | ||||
-rw-r--r-- | sw/source/core/layout/pagechg.cxx | 11 | ||||
-rw-r--r-- | sw/source/core/layout/ssfrm.cxx | 46 | ||||
-rw-r--r-- | sw/source/core/layout/wsfrm.cxx | 16 | ||||
-rw-r--r-- | sw/source/core/view/viewsh.cxx | 6 |
11 files changed, 168 insertions, 128 deletions
diff --git a/sw/inc/swrect.hxx b/sw/inc/swrect.hxx index 7090f7c15e17..3afca4fb63b7 100644 --- a/sw/inc/swrect.hxx +++ b/sw/inc/swrect.hxx @@ -2,9 +2,9 @@ * * $RCSfile: swrect.hxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: ama $ $Date: 2001-09-18 09:14:03 $ + * last change: $Author: ama $ $Date: 2001-09-19 08:37:13 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -180,6 +180,12 @@ public: const Size _Size() const; const Point SwappedPos() const; const Size SwappedSize() const; + long GetLeftDistance( long ) const; + long GetBottomDistance( long ) const; + long GetRightDistance( long ) const; + long GetTopDistance( long ) const; + BOOL OverStepLeft( long ) const; + BOOL OverStepBottom( long ) const; #endif }; @@ -191,6 +197,8 @@ typedef void (SwRect:: *SwRectSet)( const long nNew ); typedef long (SwRect:: *SwRectGet)() const; typedef const Point (SwRect:: *SwRectPoint)() const; typedef const Size (SwRect:: *SwRectSize)() const; +typedef BOOL (SwRect:: *SwRectMax)( long ) const; +typedef long (SwRect:: *SwRectDist)( long ) const; #endif //---------------------------------- Set-Methoden diff --git a/sw/source/core/bastyp/swrect.cxx b/sw/source/core/bastyp/swrect.cxx index b8eb1f4f6a90..a1a3e4370af0 100644 --- a/sw/source/core/bastyp/swrect.cxx +++ b/sw/source/core/bastyp/swrect.cxx @@ -2,9 +2,9 @@ * * $RCSfile: swrect.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: ama $ $Date: 2001-09-18 09:13:21 $ + * last change: $Author: ama $ $Date: 2001-09-19 08:39:29 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -315,6 +315,14 @@ const Point SwRect::_Pos() const { return Pos(); } const Size SwRect::_Size() const { return SSize(); } const Point SwRect::SwappedPos() const { return Point( nY, nX ); } const Size SwRect::SwappedSize() const { return Size( nHeight, nWidth ); } +long SwRect::GetLeftDistance( long nLimit ) const { return nLimit - nX; } +long SwRect::GetBottomDistance( long nLim ) const { return nY + nHeight - nLim;} +long SwRect::GetTopDistance( long nLimit ) const { return nLimit - nY; } +long SwRect::GetRightDistance( long nLim ) const { return nX + nWidth - nLim; } +BOOL SwRect::OverStepLeft( long nLimit ) const + { return nLimit > nX && nX + nWidth > nLimit; } +BOOL SwRect::OverStepBottom( long nLimit ) const + { return nLimit > nY && nY + nHeight > nLimit; } #endif #ifndef PRODUCT diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx index 8f8a887a1066..e706347d564a 100644 --- a/sw/source/core/inc/frame.hxx +++ b/sw/source/core/inc/frame.hxx @@ -2,9 +2,9 @@ * * $RCSfile: frame.hxx,v $ * - * $Revision: 1.11 $ + * $Revision: 1.12 $ * - * last change: $Author: ama $ $Date: 2001-09-18 09:12:43 $ + * last change: $Author: ama $ $Date: 2001-09-19 08:38:28 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -185,7 +185,6 @@ struct SwCrsrMoveState; class SwFrm; typedef long (SwFrm:: *SwFrmGet)() const; typedef BOOL (SwFrm:: *SwFrmMax)( long ); -typedef long (SwFrm:: *SwFrmDist)( long ) const; struct SwRectFnCollection { @@ -221,8 +220,8 @@ struct SwRectFnCollection SwFrmGet fnGetRightMargin; SwFrmGet fnGetLimit; SwFrmMax fnSetLimit; - SwFrmDist fnCheckLimit; - SwFrmMax fnOverStep; + SwRectDist fnCheckLimit; + SwRectMax fnOverStep; }; typedef SwRectFnCollection* SwRectFn; @@ -550,10 +549,11 @@ public: inline void SetDerivedVert( BOOL bNew ){ bDerivedVert = bNew ? 1 : 0; } inline void SetInvalidVert( BOOL bNew) { bInvalidVert = bNew ? 1 : 0; } inline BOOL IsRightToLeft() const; + inline BOOL GetRightToLeftFlag() const; inline void SetRightToLeft( BOOL bNew ){ bRightToLeft = bNew ? 1 : 0; } inline void SetDerivedR2L( BOOL bNew ) { bDerivedR2L = bNew ? 1 : 0; } inline void SetInvalidR2L( BOOL bNew ) { bInvalidR2L = bNew ? 1 : 0; } - void CheckVertical(); + void CheckDirChange(); #endif BOOL IsMoveable() const; @@ -757,10 +757,8 @@ public: long GetPrtBottom() const; BOOL SetMinLeft( long ); BOOL SetMaxBottom( long ); - long GetLeftDistance( long ) const; - long GetBottomDistance( long ) const; - BOOL OverStepLeft( long ); - BOOL OverStepBottom( long ); + inline BOOL SwFrm::IsNeighbourFrm() const + { return GetType() & FRM_NEIGHBOUR ? TRUE : FALSE; } #endif #ifndef PRODUCT @@ -816,6 +814,10 @@ inline BOOL SwFrm::IsRightToLeft() const ((SwFrm*)this)->SetDirFlags( FALSE ); return bRightToLeft != 0; } +BOOL SwFrm::GetRightToLeftFlag() const +{ + return bRightToLeft != 0; +} #endif inline void SwFrm::SetCompletePaint() const diff --git a/sw/source/core/inc/rootfrm.hxx b/sw/source/core/inc/rootfrm.hxx index 95af108aa52e..8ff07b7cb38a 100644 --- a/sw/source/core/inc/rootfrm.hxx +++ b/sw/source/core/inc/rootfrm.hxx @@ -2,9 +2,9 @@ * * $RCSfile: rootfrm.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: ama $ $Date: 2001-09-13 15:18:53 $ + * last change: $Author: ama $ $Date: 2001-09-19 08:39:02 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -92,7 +92,7 @@ struct SwCrsrMoveState; #define INV_TABLE 8 #define INV_SECTION 16 #define INV_LINENUM 32 -#define INV_VERTICAL 64 +#define INV_DIRECTION 64 class SwRootFrm: public SwLayoutFrm { diff --git a/sw/source/core/layout/calcmove.cxx b/sw/source/core/layout/calcmove.cxx index 18450d13a3ea..df2c0311d2c3 100644 --- a/sw/source/core/layout/calcmove.cxx +++ b/sw/source/core/layout/calcmove.cxx @@ -2,9 +2,9 @@ * * $RCSfile: calcmove.cxx,v $ * - * $Revision: 1.12 $ + * $Revision: 1.13 $ * - * last change: $Author: ama $ $Date: 2001-09-14 10:59:33 $ + * last change: $Author: ama $ $Date: 2001-09-19 08:44:06 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -535,8 +535,16 @@ void SwFrm::MakePos() if ( !bUseUpper && pPrv ) { aFrm.Pos( pPrv->Frm().Pos() ); #ifdef VERTICAL_LAYOUT - if( FRM_NEIGHBOUR & nMyType && !IsVertical() ) - aFrm.Pos().X() += pPrv->Frm().Width(); + if( FRM_NEIGHBOUR & nMyType ) + { + BOOL bR2L = IsRightToLeft(); + if( bVert ) + aFrm.Pos().Y() += bR2L ? -Frm().Height() + : pPrv->Frm().Height(); + else + aFrm.Pos().X() += bR2L ? -Frm().Width() + : pPrv->Frm().Width(); + } else if( bVert && FRM_NOTE_VERT & nMyType ) aFrm.Pos().X() -= aFrm.Width(); else @@ -557,8 +565,16 @@ void SwFrm::MakePos() if ( !bUseUpper && pPrv ) { aFrm.Pos( pPrv->Frm().Pos() ); #ifdef VERTICAL_LAYOUT - if( FRM_NEIGHBOUR & nMyType && !IsVertical() ) - aFrm.Pos().X() += pPrv->Frm().Width(); + if( FRM_NEIGHBOUR & nMyType ) + { + BOOL bR2L = IsRightToLeft(); + if( bVert ) + aFrm.Pos().Y() += bR2L ? -Frm().Height() + : pPrv->Frm().Height(); + else + aFrm.Pos().X() += bR2L ? -Frm().Width() + : pPrv->Frm().Width(); + } else if( bVert && FRM_NOTE_VERT & nMyType ) aFrm.Pos().X() -= aFrm.Width(); else @@ -572,7 +588,16 @@ void SwFrm::MakePos() aFrm.Pos( GetUpper()->Frm().Pos() ); aFrm.Pos() += GetUpper()->Prt().Pos(); #ifdef VERTICAL_LAYOUT - if( bVert && FRM_NOTE_VERT & nMyType ) + if( FRM_NEIGHBOUR & nMyType && IsRightToLeft() ) + { + if( bVert ) + aFrm.Pos().Y() += GetUpper()->Prt().Height() + - aFrm.Height(); + else + aFrm.Pos().X() += GetUpper()->Prt().Width() + - aFrm.Width(); + } + else if( bVert && FRM_NOTE_VERT & nMyType ) aFrm.Pos().X() -= aFrm.Width() - GetUpper()->Prt().Width(); #endif } @@ -601,6 +626,9 @@ void lcl_CheckObjects( SwSortDrawObjs* pSortedObjs, SwFrm* pFrm, long& rBot ) //Und dann kann es natuerlich noch Absatzgebundene //Rahmen geben, die unterhalb ihres Absatzes stehen. long nMax = 0; +#ifdef VERTICAL_LAYOUT + SwRectFn fnRect = pFrm->IsVertical() ? fnRectVert : fnRectHori; +#endif for ( USHORT i = 0; i < pSortedObjs->Count(); ++i ) { SdrObject *pObj = (*pSortedObjs)[i]; @@ -614,6 +642,18 @@ void lcl_CheckObjects( SwSortDrawObjs* pSortedObjs, SwFrm* pFrm, long& rBot ) ( pFrm->IsBodyFrm() ? pFly->GetAnchor()->IsInDocBody() : pFly->GetAnchor()->IsInFtn() ) ) ) ) { +#ifdef VERTICAL_LAYOUT + nTmp = (pFly->Frm().*fnRect->fnGetBottom)(); + } + } + else + { + SwRect aTmpRect( pObj->GetBoundRect() ); + nTmp = (aTmpRect.*fnRect->fnGetBottom)(); + } + nMax = Max( nTmp, nMax ); + } +#else nTmp = pFly->Frm().Bottom(); } } @@ -622,6 +662,7 @@ void lcl_CheckObjects( SwSortDrawObjs* pSortedObjs, SwFrm* pFrm, long& rBot ) nMax = Max( nTmp, nMax ); } ++nMax; //Unterkante vs. Hoehe! +#endif rBot = Max( rBot, nMax ); } @@ -779,7 +820,7 @@ void SwLayoutFrm::MakeAll() //uebernimmt im DTor die Benachrichtigung const SwLayNotify aNotify( this ); #ifdef VERTICAL_LAYOUT - const SzPtr pFix = ( bVarHeight == IsVertical() ) ? pHeight : pWidth; + SwRectFn fnRect = ( bVarHeight == IsVertical() )? fnRectVert : fnRectHori; #else const SzPtr pFix = pFIXSIZE; #endif @@ -798,41 +839,21 @@ void SwLayoutFrm::MakeAll() { //FixSize einstellen, die VarSize wird von Format() nach //Berechnung der PrtArea eingestellt. - aFrm.SSize().*pFix = GetUpper()->Prt().SSize().*pFix; bValidPrtArea = FALSE; +#ifdef VERTICAL_LAYOUT + (aFrm.*fnRect->fnSetWidth)( + (GetUpper()->Prt().*fnRect->fnGetWidth)() ); } else - { //nicht ueber die auessere Kante des Upper hinausragen. -#ifdef VERTICAL_LAYOUT - SwTwips nDeadLine; - SwTwips nBot; - if( pFix == pWidth ) - { - nDeadLine = GetUpper()->Frm().Top() + - GetUpper()->Prt().Top() + GetUpper()->Prt().Height(); - nBot = Frm().Top() + Frm().Height(); - if ( nBot > nDeadLine ) - bValidSize = FALSE; - } - else - { - nDeadLine = GetUpper()->Frm().Left() - + GetUpper()->Prt().Left(); - nBot = Frm().Left(); - if( bVarHeight ) - { - if( nBot < nDeadLine ) - bValidSize = FALSE; - } - else - { - nDeadLine += GetUpper()->Prt().Width(); - nBot += Frm().Width(); - if ( nBot > nDeadLine ) - bValidSize = FALSE; - } - } + { // Don't leave your upper + const SwTwips nDeadLine = (GetUpper()->*fnRect->fnGetLimit)(); + if( (Frm().*fnRect->fnOverStep)( nDeadLine ) ) + bValidSize = FALSE; #else + aFrm.SSize().*pFix = GetUpper()->Prt().SSize().*pFix; + } + else + { //nicht ueber die auessere Kante des Upper hinausragen. const SwTwips nDeadLine = GetUpper()->Frm().Pos().*pVARPOS + (bVarHeight ? GetUpper()->Prt().Top() + GetUpper()->Prt().Height() : @@ -1163,18 +1184,14 @@ void SwCntntFrm::MakeAll() const BOOL bTab = IsInTab(); const BOOL bFtn = IsInFtn(); const BOOL bSct = IsInSct(); + Point aOldFrmPos; //Damit bei Turnarounds jew. mit der + Point aOldPrtPos; //letzten Pos verglichen und geprueft + //werden kann, ob ein Prepare sinnvoll ist. #ifdef VERTICAL_LAYOUT const FASTBOOL bVert = IsVertical(); - SwRectFn fnRect = IsVertical() ? fnRectVert : fnRectHori; + SwRectFn fnRect = bVert ? fnRectVert : fnRectHori; long nKeepBottom = (Frm().*fnRect->fnGetBottom)(); - long nOldFrmX; - long nOldFrmY; - long nOldPrtX; - long nOldPrtY; #else - Point aOldFrmPos; //Damit bei Turnarounds jew. mit der - Point aOldPrtPos; //letzten Pos verglichen und geprueft - //werden kann, ob ein Prepare sinnvoll ist. long nKeepBottom = Frm().Bottom(); //Um beim Keep den naechsten sinnvoll //anstossen zu koennen. #endif @@ -1232,10 +1249,8 @@ void SwCntntFrm::MakeAll() } #ifdef VERTICAL_LAYOUT - nOldFrmX = (Frm().*fnRect->fnGetLeft)(); - nOldFrmY = (Frm().*fnRect->fnGetTop)(); - nOldPrtX = (Prt().*fnRect->fnGetLeft)(); - nOldPrtY = (Prt().*fnRect->fnGetTop)(); + aOldFrmPos = (Frm().*fnRect->fnGetPos)(); + aOldPrtPos = (Prt().*fnRect->fnGetPos)(); if ( !bValidPos ) MakePos(); @@ -1252,8 +1267,7 @@ void SwCntntFrm::MakeAll() Prepare( PREP_FIXSIZE_CHG ); } - if ( nOldFrmX != (Frm().*fnRect->fnGetLeft)() || - nOldFrmY != (Frm().*fnRect->fnGetTop)() ) + if ( aOldFrmPos != (Frm().*fnRect->fnGetPos)() ) CalcFlys( TRUE ); #else aOldFrmPos = Frm().Pos(); @@ -1287,15 +1301,13 @@ void SwCntntFrm::MakeAll() #ifdef VERTICAL_LAYOUT const SwTwips nDeadLine = (GetUpper()->*fnRect->fnGetLimit)(); if ( bMoveable && !bFormatted && ( GetFollow() || - ( (this->*fnRect->fnOverStep)( nDeadLine ) ) ) ) + ( (Frm().*fnRect->fnOverStep)( nDeadLine ) ) ) ) { Prepare( PREP_WIDOWS_ORPHANS, 0, FALSE ); bValidSize = bWidow = FALSE; } - if( (Frm().*fnRect->fnGetLeft)() != nOldFrmX || - (Frm().*fnRect->fnGetTop)() != nOldFrmY || - (Prt().*fnRect->fnGetLeft)() != nOldPrtX || - (Prt().*fnRect->fnGetTop)() != nOldPrtY ) + if( (Frm().*fnRect->fnGetPos)() != aOldFrmPos || + (Prt().*fnRect->fnGetPos)() != aOldPrtPos ) #else const SwTwips nDeadLine = GetUpper()->Prt().Bottom() + GetUpper()->Frm().Top(); @@ -1340,11 +1352,9 @@ void SwCntntFrm::MakeAll() bMoveable = IsMoveable(); } #ifdef VERTICAL_LAYOUT - long nOldX = (Frm().*fnRect->fnGetLeft)(); - long nOldY = (Frm().*fnRect->fnGetTop)(); + Point aOldPos = (Frm().*fnRect->fnGetPos)(); MakePos(); - if( nOldX != (Frm().*fnRect->fnGetLeft)() || - nOldY != (Frm().*fnRect->fnGetTop)() ) + if( aOldPos != (Frm().*fnRect->fnGetPos)() ) { CalcFlys( TRUE ); Prepare( PREP_POS_CHGD, (const void*)&bFormatted, FALSE ); @@ -1430,10 +1440,8 @@ void SwCntntFrm::MakeAll() { bValidPos = FALSE; MakePos(); #ifdef VERTICAL_LAYOUT - nOldFrmX = (Frm().*fnRect->fnGetLeft)(); - nOldFrmY = (Frm().*fnRect->fnGetTop)(); - nOldPrtX = (Prt().*fnRect->fnGetLeft)(); - nOldPrtY = (Prt().*fnRect->fnGetTop)(); + aOldFrmPos = (Frm().*fnRect->fnGetPos)(); + aOldPrtPos = (Prt().*fnRect->fnGetPos)(); #else aOldFrmPos = Frm().Pos(); aOldPrtPos = Prt().Pos(); @@ -1449,7 +1457,8 @@ void SwCntntFrm::MakeAll() // Achtung, wg. Hoehe==0, ist es besser statt Bottom() Top()+Height() zu nehmen // (kommt bei Undersized TxtFrms an der Unterkante eines spaltigen Bereichs vor) #ifdef VERTICAL_LAYOUT - if((this->*fnRect->fnCheckLimit)((GetUpper()->*fnRect->fnGetLimit)())>0) + if( (Frm().*fnRect->fnCheckLimit)( (GetUpper()->*fnRect->fnGetLimit)() ) + <= 0 ) #else if ( GetUpper()->Prt().Top()+GetUpper()->Prt().Height()+GetUpper()->Frm().Top() >= Frm().Top()+Frm().Height() ) @@ -1511,7 +1520,7 @@ void SwCntntFrm::MakeAll() if( !bMoveable && IsInTab() ) { #ifdef VERTICAL_LAYOUT - long nDiff = (this->*fnRect->fnCheckLimit)( + long nDiff = (Frm().*fnRect->fnCheckLimit)( (GetUpper()->*fnRect->fnGetLimit)() ); #else long nDiff = Frm().Top()+Frm().Height() -GetUpper()->Prt().Top() diff --git a/sw/source/core/layout/findfrm.cxx b/sw/source/core/layout/findfrm.cxx index 61ba06449ad8..00b595c63a56 100644 --- a/sw/source/core/layout/findfrm.cxx +++ b/sw/source/core/layout/findfrm.cxx @@ -2,9 +2,9 @@ * * $RCSfile: findfrm.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: ama $ $Date: 2001-08-23 16:21:29 $ + * last change: $Author: ama $ $Date: 2001-09-19 08:45:10 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1123,9 +1123,11 @@ void SwFrm::SetDirFlags( BOOL bVert ) if( bDerivedR2L ) { SwFrm* pAsk = IsFlyFrm() ? - GetUpper() : ((SwFlyFrm*)this)->GetAnchor(); + ((SwFlyFrm*)this)->GetAnchor() : GetUpper(); bRightToLeft = pAsk && pAsk->IsRightToLeft() ? 1 : 0; } + else + CheckDirection( bVert ); bInvalidR2L = 0; } } diff --git a/sw/source/core/layout/newfrm.cxx b/sw/source/core/layout/newfrm.cxx index 53318890ba1b..00cbfa3ba17b 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.8 $ + * $Revision: 1.9 $ * - * last change: $Author: ama $ $Date: 2001-09-18 09:12:13 $ + * last change: $Author: ama $ $Date: 2001-09-19 08:43:05 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -178,8 +178,8 @@ static SwRectFnCollection aHorizontal = { &SwFrm::GetRightMargin, &SwFrm::GetPrtBottom, &SwFrm::SetMaxBottom, - &SwFrm::GetBottomDistance, - &SwFrm::OverStepBottom + &SwRect::GetBottomDistance, + &SwRect::OverStepBottom }; static SwRectFnCollection aVertical = { @@ -216,8 +216,8 @@ static SwRectFnCollection aVertical = { &SwFrm::GetBottomMargin, &SwFrm::GetPrtLeft, &SwFrm::SetMinLeft, - &SwFrm::GetLeftDistance, - &SwFrm::OverStepLeft + &SwRect::GetLeftDistance, + &SwRect::OverStepLeft }; SwRectFn fnRectHori = &aHorizontal; diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx index 1481dbda0a95..30a97dca10a8 100644 --- a/sw/source/core/layout/pagechg.cxx +++ b/sw/source/core/layout/pagechg.cxx @@ -2,9 +2,9 @@ * * $RCSfile: pagechg.cxx,v $ * - * $Revision: 1.10 $ + * $Revision: 1.11 $ * - * last change: $Author: ama $ $Date: 2001-09-13 15:19:59 $ + * last change: $Author: ama $ $Date: 2001-09-19 08:44:45 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -207,6 +207,7 @@ SwPageFrm::SwPageFrm( SwFrmFmt *pFmt, SwPageDesc *pPgDsc ) : #ifdef VERTICAL_LAYOUT // Test SetDerivedVert( FALSE ); + SetDerivedR2L( FALSE ); #endif SetMaxFtnHeight( pPgDsc->GetFtnInfo().GetHeight() ? pPgDsc->GetFtnInfo().GetHeight() : LONG_MAX ), @@ -318,8 +319,10 @@ void SwPageFrm::CheckDirection( BOOL bVert ) } else { - if( GetFmt()->GetName().GetChar(1)=='x') + if( pDesc && pDesc->GetName().GetChar(1)=='x') bRightToLeft = 1; + else + bRightToLeft = 0; bInvalidR2L = 0; } } @@ -559,7 +562,7 @@ void SwPageFrm::_UpdateAttr( SfxPoolItem *pOld, SfxPoolItem *pNew, case RES_FRM_SIZE: { #ifdef VERTICAL_LAYOUT - CheckVertical(); + CheckDirChange(); #endif const SwRect aOldRect( Frm() ); if ( GetFmt()->GetDoc()->IsBrowseMode() ) diff --git a/sw/source/core/layout/ssfrm.cxx b/sw/source/core/layout/ssfrm.cxx index 55189d922703..0f4defe4fa31 100644 --- a/sw/source/core/layout/ssfrm.cxx +++ b/sw/source/core/layout/ssfrm.cxx @@ -2,9 +2,9 @@ * * $RCSfile: ssfrm.cxx,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: ama $ $Date: 2001-09-17 11:20:17 $ + * last change: $Author: ama $ $Date: 2001-09-19 08:42:02 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -106,14 +106,6 @@ long SwFrm::GetPrtLeft() const { return Frm().Left() + Prt().Left(); } long SwFrm::GetPrtBottom() const { return Frm().Top() + Prt().Height() + Prt().Top(); } -long SwFrm::GetLeftDistance( long nLimit ) const - { return nLimit - Frm().Left(); } -long SwFrm::GetBottomDistance( long nLimit ) const - { return Frm().Top() + Frm().Height() - nLimit; } -BOOL SwFrm::OverStepLeft( long nLimit ) - { return nLimit > Frm().Left() && Frm().Left() + Frm().Width() > nLimit; } -BOOL SwFrm::OverStepBottom( long nLimit ) - { return nLimit > Frm().Top() && Frm().Top() + Frm().Height() > nLimit; } BOOL SwFrm::SetMinLeft( long nDeadline ) { @@ -140,16 +132,19 @@ BOOL SwFrm::SetMaxBottom( long nDeadline ) } /*-----------------11.9.2001 11:11------------------ - * SwFrm::CheckVertical(..) - * checks the horizontal/vertical direction and + * SwFrm::CheckDirChange(..) + * checks the layout direction and * invalidates the lower frames rekursivly, if necessary. * --------------------------------------------------*/ -void SwFrm::CheckVertical() +void SwFrm::CheckDirChange() { - BOOL bOld = GetVerticalFlag(); + BOOL bOldVert = GetVerticalFlag(); + BOOL bOldR2L = GetRightToLeftFlag(); SetInvalidVert( TRUE ); - if( IsVertical() != bOld && IsLayoutFrm() ) + SetInvalidR2L( TRUE ); + BOOL bChg = bOldR2L != IsRightToLeft(); + if( ( ( IsVertical() != bOldVert ) || bChg ) && IsLayoutFrm() ) { InvalidateAll(); SwFrm* pFrm = ((SwLayoutFrm*)this)->Lower(); @@ -165,7 +160,7 @@ void SwFrm::CheckVertical() } while( pFrm ) { - pFrm->CheckVertical(); + pFrm->CheckDirChange(); pFrm = pFrm->GetNext(); } if( pCol ) @@ -380,15 +375,27 @@ const SwRect SwFrm::PaintArea() const } else if( pTmp->IsColumnFrm() ) // nobody enters neightbour columns { - if( pTmp->GetPrev() ) // the first column has _no_ - { // influence to the left range #ifdef VERTICAL_LAYOUT + BOOL bR2L = pTmp->IsRightToLeft(); + // the first column has _no_ influence to the left range + if( bR2L ? pTmp->GetNext() : pTmp->GetPrev() ) + { if( bLeft || nLeft < nTmpLeft ) nLeft = nTmpLeft; + bLeft = FALSE; + } + // the last column has _no_ influence to the right range + if( bR2L ? pTmp->GetPrev() : pTmp->GetNext() ) + { + if( bRight || nTmpRight < nRight ) + nRight = nTmpRight; + bRight = FALSE; + } #else + if( pTmp->GetPrev() ) // the first column has _no_ + { // influence to the left range if( bLeft || aRect.Left() < pTmp->Frm().Left() ) aRect.Left( pTmp->Frm().Left() ); -#endif bLeft = FALSE; } if( pTmp->GetNext() ) // the last column has _no_ @@ -397,6 +404,7 @@ const SwRect SwFrm::PaintArea() const nRight = nTmpRight; bRight = FALSE; } +#endif } #ifdef VERTICAL_LAYOUT else if( bVert && pTmp->IsBodyFrm() ) diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx index 8d4b459127df..75f5c1ad47e1 100644 --- a/sw/source/core/layout/wsfrm.cxx +++ b/sw/source/core/layout/wsfrm.cxx @@ -2,9 +2,9 @@ * * $RCSfile: wsfrm.cxx,v $ * - * $Revision: 1.9 $ + * $Revision: 1.10 $ * - * last change: $Author: ama $ $Date: 2001-09-13 15:20:41 $ + * last change: $Author: ama $ $Date: 2001-09-19 08:42:32 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -3376,8 +3376,8 @@ void lcl_InvalidateAllCntnt( SwCntntFrm *pCnt, BYTE nInv ) { ::lcl_InvalidateCntnt( pFly->ContainsCntnt(), nInv ); #ifdef VERTICAL_LAYOUT - if( nInv & INV_VERTICAL ) - pFly->CheckVertical(); + if( nInv & INV_DIRECTION ) + pFly->CheckDirChange(); #endif } } @@ -3408,15 +3408,15 @@ void SwRootFrm::InvalidateAllCntnt( BYTE nInv ) ::lcl_InvalidateCntnt( ((SwVirtFlyDrawObj*)pO)->GetFlyFrm()->ContainsCntnt(), nInv ); #ifdef VERTICAL_LAYOUT - if( nInv & INV_VERTICAL ) - ((SwVirtFlyDrawObj*)pO)->GetFlyFrm()->CheckVertical(); + if( nInv & INV_DIRECTION ) + ((SwVirtFlyDrawObj*)pO)->GetFlyFrm()->CheckDirChange(); #endif } } } #ifdef VERTICAL_LAYOUT - if( nInv & INV_VERTICAL ) - pPage->CheckVertical(); + if( nInv & INV_DIRECTION ) + pPage->CheckDirChange(); #endif pPage = (SwPageFrm*)(pPage->GetNext()); } diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx index 5311fa03d9a6..ef99d01ba6d4 100644 --- a/sw/source/core/view/viewsh.cxx +++ b/sw/source/core/view/viewsh.cxx @@ -2,9 +2,9 @@ * * $RCSfile: viewsh.cxx,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: ama $ $Date: 2001-09-13 15:21:31 $ + * last change: $Author: ama $ $Date: 2001-09-19 08:39:54 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1673,7 +1673,7 @@ void ViewShell::CheckBrowseView( FASTBOOL bBrowseChgd ) // Beim BrowseModus-Wechsel benoetigen die CntntFrms // wg. der Drucker/Bildschirmformatierung eine Size-Invalidierung if( bBrowseChgd ) - nInv |= INV_SIZE | INV_VERTICAL; + nInv |= INV_SIZE | INV_DIRECTION; GetLayout()->InvalidateAllCntnt( nInv ); |