diff options
author | Cédric Bosdonnat <cedric.bosdonnat.ooo@free.fr> | 2011-08-17 13:59:09 +0200 |
---|---|---|
committer | Cédric Bosdonnat <cedric.bosdonnat.ooo@free.fr> | 2011-08-17 14:01:55 +0200 |
commit | 6f7bd90edcb68a67b63094eae6dae6f144edd5cc (patch) | |
tree | 20174caa0e4f5152c75fe1f6b22964e2d8c49404 /sw | |
parent | 62d38bed44404844d94ce09b9fb35b3369835c88 (diff) |
Header/Footer: Update the whole page when SwFooterFrm is invalid
Changing the height of the footer frame (i.e. by creating a new line in
it) didn't update the page margins and broke the rendering of the
header/footer decorators. To avoid that, redraw the whole page when the
SwFooterFrm is invalid.
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/layout/layact.cxx | 57 |
1 files changed, 35 insertions, 22 deletions
diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx index e1289c2dc2ea..aa1b56138286 100644 --- a/sw/source/core/layout/layact.cxx +++ b/sw/source/core/layout/layact.cxx @@ -656,15 +656,14 @@ void SwLayAction::InternalAction() pRoot->DeleteEmptySct(); XCHECKPAGE; - // OD 2004-05-12 #i28701# - scope for instance of class - // <NotifyLayoutOfPageInProgress> + // #i28701# - scope for instance of class <NotifyLayoutOfPageInProgress> { NotifyLayoutOfPageInProgress aLayoutOfPageInProgress( *pPage ); while ( !IsInterrupt() && !IsNextCycle() && ((IS_FLYS && IS_INVAFLY) || pPage->IsInvalid()) ) { - // OD 2004-05-10 #i28701# + // #i28701# SwObjectFormatter::FormatObjsAtFrm( *pPage, *pPage, this ); if ( !IS_FLYS ) { @@ -673,7 +672,7 @@ void SwLayAction::InternalAction() pPage->ValidateFlyLayout(); pPage->ValidateFlyCntnt(); } - // OD 2004-05-10 #i28701# - change condition + // #i28701# - change condition while ( !IsInterrupt() && !IsNextCycle() && ( pPage->IsInvalid() || (IS_FLYS && IS_INVAFLY) ) ) @@ -681,7 +680,7 @@ void SwLayAction::InternalAction() PROTOCOL( pPage, PROT_FILE_INIT, 0, 0) XCHECKPAGE; - // FME 2007-08-30 #i81146# new loop control + // #i81146# new loop control sal_uInt16 nLoopControlRuns_1 = 0; const sal_uInt16 nLoopControlMax = 20; @@ -701,7 +700,7 @@ void SwLayAction::InternalAction() FormatLayout( pPage ); XCHECKPAGE; } - // OD 2004-05-10 #i28701# - change condition + // #i28701# - change condition if ( !IsNextCycle() && ( pPage->IsInvalidCntnt() || (IS_FLYS && IS_INVAFLY) ) ) @@ -833,7 +832,7 @@ void SwLayAction::InternalAction() if( pPg != pPage ) pPg = pPg ? (SwPageFrm*)pPg->GetPrev() : pPage; - // OD 14.04.2003 #106346# - set flag for interrupt content formatting + // set flag for interrupt content formatting mbFormatCntntOnInterrupt = IsInput() && !IsStopPrt(); long nBottom = rVis.Bottom(); // #i42586# - format current page, if idle action is active @@ -847,16 +846,14 @@ void SwLayAction::InternalAction() XCHECKPAGE; - // FME 2007-08-30 #i81146# new loop control + // #i81146# new loop control sal_uInt16 nLoopControlRuns_2 = 0; const sal_uInt16 nLoopControlMax = 20; - // OD 14.04.2003 #106346# - special case: interrupt content formatting - // #i28701# - conditions, introduced by #106346#, - // are incorrect (marcos IS_FLYS and IS_INVAFLY only works for <pPage>) - // and are too strict. - // #i50432# - adjust interrupt formatting to - // normal page formatting - see above. + // special case: interrupt content formatting + // #i28701# - conditions are incorrect (macros IS_FLYS and IS_INVAFLY only + // works for <pPage>) and are too strict. + // #i50432# - adjust interrupt formatting to normal page formatting - see above. while ( ( mbFormatCntntOnInterrupt && ( pPg->IsInvalid() || ( pPg->GetSortedObjs() && pPg->IsInvalidFly() ) ) ) || @@ -865,14 +862,13 @@ void SwLayAction::InternalAction() XCHECKPAGE; // #i50432# - format also at-page anchored objects SwObjectFormatter::FormatObjsAtFrm( *pPg, *pPg, this ); - // #i50432# if ( !pPg->GetSortedObjs() ) { pPg->ValidateFlyLayout(); pPg->ValidateFlyCntnt(); } - // FME 2007-08-30 #i81146# new loop control + // #i81146# new loop control sal_uInt16 nLoopControlRuns_3 = 0; while ( pPg->IsInvalidLayout() ) @@ -898,7 +894,7 @@ void SwLayAction::InternalAction() { pPg->ValidateFlyInCnt(); pPg->ValidateCntnt(); - // #i26945# - follow-up of fix #117736# + // #i26945# pPg->ValidateFlyLayout(); pPg->ValidateFlyCntnt(); @@ -915,12 +911,11 @@ void SwLayAction::InternalAction() XCHECKPAGE; pPg->InvalidateCntnt(); pPg->InvalidateFlyInCnt(); - // #i26945# - follow-up of fix #117736# + // #i26945# pPg->InvalidateFlyLayout(); pPg->InvalidateFlyCntnt(); } - // #i46807# - we are statisfied, if the - // content is formatted once complete. + // #i46807# - we are statisfied, if the content is formatted once complete. else { break; @@ -929,7 +924,7 @@ void SwLayAction::InternalAction() } pPg = (SwPageFrm*)pPg->GetNext(); } - // OD 14.04.2003 #106346# - reset flag for special interrupt content formatting. + // reset flag for special interrupt content formatting. mbFormatCntntOnInterrupt = sal_False; } pOptTab = 0; @@ -1795,7 +1790,25 @@ sal_Bool SwLayAction::FormatCntnt( const SwPageFrm *pPage ) const ViewShell *pSh = pRoot->GetCurrShell(); const sal_Bool bBrowse = pSh && pSh->GetViewOptions()->getBrowseMode(); - while ( pCntnt && pPage->IsAnLower( pCntnt ) ) + // Check if there is a footer frame and if it's in an invalid state. + // In such a case, redraw the whole page to properly update the + // header/footer decorators + const SwFrm *pLay = pPage->Lower(); + bool bPaintWholePage = false; + + if ( pLay ) + { + while ( pLay->GetNext() ) + pLay = pLay->GetNext(); + + if ( pLay->IsFooterFrm() ) + { + bPaintWholePage = true; + pImp->GetShell()->AddPaintRect( pPage->Frm() ); + } + } + + while ( !bPaintWholePage && pCntnt && pPage->IsAnLower( pCntnt ) ) { //Wenn der Cntnt sich eh nicht veraendert koennen wir ein paar //Abkuerzungen nutzen. |