summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/qa/extras/odfimport/data/tdf115079.odtbin0 -> 22717 bytes
-rw-r--r--sw/qa/extras/odfimport/odfimport.cxx5
-rw-r--r--sw/source/core/layout/tabfrm.cxx9
3 files changed, 13 insertions, 1 deletions
diff --git a/sw/qa/extras/odfimport/data/tdf115079.odt b/sw/qa/extras/odfimport/data/tdf115079.odt
new file mode 100644
index 000000000000..6c1039e71ced
--- /dev/null
+++ b/sw/qa/extras/odfimport/data/tdf115079.odt
Binary files differ
diff --git a/sw/qa/extras/odfimport/odfimport.cxx b/sw/qa/extras/odfimport/odfimport.cxx
index 032a4a5da574..a638dd818574 100644
--- a/sw/qa/extras/odfimport/odfimport.cxx
+++ b/sw/qa/extras/odfimport/odfimport.cxx
@@ -882,5 +882,10 @@ DECLARE_ODFIMPORT_TEST(testBlankBeforeFirstPage, "tdf94882.odt")
);
}
+DECLARE_ODFIMPORT_TEST(testTdf115079, "tdf115079.odt")
+{
+ // This document caused segfault when layouting
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index 9ff64c1aa162..f1e2e2e56fff 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -4083,7 +4083,14 @@ static SwTwips lcl_calcHeightOfRowBeforeThisFrame(const SwRowFrame& rRow)
{
// We've found another row frame that is part of the same table row
const SwTabFrame* pCurTab = pCurRow->FindTabFrame();
- if (pCurTab->IsAnFollow(pTab))
+ // A row frame may not belong to a table frame, when it is being cut, e.g., in
+ // lcl_PostprocessRowsInCells().
+ // Its SwRowFrame::Cut() has been called; it in turn called SwLayoutFrame::Cut(),
+ // which nullified row's upper in RemoveFromLayout(), and then called Shrink()
+ // for its former upper.
+ // Regardless of whether it will be pasted back, or destroyed, currently it's not
+ // part of layout, and its height does not count
+ if (pCurTab && pCurTab->IsAnFollow(pTab))
{
// The found row frame belongs to a table frame that precedes
// (above) this one in chain. So, include it in the sum