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) ...@@ -1574,18 +1574,29 @@ uno::Any SwXShape::getPropertyValue(const OUString& rPropertyName)
// without conversion to layout direction as below // without conversion to layout direction as below
aRet = _getPropAtAggrObj( OUString("EndPosition") ); 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(); SvxShape* pSvxShape = GetSvxShape();
SAL_WARN_IF(!pSvxShape, "sw.uno", "No SvxShape found!"); SAL_WARN_IF(!pSvxShape, "sw.uno", "No SvxShape found!");
sal_Int16 nPercent = 0; sal_Int16 nRet = 0;
if (pSvxShape) if (pSvxShape)
{ {
SdrObject* pObj = pSvxShape->GetSdrObject(); SdrObject* pObj = pSvxShape->GetSdrObject();
if (pObj->GetRelativeHeight()) switch (pEntry->nMemberId)
nPercent = *pObj->GetRelativeHeight() * 100; {
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 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