diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-02-20 12:07:51 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-02-20 12:34:32 +0100 |
commit | b548b2efb1a8aafcd5e56a1d26b933354ff02a47 (patch) | |
tree | 9279e16938db973c24ea5329f1ab4fa3cf37f564 | |
parent | b0bf124360730e79366e1be73383d4639e608a4c (diff) |
sw: enable Relative{Height,Width}Relation UNO properties for shapes
Change-Id: I40080bd9b096b9fa5d660b11c4e5821db31fd412
-rw-r--r-- | sw/source/core/unocore/unodraw.cxx | 19 | ||||
-rw-r--r-- | sw/source/core/unocore/unomap.cxx | 2 |
2 files changed, 18 insertions, 3 deletions
diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx index 4b48e46916cc..b3c7c0c7db6c 100644 --- a/sw/source/core/unocore/unodraw.cxx +++ b/sw/source/core/unocore/unodraw.cxx @@ -1258,7 +1258,9 @@ void SwXShape::setPropertyValue(const OUString& rPropertyName, const uno::Any& a } } else if( RES_FRM_SIZE == pEntry->nWID && - ( pEntry->nMemberId == MID_FRMSIZE_REL_HEIGHT || pEntry->nMemberId == MID_FRMSIZE_REL_WIDTH ) ) + ( pEntry->nMemberId == MID_FRMSIZE_REL_HEIGHT || pEntry->nMemberId == MID_FRMSIZE_REL_WIDTH + || pEntry->nMemberId == MID_FRMSIZE_REL_HEIGHT_RELATION + || pEntry->nMemberId == MID_FRMSIZE_REL_WIDTH_RELATION ) ) { SvxShape* pSvxShape = GetSvxShape(); SAL_WARN_IF(!pSvxShape, "sw.uno", "No SvxShape found!"); @@ -1267,10 +1269,21 @@ void SwXShape::setPropertyValue(const OUString& rPropertyName, const uno::Any& a SdrObject* pObj = pSvxShape->GetSdrObject(); sal_Int16 nPercent(100); aValue >>= nPercent; - if ( pEntry->nMemberId == MID_FRMSIZE_REL_WIDTH ) + switch (pEntry->nMemberId) + { + case MID_FRMSIZE_REL_WIDTH: pObj->SetRelativeWidth( nPercent / 100.0 ); - else + break; + case MID_FRMSIZE_REL_HEIGHT: pObj->SetRelativeHeight( nPercent / 100.0 ); + break; + case MID_FRMSIZE_REL_WIDTH_RELATION: + pObj->SetRelativeWidthRelation(nPercent); + break; + case MID_FRMSIZE_REL_HEIGHT_RELATION: + pObj->SetRelativeHeightRelation(nPercent); + break; + } } } else diff --git a/sw/source/core/unocore/unomap.cxx b/sw/source/core/unocore/unomap.cxx index eac4e79db2a3..1c596578a6f4 100644 --- a/sw/source/core/unocore/unomap.cxx +++ b/sw/source/core/unocore/unomap.cxx @@ -1328,7 +1328,9 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s // missing map entry for property <PageToogle> { OUString(UNO_NAME_PAGE_TOGGLE), RES_HORI_ORIENT, cppu::UnoType<bool>::get(), PROPERTY_NONE ,MID_HORIORIENT_PAGETOGGLE }, { OUString(UNO_NAME_RELATIVE_HEIGHT), RES_FRM_SIZE, cppu::UnoType<sal_Int16>::get() , PROPERTY_NONE, MID_FRMSIZE_REL_HEIGHT }, + { OUString(UNO_NAME_RELATIVE_HEIGHT_RELATION), RES_FRM_SIZE, cppu::UnoType<sal_Int16>::get(), PROPERTY_NONE, MID_FRMSIZE_REL_HEIGHT_RELATION }, { OUString(UNO_NAME_RELATIVE_WIDTH), RES_FRM_SIZE, cppu::UnoType<sal_Int16>::get() , PROPERTY_NONE, MID_FRMSIZE_REL_WIDTH }, + { OUString(UNO_NAME_RELATIVE_WIDTH_RELATION), RES_FRM_SIZE, cppu::UnoType<sal_Int16>::get(), PROPERTY_NONE, MID_FRMSIZE_REL_WIDTH_RELATION }, { OUString(), 0, css::uno::Type(), 0, 0 } }; aMapEntriesArr[nPropertyId] = aShapeMap_Impl; |