summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/qa/extras/odfimport/data/tdf146597.odtbin0 -> 13307 bytes
-rw-r--r--sw/qa/extras/odfimport/odfimport.cxx6
-rw-r--r--sw/source/core/draw/dcontact.cxx5
3 files changed, 10 insertions, 1 deletions
diff --git a/sw/qa/extras/odfimport/data/tdf146597.odt b/sw/qa/extras/odfimport/data/tdf146597.odt
new file mode 100644
index 000000000000..6dcc379cef4d
--- /dev/null
+++ b/sw/qa/extras/odfimport/data/tdf146597.odt
Binary files differ
diff --git a/sw/qa/extras/odfimport/odfimport.cxx b/sw/qa/extras/odfimport/odfimport.cxx
index bd936937475d..c1ec472f405d 100644
--- a/sw/qa/extras/odfimport/odfimport.cxx
+++ b/sw/qa/extras/odfimport/odfimport.cxx
@@ -1322,5 +1322,11 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf146257)
}
}
+CPPUNIT_TEST_FIXTURE(Test, testTdf146597)
+{
+ load(mpTestDocumentPath, "tdf146597.odt");
+ // This was creashed before.
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx
index ad377073a58e..e4d2450629c8 100644
--- a/sw/source/core/draw/dcontact.cxx
+++ b/sw/source/core/draw/dcontact.cxx
@@ -1338,7 +1338,10 @@ void SwDrawContact::Changed_( const SdrObject& rObj,
// tdf#135198: keep text box together with its shape
const SwPageFrame* rPageFrame = pAnchoredDrawObj->GetPageFrame();
- if (rPageFrame && rPageFrame->isFrameAreaPositionValid())
+ auto pFormat = GetFormat();
+ if (rPageFrame && rPageFrame->isFrameAreaPositionValid() && pFormat
+ && (SwTextBoxHelper::isTextBox(pFormat, RES_FLYFRMFMT) ||
+ SwTextBoxHelper::isTextBox(pFormat, RES_DRAWFRMFMT)))
{
SwDoc* const pDoc = GetFormat()->GetDoc();