[Libreoffice-commits] core.git: 4 commits - offapi/com sw/source

Miklos Vajna vmiklos at collabora.co.uk
Mon Feb 24 03:16:39 PST 2014


 offapi/com/sun/star/drawing/Shape.idl |   30 ++++++++++++++++++++++++++++++
 sw/source/core/unocore/unodraw.cxx    |   32 ++++++++++++++++++++++++++++++++
 2 files changed, 62 insertions(+)

New commits:
commit 43d7f4e3640c5e370fd1204739c2b0c7eb5f40e4
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Mon Feb 24 11:43:39 2014 +0100

    offapi: document the 4 new properties which are no longer read-only
    
    Change-Id: Ia2844af91159bf4a512fcb70883fc6a1eddfce35

diff --git a/offapi/com/sun/star/drawing/Shape.idl b/offapi/com/sun/star/drawing/Shape.idl
index 64f8ab4..daa87b2 100644
--- a/offapi/com/sun/star/drawing/Shape.idl
+++ b/offapi/com/sun/star/drawing/Shape.idl
@@ -164,6 +164,36 @@ published service Shape
         first moved out from this grab bag to a separate property.</p>
     */
     [optional, property] sequence<com::sun::star::beans::PropertyValue> InteropGrabBag;
+
+    /** contains the relative height of the object.
+        <p> It is only valid if it is greater than zero.</p>
+
+        @since LibreOffice 4.3
+     */
+    [optional, property] short RelativeHeight;
+
+    /** contains the relative width of the object.
+        <p> It is only valid if it is greater than zero. </p>
+
+        @since LibreOffice 4.3
+     */
+    [optional, property] short RelativeWidth;
+
+    /** contains the relation of the relative height of the object.
+        <p> It is only valid if RelativeHeight is greater than zero.</p>
+
+        @see com::sun::star::text::RelOrientation
+        @since LibreOffice 4.3
+     */
+    [optional, property] short RelativeHeightRelation;
+
+    /** contains the relation of the relative width of the object.
+        <p> It is only valid if RelativeWidth is greater than zero.</p>
+
+        @see com::sun::star::text::RelOrientation
+        @since LibreOffice 4.3
+     */
+    [optional, property] short RelativeWidthRelation;
 };
 
 
commit 7b9aa420d368e080431f230f56993bcd8b324829
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Mon Feb 24 11:37:38 2014 +0100

    SwXShape: implement reading the Relative*Relation properties
    
    Change-Id: I1e99a2ff08c83ac361ab001e90047d9b8d5524fc

diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx
index 145e0c0..a9377da 100644
--- a/sw/source/core/unocore/unodraw.cxx
+++ b/sw/source/core/unocore/unodraw.cxx
@@ -1576,7 +1576,9 @@ uno::Any SwXShape::getPropertyValue(const OUString& rPropertyName)
                 }
                 else if (pEntry->nWID == RES_FRM_SIZE &&
                          (pEntry->nMemberId == MID_FRMSIZE_REL_HEIGHT ||
-                          pEntry->nMemberId == MID_FRMSIZE_REL_WIDTH))
+                          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!");
@@ -1594,6 +1596,12 @@ uno::Any SwXShape::getPropertyValue(const OUString& rPropertyName)
                             if (pObj->GetRelativeHeight())
                                 nRet = *pObj->GetRelativeHeight() * 100;
                             break;
+                        case MID_FRMSIZE_REL_WIDTH_RELATION:
+                            nRet = pObj->GetRelativeWidthRelation();
+                            break;
+                        case MID_FRMSIZE_REL_HEIGHT_RELATION:
+                            nRet = pObj->GetRelativeHeightRelation();
+                            break;
                         }
                     }
                     aRet = uno::makeAny(nRet);
commit 9fadea73d3c5b4fec07591d5bfcce7aed71296fb
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Mon Feb 24 11:33:00 2014 +0100

    SwXShape: implement reading the RelativeWidth property
    
    Change-Id: I40d451c170699ed7616c1159a354bd93444743c0

diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx
index ef6d293..145e0c0 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
                 {
commit 4e0f9a35faf9e8114c9f4c8280207edd70a470bb
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Mon Feb 24 11:21:10 2014 +0100

    SwXShape: implement reading of the RelativeHeight property
    
    Change-Id: I479eabcd45b741a633d7d00b2bdcbd3d0dcbf0ff

diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx
index b3c7c0c..ef6d293 100644
--- a/sw/source/core/unocore/unodraw.cxx
+++ b/sw/source/core/unocore/unodraw.cxx
@@ -1574,6 +1574,19 @@ 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)
+                {
+                    SvxShape* pSvxShape = GetSvxShape();
+                    SAL_WARN_IF(!pSvxShape, "sw.uno", "No SvxShape found!");
+                    sal_Int16 nPercent = 0;
+                    if (pSvxShape)
+                    {
+                        SdrObject* pObj = pSvxShape->GetSdrObject();
+                        if (pObj->GetRelativeHeight())
+                            nPercent = *pObj->GetRelativeHeight() * 100;
+                    }
+                    aRet = uno::makeAny(nPercent);
+                }
                 else
                 {
                     const SwAttrSet& rSet = pFmt->GetAttrSet();


More information about the Libreoffice-commits mailing list