Kaydet (Commit) 9fadea73 authored tarafından Miklos Vajna's avatar Miklos Vajna

SwXShape: implement reading the RelativeWidth property

Change-Id: I40d451c170699ed7616c1159a354bd93444743c0
üst 4e0f9a35
......@@ -1574,18 +1574,29 @@ uno::Any SwXShape::getPropertyValue(const OUString& rPropertyName)
// without conversion to layout direction as below
aRet = _getPropAtAggrObj( OUString("EndPosition") );
}
else if (pEntry->nWID == RES_FRM_SIZE && pEntry->nMemberId == MID_FRMSIZE_REL_HEIGHT)
else if (pEntry->nWID == RES_FRM_SIZE &&
(pEntry->nMemberId == MID_FRMSIZE_REL_HEIGHT ||
pEntry->nMemberId == MID_FRMSIZE_REL_WIDTH))
{
SvxShape* pSvxShape = GetSvxShape();
SAL_WARN_IF(!pSvxShape, "sw.uno", "No SvxShape found!");
sal_Int16 nPercent = 0;
sal_Int16 nRet = 0;
if (pSvxShape)
{
SdrObject* pObj = pSvxShape->GetSdrObject();
if (pObj->GetRelativeHeight())
nPercent = *pObj->GetRelativeHeight() * 100;
switch (pEntry->nMemberId)
{
case MID_FRMSIZE_REL_WIDTH:
if (pObj->GetRelativeWidth())
nRet = *pObj->GetRelativeWidth() * 100;
break;
case MID_FRMSIZE_REL_HEIGHT:
if (pObj->GetRelativeHeight())
nRet = *pObj->GetRelativeHeight() * 100;
break;
}
}
aRet = uno::makeAny(nPercent);
aRet = uno::makeAny(nRet);
}
else
{
......
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