diff options
-rw-r--r-- | sw/qa/extras/layout/data/tdf152983-1-min.docx | bin | 0 -> 100691 bytes | |||
-rw-r--r-- | sw/qa/extras/layout/layout.cxx | 6 | ||||
-rw-r--r-- | sw/source/core/layout/wsfrm.cxx | 5 |
3 files changed, 9 insertions, 2 deletions
diff --git a/sw/qa/extras/layout/data/tdf152983-1-min.docx b/sw/qa/extras/layout/data/tdf152983-1-min.docx Binary files differnew file mode 100644 index 000000000000..804e8fefe68f --- /dev/null +++ b/sw/qa/extras/layout/data/tdf152983-1-min.docx diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx index e985c62626a5..995c6ddfc7a6 100644 --- a/sw/qa/extras/layout/layout.cxx +++ b/sw/qa/extras/layout/layout.cxx @@ -1210,6 +1210,12 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, TestTdf150606) } #endif +CPPUNIT_TEST_FIXTURE(SwLayoutWriter, TestTdf152983) +{ + //just care it doesn't crash/assert + createSwDoc("tdf152983-1-min.docx"); +} + CPPUNIT_TEST_FIXTURE(SwLayoutWriter, TestTdf137025) { // Check the padding of the textbox diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx index e30e3ecc401a..2834b09f70a6 100644 --- a/sw/source/core/layout/wsfrm.cxx +++ b/sw/source/core/layout/wsfrm.cxx @@ -1232,10 +1232,11 @@ void SwContentFrame::Cut() // RemoveSuperfluous can only remove empty pages at the end; // find if there are pages without content following pPage // and if so request a call to CheckPageDescs() - SwPageFrame const* pNext(pPage); SwViewShell *pSh = pRoot->GetCurrShell(); - if (pSh && pSh->Imp()->IsAction()) + // tdf#152983 pPage is null when called from SwHeadFootFrame ctor + if (pPage && pSh && pSh->Imp()->IsAction()) { + SwPageFrame const* pNext(pPage); while ((pNext = static_cast<SwPageFrame const*>(pNext->GetNext()))) { if (!sw::IsPageFrameEmpty(*pNext) && !pNext->IsFootnotePage()) |