summaryrefslogtreecommitdiff
path: root/sw/source/core/layout/hffrm.cxx
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2015-10-12 09:07:52 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-10-12 09:08:32 +0200
commit51438e87d0e17a4cc3c991165d22c740b3ac1fc2 (patch)
treee0ee32086f15e2a4516051f2110867e5822f105a /sw/source/core/layout/hffrm.cxx
parente757c471139094525bd0a967e1b72747f35f99bf (diff)
tdf#89165 sw: looping layout in SwHeadFootFrm::FormatSize()
FormatObjsAtFrm() returns false, indicating that the result is not perfect, and the caller hopes that formatting all children of the frame again will help. Make sure that in case that assumption turns out to be false, we at least do not loop. The loop limit is enough to make the original i#43771 bugdoc still laid out properly. Change-Id: Ife9bd99a628a72edb922d04e05081971b6adf340
Diffstat (limited to 'sw/source/core/layout/hffrm.cxx')
-rw-r--r--sw/source/core/layout/hffrm.cxx12
1 files changed, 9 insertions, 3 deletions
diff --git a/sw/source/core/layout/hffrm.cxx b/sw/source/core/layout/hffrm.cxx
index a18923837023..98fb929baef1 100644
--- a/sw/source/core/layout/hffrm.cxx
+++ b/sw/source/core/layout/hffrm.cxx
@@ -246,6 +246,7 @@ void SwHeadFootFrm::FormatSize(SwTwips nUL, const SwBorderAttrs * pAttrs)
pFrm->_InvalidatePos();
aOldFooterPrtPos = Frm().Pos() + Prt().Pos();
}
+ int nLoopControl = 0;
while( pFrm )
{
pFrm->Calc(getRootFrm()->GetCurrShell()->GetOut());
@@ -263,9 +264,14 @@ void SwHeadFootFrm::FormatSize(SwTwips nUL, const SwBorderAttrs * pAttrs)
if ( !SwObjectFormatter::FormatObjsAtFrm( *pFrm,
*(pFrm->FindPageFrm()) ) )
{
- // restart format with first content
- pFrm = Lower();
- continue;
+ if (nLoopControl++ < 20)
+ {
+ // restart format with first content
+ pFrm = Lower();
+ continue;
+ }
+ else
+ SAL_WARN("sw", "SwHeadFootFrm::FormatSize: loop detection triggered");
}
}
pFrm = pFrm->GetNext();