diff --git a/sw/qa/core/objectpositioning/data/tdf154863-img-move-crash.docx b/sw/qa/core/objectpositioning/data/tdf154863-img-move-crash.docx new file mode 100644 index 000000000000..ca402edef74d Binary files /dev/null and b/sw/qa/core/objectpositioning/data/tdf154863-img-move-crash.docx differ diff --git a/sw/qa/core/objectpositioning/objectpositioning.cxx b/sw/qa/core/objectpositioning/objectpositioning.cxx index bf560cbdaf90..717d63ded052 100644 --- a/sw/qa/core/objectpositioning/objectpositioning.cxx +++ b/sw/qa/core/objectpositioning/objectpositioning.cxx @@ -25,6 +25,8 @@ #include #include +#include + namespace { /// Covers sw/source/core/objectpositioning/ fixes. @@ -56,6 +58,18 @@ CPPUNIT_TEST_FIXTURE(Test, testOverlapCrash) pWrtShell->SplitNode(); } +CPPUNIT_TEST_FIXTURE(Test, testImgMoveCrash) +{ + createSwDoc("tdf154863-img-move-crash.docx"); + uno::Reference xShape(getShapeByName(u"Image26"), uno::UNO_QUERY); + uno::Reference xShapeProps(xShape, uno::UNO_QUERY); + xShapeProps->setPropertyValue("VertOrient", uno::Any(static_cast(0))); + xShapeProps->setPropertyValue("VertOrientPosition", uno::Any(static_cast(3000))); + Scheduler::ProcessEventsToIdle(); + // Crash expected before assert if bug exists + CPPUNIT_ASSERT(true); +} + CPPUNIT_TEST_FIXTURE(Test, testVertPosFromBottom) { // Create a document, insert a shape and position it 1cm above the bottom of the body area. diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx index edb10beb35c6..cd44758e574b 100644 --- a/sw/source/core/layout/tabfrm.cxx +++ b/sw/source/core/layout/tabfrm.cxx @@ -1754,6 +1754,7 @@ bool SwContentFrame::CalcLowers(SwLayoutFrame & rLay, SwLayoutFrame const& rDont { // #i23129#, #i36347# - pass correct page frame to // the object formatter + SwFrameDeleteGuard aDeleteGuard(pCnt); if ( !SwObjectFormatter::FormatObjsAtFrame( *pCnt, *(pCnt->FindPageFrame()) ) ) {