diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-06-20 17:48:33 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-06-20 18:03:26 +0200 |
commit | 34d4658584ae58b1022f84367a31c234c0e326a3 (patch) | |
tree | 2ea84d6f251afae596a3ae32f0bd2d61b1748168 /sw | |
parent | aac149e4ad06e207e6c1b14f11867dbfbd343ab2 (diff) |
SwDrawContact: recaclc textbox size on shape adjustment change as well
Change-Id: I65abec66d56f2bf83e28c85589638cea5f3a7a0c
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/doc/textboxhelper.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/draw/dcontact.cxx | 27 |
2 files changed, 20 insertions, 9 deletions
diff --git a/sw/source/core/doc/textboxhelper.cxx b/sw/source/core/doc/textboxhelper.cxx index 7e70b4e0f8ea..70f3ef8b857b 100644 --- a/sw/source/core/doc/textboxhelper.cxx +++ b/sw/source/core/doc/textboxhelper.cxx @@ -538,7 +538,7 @@ void SwTextBoxHelper::syncFlyFrmAttr(SwFrmFmt& rShape, SfxItemSet& rSet) break; default: SAL_WARN("sw.core", "SwTextBoxHelper::syncFlyFrmAttr: unhandled which-id: " << nWhich); - break; + break; } if (aIter.IsAtEnd()) diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx index 1c400daac0fc..11ffaf829f30 100644 --- a/sw/source/core/draw/dcontact.cxx +++ b/sw/source/core/draw/dcontact.cxx @@ -1152,6 +1152,19 @@ class NestedUserCallHdl } }; +/// Notify the format's textbox that it should reconsider its position / size. +void lcl_textBoxSizeNotify(SwFrmFmt* pFmt) +{ + if (SwTextBoxHelper::findTextBox(pFmt)) + { + // Just notify the textbox that the size has changed, the actual object size is not interesting. + SfxItemSet aResizeSet(pFmt->GetDoc()->GetAttrPool(), RES_FRM_SIZE, RES_FRM_SIZE, 0); + SwFmtFrmSize aSize; + aResizeSet.Put(aSize); + SwTextBoxHelper::syncFlyFrmAttr(*pFmt, aResizeSet); + } +} + // !!!ATTENTION!!! The object may commit suicide!!! void SwDrawContact::_Changed( const SdrObject& rObj, @@ -1385,15 +1398,13 @@ void SwDrawContact::_Changed( const SdrObject& rObj, } } - if (SwTextBoxHelper::findTextBox(GetFmt())) - { - // Just notify the textbox that the size has changed, the actual object size is not interesting. - SfxItemSet aResizeSet(GetFmt()->GetDoc()->GetAttrPool(), RES_FRM_SIZE, RES_FRM_SIZE, 0); - SwFmtFrmSize aSize; - aResizeSet.Put(aSize); - SwTextBoxHelper::syncFlyFrmAttr(*GetFmt(), aResizeSet); - } + lcl_textBoxSizeNotify(GetFmt()); } + else if (eType == SDRUSERCALL_RESIZE) + // Even if the bounding box of the shape didn't change, + // notify about the size change, as an adjustment change + // may affect the size of the underlying textbox. + lcl_textBoxSizeNotify(GetFmt()); } } break; |