summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-09-16 13:22:44 +0100
committerCaolán McNamara <caolanm@redhat.com>2014-09-16 15:13:21 +0100
commit1fec67aab152e0c0ad6dd85082c50f1beff7d520 (patch)
tree95aee07bf955e1effe8861ff7729ac2079ee6604
parent76e04aef4b4adea8179d564b158e58f495ed43a4 (diff)
Resolves: fdo#68967 looping layout
RemoveFollowFlowLine() marks the layout invalid, but the next cycle through does everything exactly the same again. Try the same foul horror as nUnSplitted. But at least with a test-case that nails down reproducing the bug if a better fix is needed. Change-Id: Id6698bcb2364bd0253bedd4a7c313e25f705be8d
-rw-r--r--sw/qa/extras/ww8import/data/fdo68967.docbin0 -> 99328 bytes
-rw-r--r--sw/qa/extras/ww8import/ww8import.cxx4
-rw-r--r--sw/source/core/layout/tabfrm.cxx7
3 files changed, 11 insertions, 0 deletions
diff --git a/sw/qa/extras/ww8import/data/fdo68967.doc b/sw/qa/extras/ww8import/data/fdo68967.doc
new file mode 100644
index 000000000000..05271c3d868a
--- /dev/null
+++ b/sw/qa/extras/ww8import/data/fdo68967.doc
Binary files differ
diff --git a/sw/qa/extras/ww8import/ww8import.cxx b/sw/qa/extras/ww8import/ww8import.cxx
index 463c5aee19e0..5f4e0bc059f7 100644
--- a/sw/qa/extras/ww8import/ww8import.cxx
+++ b/sw/qa/extras/ww8import/ww8import.cxx
@@ -510,6 +510,10 @@ DECLARE_WW8IMPORT_TEST(testBnc787942, "bnc787942.doc")
parseDump("/root/page[1]/body/txt[4]/anchored");
}
+DECLARE_WW8IMPORT_TEST(testLayoutHanging, "fdo68967.doc")
+{
+ // This must not hang in layout
+}
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index 06f38c7f6605..f7a39f515880 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -1831,6 +1831,7 @@ void SwTabFrm::MakeAll()
}
int nUnSplitted = 5; // Just another loop control :-(
+ int nThrowAwayValidLayoutLimit = 5; // And another one :-(
SWRECTFN( this )
while ( !mbValidPos || !mbValidSize || !mbValidPrtArea )
{
@@ -2301,7 +2302,13 @@ void SwTabFrm::MakeAll()
// An existing follow flow line has to be removed.
if ( HasFollowFlowLine() )
{
+ if (!nThrowAwayValidLayoutLimit)
+ continue;
+ bool bInitialLoopEndCondition = mbValidPos && mbValidSize && mbValidPrtArea;
RemoveFollowFlowLine();
+ bool bFinalLoopEndCondition = mbValidPos && mbValidSize && mbValidPrtArea;
+ if (bInitialLoopEndCondition && !bFinalLoopEndCondition)
+ --nThrowAwayValidLayoutLimit;
}
const bool bSplitError = !Split( nDeadLine, bTryToSplit, ( bTableRowKeep && !bAllowSplitOfRow ) );