summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-06-02 11:27:36 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-06-02 11:40:03 +0200
commit8007579865e48a626a186ad10e1c2dc1872757dc (patch)
treeeb56f92d7e116c201e34463755a062a10d97ba04
parent6b4c596b01039324cfe78f38c4e3ffb9080bcd34 (diff)
SwTextBoxHelper: take care of position after a CustomShapeGeometry change
This is required by the ODF import, as that sets the CustomShapeGeometry after setting other properties (like Transformation, which includes the position/size). Change-Id: I299a1b302d55b3753a0a6b2142ea173f5f134b39
-rw-r--r--sw/source/core/doc/textboxhelper.cxx11
1 files changed, 11 insertions, 0 deletions
diff --git a/sw/source/core/doc/textboxhelper.cxx b/sw/source/core/doc/textboxhelper.cxx
index 34e959000301..e8411da9bc04 100644
--- a/sw/source/core/doc/textboxhelper.cxx
+++ b/sw/source/core/doc/textboxhelper.cxx
@@ -243,7 +243,18 @@ Rectangle SwTextBoxHelper::getTextRectangle(SwFrmFmt* pShape, bool bAbsolute)
void SwTextBoxHelper::syncProperty(SwFrmFmt* pShape, const OUString& rPropertyName, const css::uno::Any& /*rValue*/)
{
if (rPropertyName == "CustomShapeGeometry")
+ {
+ // CustomShapeGeometry changes the textbox position offset and size, so adjust both.
syncProperty(pShape, RES_FRM_SIZE, MID_FRMSIZE_SIZE, uno::Any());
+
+ SdrObject* pObject = pShape->FindRealSdrObject();
+ if (pObject)
+ {
+ Rectangle aRectangle(pObject->GetSnapRect());
+ syncProperty(pShape, RES_HORI_ORIENT, MID_HORIORIENT_POSITION, uno::makeAny(static_cast<sal_Int32>(convertTwipToMm100(aRectangle.Left()))));
+ syncProperty(pShape, RES_VERT_ORIENT, MID_VERTORIENT_POSITION, uno::makeAny(static_cast<sal_Int32>(convertTwipToMm100(aRectangle.Top()))));
+ }
+ }
}
void SwTextBoxHelper::syncProperty(SwFrmFmt* pShape, sal_uInt16 nWID, sal_uInt8 nMemberId, const css::uno::Any& rValue)