Kaydet (Commit) 34d46585 authored tarafından Miklos Vajna's avatar Miklos Vajna

SwDrawContact: recaclc textbox size on shape adjustment change as well

Change-Id: I65abec66d56f2bf83e28c85589638cea5f3a7a0c
üst aac149e4
...@@ -538,7 +538,7 @@ void SwTextBoxHelper::syncFlyFrmAttr(SwFrmFmt& rShape, SfxItemSet& rSet) ...@@ -538,7 +538,7 @@ void SwTextBoxHelper::syncFlyFrmAttr(SwFrmFmt& rShape, SfxItemSet& rSet)
break; break;
default: default:
SAL_WARN("sw.core", "SwTextBoxHelper::syncFlyFrmAttr: unhandled which-id: " << nWhich); SAL_WARN("sw.core", "SwTextBoxHelper::syncFlyFrmAttr: unhandled which-id: " << nWhich);
break; break;
} }
if (aIter.IsAtEnd()) if (aIter.IsAtEnd())
......
...@@ -1152,6 +1152,19 @@ class NestedUserCallHdl ...@@ -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!!! // !!!ATTENTION!!! The object may commit suicide!!!
void SwDrawContact::_Changed( const SdrObject& rObj, void SwDrawContact::_Changed( const SdrObject& rObj,
...@@ -1385,15 +1398,13 @@ void SwDrawContact::_Changed( const SdrObject& rObj, ...@@ -1385,15 +1398,13 @@ void SwDrawContact::_Changed( const SdrObject& rObj,
} }
} }
if (SwTextBoxHelper::findTextBox(GetFmt())) lcl_textBoxSizeNotify(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);
}
} }
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; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment