summaryrefslogtreecommitdiff
path: root/sw/source/core/draw/dcontact.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/core/draw/dcontact.cxx')
-rw-r--r--sw/source/core/draw/dcontact.cxx5
1 files changed, 4 insertions, 1 deletions
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();