diff options
Diffstat (limited to 'sw/source/core/layout/anchoreddrawobject.cxx')
-rw-r--r-- | sw/source/core/layout/anchoreddrawobject.cxx | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/sw/source/core/layout/anchoreddrawobject.cxx b/sw/source/core/layout/anchoreddrawobject.cxx index 9d450f9a26f7..8bdf1dbf587f 100644 --- a/sw/source/core/layout/anchoreddrawobject.cxx +++ b/sw/source/core/layout/anchoreddrawobject.cxx @@ -32,6 +32,8 @@ #include <IDocumentState.hxx> #include <txtfly.hxx> #include <viewimp.hxx> +#include <textboxhelper.hxx> +#include <unomid.h> using namespace ::com::sun::star; @@ -661,9 +663,22 @@ const SwRect SwAnchoredDrawObject::GetObjBoundRect() const bool bEnableSetModified = pDoc->getIDocumentState().IsEnableSetModified(); pDoc->getIDocumentState().SetEnableSetModified(false); - const_cast< SdrObject* >( GetDrawObj() )->Resize( aCurrObjRect.TopLeft(), + auto pObject = const_cast<SdrObject*>(GetDrawObj()); + pObject->Resize( aCurrObjRect.TopLeft(), Fraction( nTargetWidth, aCurrObjRect.GetWidth() ), Fraction( nTargetHeight, aCurrObjRect.GetHeight() ), false ); + + if (SwFrameFormat* pFrameFormat = FindFrameFormat(pObject)) + { + if (SwTextBoxHelper::isTextBox(pFrameFormat, RES_DRAWFRMFMT)) + { + // Shape has relative size and also a textbox, update its text area as well. + uno::Reference<drawing::XShape> xShape(pObject->getUnoShape(), uno::UNO_QUERY); + SwTextBoxHelper::syncProperty(pFrameFormat, RES_FRM_SIZE, MID_FRMSIZE_SIZE, + uno::makeAny(xShape->getSize())); + } + } + pDoc->getIDocumentState().SetEnableSetModified(bEnableSetModified); } } |