diff options
Diffstat (limited to 'sw/source/core/doc/textboxhelper.cxx')
-rw-r--r-- | sw/source/core/doc/textboxhelper.cxx | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/sw/source/core/doc/textboxhelper.cxx b/sw/source/core/doc/textboxhelper.cxx index abe8f38d2124..9bcd522e4277 100644 --- a/sw/source/core/doc/textboxhelper.cxx +++ b/sw/source/core/doc/textboxhelper.cxx @@ -168,21 +168,21 @@ void SwTextBoxHelper::create(SwFrameFormat* pShape, bool bCopyText) // TODO: Text dialog attr setting to frame // Check if the shape had text before and move it to the new textframe - if (bCopyText && !sCopyableText.isEmpty()) + if (!bCopyText || sCopyableText.isEmpty()) + return; + + auto pSdrShape = pShape->FindRealSdrObject(); + if (pSdrShape) { - auto pSdrShape = pShape->FindRealSdrObject(); - if (pSdrShape) - { - auto pSourceText = dynamic_cast<SdrTextObj*>(pSdrShape); - uno::Reference<text::XTextRange> xDestText(xRealTextFrame, uno::UNO_QUERY); + auto pSourceText = dynamic_cast<SdrTextObj*>(pSdrShape); + uno::Reference<text::XTextRange> xDestText(xRealTextFrame, uno::UNO_QUERY); - xDestText->setString(sCopyableText); + xDestText->setString(sCopyableText); - if (pSourceText) - pSourceText->SetText(OUString()); + if (pSourceText) + pSourceText->SetText(OUString()); - pShape->GetDoc()->getIDocumentState().SetModified(); - } + pShape->GetDoc()->getIDocumentState().SetModified(); } } |