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
This commit is contained in:
parent
6b4c596b01
commit
8007579865
1 changed files with 11 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue