diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-02-24 11:33:00 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-02-24 12:16:14 +0100 |
commit | 9fadea73d3c5b4fec07591d5bfcce7aed71296fb (patch) | |
tree | 7716d23030f4cddaa4370661d5cd375c7d9f8308 /sw | |
parent | 4e0f9a35faf9e8114c9f4c8280207edd70a470bb (diff) |
SwXShape: implement reading the RelativeWidth property
Change-Id: I40d451c170699ed7616c1159a354bd93444743c0
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/unocore/unodraw.cxx | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx index ef6d29338386..145e0c0a4fe9 100644 --- a/sw/source/core/unocore/unodraw.cxx +++ b/sw/source/core/unocore/unodraw.cxx @@ -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 { |