ebc4bd
From 1fec67aab152e0c0ad6dd85082c50f1beff7d520 Mon Sep 17 00:00:00 2001
ebc4bd
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
ebc4bd
Date: Tue, 16 Sep 2014 13:22:44 +0100
ebc4bd
Subject: [PATCH] Resolves: fdo#68967 looping layout
ebc4bd
ebc4bd
RemoveFollowFlowLine() marks the layout invalid, but the
ebc4bd
next cycle through does everything exactly the same again.
ebc4bd
ebc4bd
Try the same foul horror as nUnSplitted. But at least with
ebc4bd
a test-case that nails down reproducing the bug if a better
ebc4bd
fix is needed.
ebc4bd
ebc4bd
Change-Id: Id6698bcb2364bd0253bedd4a7c313e25f705be8d
ebc4bd
---
ebc4bd
 sw/qa/extras/ww8import/data/fdo68967.doc | Bin 0 -> 99328 bytes
ebc4bd
 sw/qa/extras/ww8import/ww8import.cxx     |   4 ++++
ebc4bd
 sw/source/core/layout/tabfrm.cxx         |   7 +++++++
ebc4bd
 3 files changed, 11 insertions(+)
ebc4bd
 create mode 100644 sw/qa/extras/ww8import/data/fdo68967.doc
ebc4bd
ebc4bd
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
ebc4bd
index 06f38c7..f7a39f5 100644
ebc4bd
--- a/sw/source/core/layout/tabfrm.cxx
ebc4bd
+++ b/sw/source/core/layout/tabfrm.cxx
ebc4bd
@@ -1831,6 +1831,7 @@ void SwTabFrm::MakeAll()
ebc4bd
     }
ebc4bd
 
ebc4bd
     int nUnSplitted = 5; // Just another loop control :-(
ebc4bd
+    int nThrowAwayValidLayoutLimit = 5; // And another one :-(
ebc4bd
     SWRECTFN( this )
ebc4bd
     while ( !mbValidPos || !mbValidSize || !mbValidPrtArea )
ebc4bd
     {
ebc4bd
@@ -2301,7 +2302,13 @@ void SwTabFrm::MakeAll()
ebc4bd
                     // An existing follow flow line has to be removed.
ebc4bd
                     if ( HasFollowFlowLine() )
ebc4bd
                     {
ebc4bd
+                        if (!nThrowAwayValidLayoutLimit)
ebc4bd
+                            continue;
ebc4bd
+                        bool bInitialLoopEndCondition = mbValidPos && mbValidSize && mbValidPrtArea;
ebc4bd
                         RemoveFollowFlowLine();
ebc4bd
+                        bool bFinalLoopEndCondition = mbValidPos && mbValidSize && mbValidPrtArea;
ebc4bd
+                        if (bInitialLoopEndCondition && !bFinalLoopEndCondition)
ebc4bd
+                            --nThrowAwayValidLayoutLimit;
ebc4bd
                     }
ebc4bd
 
ebc4bd
                     const bool bSplitError = !Split( nDeadLine, bTryToSplit, ( bTableRowKeep && !bAllowSplitOfRow ) );
ebc4bd
-- 
ebc4bd
1.9.3
ebc4bd