summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2017-10-06 22:50:03 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-10-06 23:09:15 +0200
commita3884863aba7807e7b473a0acb3f7aa4e4ae9a37 (patch)
tree4baa8f6b1ad10104421fd22e91fabc553f315a4a
parent84cd7643533aa5b1c4a096ec47fbd44992a03198 (diff)
sw: work around layout loop with split sections inside nested tables
This is just a short-term workaround, the actual root cause has to be fixed (and that fix needs a testcase). The change just makes sure that once a page is formatted, then a follow page's table row doesn't invalidate the previous page (when the row is shrinking), this way avoiding the loop. Change-Id: Ic4b9252157ed29c3b554f06caf0630e56ba2ac79
-rw-r--r--sw/source/core/layout/tabfrm.cxx40
1 files changed, 39 insertions, 1 deletions
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index 0c6db983d50d..0a336f9cbe76 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -4319,6 +4319,43 @@ SwTwips SwRowFrame::GrowFrame( SwTwips nDist, bool bTst, bool bInfo )
return nReal;
}
+static bool lcl_ContainsNestedTableContainingSection(SwRowFrame* pRow)
+{
+ SwFrame* pLower = pRow->Lower();
+ if (!pLower)
+ return false;
+ if (!pLower->IsCellFrame())
+ return false;
+ SwCellFrame* pOuterCell = static_cast<SwCellFrame*>(pLower);
+
+ pLower = pOuterCell->Lower();
+ if (!pLower)
+ return false;
+ if (!pLower->IsTabFrame())
+ return false;
+ SwTabFrame* pInnerTab = static_cast<SwTabFrame*>(pLower);
+
+ pLower = pInnerTab->Lower();
+ if (!pLower)
+ return false;
+ if (!pLower->IsRowFrame())
+ return false;
+ SwRowFrame* pInnerRow = static_cast<SwRowFrame*>(pLower);
+
+ pLower = pInnerRow->Lower();
+ if (!pLower)
+ return false;
+ if (!pLower->IsCellFrame())
+ return false;
+ SwCellFrame* pInnerCell = static_cast<SwCellFrame*>(pLower);
+
+ pLower = pInnerCell->Lower();
+ if (!pLower)
+ return false;
+
+ return pLower->IsSctFrame();
+}
+
SwTwips SwRowFrame::ShrinkFrame( SwTwips nDist, bool bTst, bool bInfo )
{
SWRECTFN( this )
@@ -4407,7 +4444,8 @@ SwTwips SwRowFrame::ShrinkFrame( SwTwips nDist, bool bTst, bool bInfo )
&& !pTab->IsInRecalcLowerRow() )
{
SwTabFrame* pMasterTab = pTab->FindMaster();
- pMasterTab->InvalidatePos();
+ if (!lcl_ContainsNestedTableContainingSection(this))
+ pMasterTab->InvalidatePos();
}
}
AdjustCells( (Prt().*fnRect->fnGetHeight)() - nReal, true );