diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-10-25 17:48:32 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-10-26 09:04:12 +0200 |
commit | cb8b20ab3aa3f790d4979385874cdd4e2a87221b (patch) | |
tree | af6a8b8391e2e52db7f38a28f8ff2c0c39cde170 /sw/source/core/layout/tabfrm.cxx | |
parent | aded98ce3d7a4189a4fa30989505da9427abc83b (diff) |
tdf#113445 sw: avoid hitting loop control with a dozen of in-table sections
The bugdoc has an (outer) table containing a single cell, which has an
(inner) table with 12 cells, all content is inside sections, one section
/ cell.
This relatively simple setup can already hit the loop control in
lcl_RecalcRow(), as the SwLayNotify dtor always does invalidation in an
async way, so the loop control's counter is incremented after each and
every table cell.
Instead of increasing the max tolerance in lcl_RecalcRow() (one can
easily construct a document where the bug is still there even if the max
is set to 100 instead of the current 10 iterations), just calculate the
lower synchronously.
Change-Id: Ifbffe13e5f2f237e1578bdd3e17d4d8b7c34806d
Reviewed-on: https://gerrit.libreoffice.org/43848
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'sw/source/core/layout/tabfrm.cxx')
-rw-r--r-- | sw/source/core/layout/tabfrm.cxx | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx index 7bbaa6ddd127..c840c62649ea 100644 --- a/sw/source/core/layout/tabfrm.cxx +++ b/sw/source/core/layout/tabfrm.cxx @@ -1560,11 +1560,9 @@ static void lcl_RecalcRow( SwRowFrame& rRow, long nBottom ) { if ( ++nLoopControlRuns_2 > nLoopControlMax ) { -#if OSL_DEBUG_LEVEL > 1 - OSL_ENSURE( 0 != nLoopControlStage_2, "LoopControl_2 in lcl_RecalcRow: Stage 1!" ); - OSL_ENSURE( 1 != nLoopControlStage_2, "LoopControl_2 in lcl_RecalcRow: Stage 2!!" ); - OSL_ENSURE( 2 > nLoopControlStage_2, "LoopControl_2 in lcl_RecalcRow: Stage 3!!!" ); -#endif + SAL_WARN_IF(nLoopControlStage_2 == 0, "sw.layout", "LoopControl_2 in lcl_RecalcRow: Stage 1!"); + SAL_WARN_IF(nLoopControlStage_2 == 1, "sw.layout", "LoopControl_2 in lcl_RecalcRow: Stage 2!!"); + SAL_WARN_IF(nLoopControlStage_2 >= 2, "sw.layout", "LoopControl_2 in lcl_RecalcRow: Stage 3!!!"); rRow.ValidateThisAndAllLowers( nLoopControlStage_2++ ); nLoopControlRuns_2 = 0; if( nLoopControlStage_2 > 2 ) @@ -1608,11 +1606,9 @@ static void lcl_RecalcRow( SwRowFrame& rRow, long nBottom ) { if ( ++nLoopControlRuns_1 > nLoopControlMax ) { -#if OSL_DEBUG_LEVEL > 1 - OSL_ENSURE( 0 != nLoopControlStage_1, "LoopControl_1 in lcl_RecalcRow: Stage 1!" ); - OSL_ENSURE( 1 != nLoopControlStage_1, "LoopControl_1 in lcl_RecalcRow: Stage 2!!" ); - OSL_ENSURE( 2 > nLoopControlStage_1, "LoopControl_1 in lcl_RecalcRow: Stage 3!!!" ); -#endif + SAL_WARN_IF(nLoopControlStage_1 == 0, "sw.layout", "LoopControl_1 in lcl_RecalcRow: Stage 1!"); + SAL_WARN_IF(nLoopControlStage_1 == 1, "sw.layout", "LoopControl_1 in lcl_RecalcRow: Stage 2!!"); + SAL_WARN_IF(nLoopControlStage_1 >= 2, "sw.layout", "LoopControl_1 in lcl_RecalcRow: Stage 3!!!"); rRow.ValidateThisAndAllLowers( nLoopControlStage_1++ ); nLoopControlRuns_1 = 0; if( nLoopControlStage_1 > 2 ) |