diff options
author | Michael Stahl <mstahl@redhat.com> | 2011-12-22 18:22:03 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2011-12-22 18:22:59 +0100 |
commit | e7c096471d05cc979fff7a9e5fcc2ad6a7e4ac54 (patch) | |
tree | 254048657034062f0dad8814dd5e04aeddac10b1 /sw | |
parent | 062eaeffe7cb986255063bb9b0a5f3fb3fc8e34c (diff) |
sw: translate some comments, and s/sal_Bool/bool/
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/inc/flowfrm.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/layout/calcmove.cxx | 49 | ||||
-rw-r--r-- | sw/source/core/layout/flowfrm.cxx | 8 | ||||
-rw-r--r-- | sw/source/core/layout/tabfrm.cxx | 57 |
4 files changed, 63 insertions, 53 deletions
diff --git a/sw/source/core/inc/flowfrm.hxx b/sw/source/core/inc/flowfrm.hxx index e1c47c2db351..65d8e47ed19a 100644 --- a/sw/source/core/inc/flowfrm.hxx +++ b/sw/source/core/inc/flowfrm.hxx @@ -138,7 +138,7 @@ protected: void LockJoin() { bLockJoin = sal_True; } void UnlockJoin() { bLockJoin = sal_False; } - sal_Bool CheckMoveFwd( sal_Bool &rbMakePage, sal_Bool bKeep, sal_Bool bMovedBwd ); + sal_Bool CheckMoveFwd( bool& rbMakePage, sal_Bool bKeep, sal_Bool bMovedBwd ); sal_Bool MoveFwd( sal_Bool bMakePage, sal_Bool bPageBreak, sal_Bool bMoveAlways = sal_False ); virtual sal_Bool ShouldBwdMoved( SwLayoutFrm *pNewUpper, sal_Bool bHead, sal_Bool &rReformat )=0; sal_Bool MoveBwd( sal_Bool &rbReformat ); diff --git a/sw/source/core/layout/calcmove.cxx b/sw/source/core/layout/calcmove.cxx index f835297793c2..1ca1b93a2094 100644 --- a/sw/source/core/layout/calcmove.cxx +++ b/sw/source/core/layout/calcmove.cxx @@ -1168,12 +1168,13 @@ void SwCntntFrm::MakeAll() //uebernimmt im DTor die Benachrichtigung SwCntntNotify *pNotify = new SwCntntNotify( this ); - sal_Bool bMakePage = sal_True; //solange sal_True kann eine neue Seite - //angelegt werden (genau einmal) - sal_Bool bMovedBwd = sal_False; //Wird sal_True wenn der Frame zurueckfliesst - sal_Bool bMovedFwd = sal_False; //solange sal_False kann der Frm zurueck- - //fliessen (solange, bis er einmal - //vorwaerts ge'moved wurde). + // as long as bMakePage is true, a new page can be created (exactly once) + bool bMakePage = true; + // bMovedBwd gets set to true when the frame flows backwards + bool bMovedBwd = false; + // as long as bMovedFwd is false, the Frm may flow backwards (until + // it has been moved forward once) + bool bMovedFwd = false; sal_Bool bFormatted = sal_False; //Fuer die Witwen und Waisen Regelung //wird der letzte CntntFrm einer Kette //u.U. zum Formatieren angeregt, dies @@ -1250,7 +1251,7 @@ void SwCntntFrm::MakeAll() GetUpper()->GetUpper()->IsCellFrm() ) ) && IsMoveable() ) { - bMovedFwd = sal_True; + bMovedFwd = true; MoveFwd( bMakePage, sal_False ); } } @@ -1259,7 +1260,7 @@ void SwCntntFrm::MakeAll() //gleich verschoben werden. if ( lcl_Prev( this ) && ((SwTxtFrm*)this)->IsFollow() && IsMoveable() ) { - bMovedFwd = sal_True; + bMovedFwd = true; // OD 2004-03-02 #106629# - If follow frame is in table, it's master // will be the last in the current table cell. Thus, invalidate the // printing area of the master, @@ -1286,7 +1287,7 @@ void SwCntntFrm::MakeAll() pFtnBossOfFtn != pFtnBossOfRef && pFtnBossOfFtn->IsBefore( pFtnBossOfRef ) ) { - bMovedFwd = sal_True; + bMovedFwd = true; MoveFwd( bMakePage, sal_False ); } } @@ -1305,7 +1306,7 @@ void SwCntntFrm::MakeAll() if ( CheckMoveFwd( bMakePage, bKeep, bMovedBwd ) ) { SWREFRESHFN( this ) - bMovedFwd = sal_True; + bMovedFwd = true; if ( bMovedBwd ) { //Beim zurueckfliessen wurde der Upper angeregt sich @@ -1434,10 +1435,10 @@ void SwCntntFrm::MakeAll() #endif } - //Wenn ich der erste einer Kette bin koennte ich mal sehen ob - //ich zurueckfliessen kann (wenn ich mich ueberhaupt bewegen soll). - //Damit es keine Oszillation gibt, darf ich nicht gerade vorwaerts - //geflossen sein. + // If this is the first one in a chain, check if this can flow + // backwards (if this is movable at all). + // To prevent oscillations/loops, check that this has not just + // flowed forwards. sal_Bool bDummy; if ( !lcl_Prev( this ) && !bMovedFwd && @@ -1446,13 +1447,13 @@ void SwCntntFrm::MakeAll() && MoveBwd( bDummy ) ) { SWREFRESHFN( this ) - bMovedBwd = sal_True; + bMovedBwd = true; bFormatted = sal_False; if ( bKeep && bMoveable ) { if( CheckMoveFwd( bMakePage, sal_False, bMovedBwd ) ) { - bMovedFwd = sal_True; + bMovedFwd = true; bMoveable = IsMoveable(); SWREFRESHFN( this ) } @@ -1593,7 +1594,7 @@ void SwCntntFrm::MakeAll() { if( bMovedFwd ) pNotify->SetInvaKeep(); - bMovedFwd = sal_False; + bMovedFwd = false; } } } @@ -1696,13 +1697,15 @@ void SwCntntFrm::MakeAll() pOldUp->GetUpper()->GetUpper()->IsSctFrm() && ( pPre || pOldUp->GetUpper()->GetPrev() ) && ((SwSectionFrm*)pOldUp->GetUpper()->GetUpper())->MoveAllowed(this) ) - bMovedFwd = sal_False; + { + bMovedFwd = false; + } const sal_Bool bCheckForGrownBody = pOldUp->IsBodyFrm(); const long nOldBodyHeight = (pOldUp->Frm().*fnRect->fnGetHeight)(); if ( !bMovedFwd && !MoveFwd( bMakePage, sal_False ) ) - bMakePage = sal_False; + bMakePage = false; SWREFRESHFN( this ) // If MoveFwd moves the paragraph to the next page, a following @@ -1713,9 +1716,13 @@ void SwCntntFrm::MakeAll() // Therefore we only check for growing body frames. if ( bCheckForGrownBody && ! bMovedBwd && pOldUp != GetUpper() && (pOldUp->Frm().*fnRect->fnGetHeight)() > nOldBodyHeight ) - bMovedFwd = sal_False; + { + bMovedFwd = false; + } else - bMovedFwd = sal_True; + { + bMovedFwd = true; + } bFormatted = sal_False; if ( bMoveOrFit && GetUpper() == pOldUp ) diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx index 6cc1f02e31c3..31c79b00185e 100644 --- a/sw/source/core/layout/flowfrm.cxx +++ b/sw/source/core/layout/flowfrm.cxx @@ -1779,7 +1779,7 @@ SwTwips SwFlowFrm::CalcAddLowerSpaceAsLastInTableCell( |*************************************************************************/ -sal_Bool SwFlowFrm::CheckMoveFwd( sal_Bool &rbMakePage, sal_Bool bKeep, sal_Bool ) +sal_Bool SwFlowFrm::CheckMoveFwd( bool& rbMakePage, sal_Bool bKeep, sal_Bool ) { const SwFrm* pNxt = rThis.GetIndNext(); @@ -1829,7 +1829,7 @@ sal_Bool SwFlowFrm::CheckMoveFwd( sal_Bool &rbMakePage, sal_Bool bKeep, sal_Bool { bMovedFwd = sal_True; if ( !MoveFwd( rbMakePage, sal_False ) ) - rbMakePage = sal_False; + rbMakePage = false; } else { @@ -1837,7 +1837,7 @@ sal_Bool SwFlowFrm::CheckMoveFwd( sal_Bool &rbMakePage, sal_Bool bKeep, sal_Bool { while ( MoveFwd( rbMakePage, sal_True ) ) /* do nothing */; - rbMakePage = sal_False; + rbMakePage = false; bMovedFwd = sal_True; } else if ( IsColBreak ( sal_False ) ) @@ -1856,7 +1856,7 @@ sal_Bool SwFlowFrm::CheckMoveFwd( sal_Bool &rbMakePage, sal_Bool bKeep, sal_Bool break; } while ( IsColBreak( sal_False ) ); if ( pPage != rThis.FindPageFrm() ) - rbMakePage = sal_False; + rbMakePage = false; } } } diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx index 44be6ba031a1..1571b71ceb37 100644 --- a/sw/source/core/layout/tabfrm.cxx +++ b/sw/source/core/layout/tabfrm.cxx @@ -1859,14 +1859,15 @@ void SwTabFrm::MakeAll() pLayout->GetBrowseWidthByTabFrm( *this ), sal_False ); } - - sal_Bool bMakePage = sal_True; //solange sal_True kann eine neue Seite - //angelegt werden (genau einmal) - sal_Bool bMovedBwd = sal_False; //Wird sal_True wenn der Frame zurueckfliesst - sal_Bool bMovedFwd = sal_False; //solange sal_False kann der Frm zurueck- - //fliessen (solange, bis er einmal - //vorwaerts ge'moved wurde). - sal_Bool bSplit = sal_False; //Wird sal_True wenn der Frm gesplittet wurde. + // as long as bMakePage is true, a new page can be created (exactly once) + bool bMakePage = true; + // bMovedBwd gets set to true when the frame flows backwards + bool bMovedBwd = false; + // as long as bMovedFwd is false, the Frm may flow backwards (until + // it has been moved forward once) + bool bMovedFwd = false; + // gets set to true when the Frm is split + bool bSplit = false; const sal_Bool bFtnsInDoc = 0 != GetFmt()->GetDoc()->GetFtnIdxs().Count(); sal_Bool bMoveable; const sal_Bool bFly = IsInFly(); @@ -1937,15 +1938,15 @@ void SwTabFrm::MakeAll() } } - //Einen Frischling moven wir gleich schon einmal vorwaerts... + // a new one is moved forwards immediately if ( !Frm().Top() && IsFollow() ) { SwFrm *pPre = GetPrev(); if ( pPre && pPre->IsTabFrm() && ((SwTabFrm*)pPre)->GetFollow() == this) { if ( !MoveFwd( bMakePage, sal_False ) ) - bMakePage = sal_False; - bMovedFwd = sal_True; + bMakePage = false; + bMovedFwd = true; } } @@ -1956,12 +1957,12 @@ void SwTabFrm::MakeAll() if ( sal_True == (bMoveable = IsMoveable()) ) if ( CheckMoveFwd( bMakePage, bKeep && KEEPTAB, bMovedBwd ) ) { - bMovedFwd = sal_True; + bMovedFwd = true; bCalcLowers = sal_True; // #i99267# // reset <bSplit> after forward move to assure that follows // can be joined, if further space is available. - bSplit = sal_False; + bSplit = false; } Point aOldPos( (Frm().*fnRect->fnGetPos)() ); @@ -1992,7 +1993,7 @@ void SwTabFrm::MakeAll() // #i99267# // reset <bSplit> after forward move to assure that follows // can be joined, if further space is available. - bSplit = sal_False; + bSplit = false; } } @@ -2029,18 +2030,17 @@ void SwTabFrm::MakeAll() aNotify.SetLowersComplete( sal_False ); } - //Wenn ich der erste einer Kette bin koennte ich mal sehen ob - //ich zurueckfliessen kann (wenn ich mich ueberhaupt bewegen soll). - //Damit es keine Oszillation gibt, darf ich nicht gerade vorwaerts - //geflosssen sein. + // If this is the first one in a chain, check if this can flow + // backwards (if this is movable at all). + // To prevent oscillations/loops, check that this has not just + // flowed forwards. if ( !bMovedFwd && (bMoveable || bFly) && lcl_NoPrev( *this ) ) { - //Bei Follows muss der Master benachrichtigt - //werden. Der Follow muss nur dann Moven, wenn er leere Blaetter - //ueberspringen muss. + // for Follows notify Master. + // only move Follow if it has to skip empty pages. if ( IsFollow() ) { - //Nur wenn die Hoehe der ersten Zeile kleiner geworder ist. + // Only if the height of the first line got smaller. SwFrm *pFrm = GetFirstNonHeadlineRow(); if( pFrm && n1StLineHeight >(pFrm->Frm().*fnRect->fnGetHeight )() ) { @@ -2055,7 +2055,7 @@ void SwTabFrm::MakeAll() if ( MoveBwd( bReformat ) ) { SWREFRESHFN( this ) - bMovedBwd = sal_True; + bMovedBwd = true; aNotify.SetLowersComplete( sal_False ); if ( bFtnsInDoc ) MoveLowerFtns( 0, pOldBoss, 0, sal_True ); @@ -2425,7 +2425,7 @@ void SwTabFrm::MakeAll() if( (*fnRect->fnYDiff)(nDeadLine, nBreakLine) >=0 || !pIndPrev ) { aNotify.SetLowersComplete( sal_False ); - bSplit = sal_True; + bSplit = true; // // An existing follow flow line has to be removed. @@ -2551,14 +2551,16 @@ void SwTabFrm::MakeAll() GetUpper()->GetUpper()->GetUpper()->IsSctFrm() && ( GetUpper()->GetUpper()->GetPrev() || GetIndPrev() ) && ((SwSectionFrm*)GetUpper()->GetUpper()->GetUpper())->MoveAllowed(this) ) - bMovedFwd = sal_False; + { + bMovedFwd = false; + } // #i29771# Reset bTryToSplit flag on change of upper const SwFrm* pOldUpper = GetUpper(); //Mal sehen ob ich irgenwo Platz finde... if ( !bMovedFwd && !MoveFwd( bMakePage, sal_False ) ) - bMakePage = sal_False; + bMakePage = false; // #i29771# Reset bSplitError flag on change of upper if ( GetUpper() != pOldUpper ) @@ -2568,7 +2570,8 @@ void SwTabFrm::MakeAll() } SWREFRESHFN( this ) - bMovedFwd = bCalcLowers = sal_True; + bCalcLowers = sal_True; + bMovedFwd = true; aNotify.SetLowersComplete( sal_False ); if ( IsFollow() ) { //Um Oszillationen zu vermeiden sollte kein ungueltiger Master |