[Libreoffice-commits] core.git: sc/source

Gulsah Kose gulsah.1004 at gmail.com
Fri Mar 3 10:33:36 UTC 2017


 sc/source/ui/drawfunc/drawsh2.cxx |   16 ++++++++++++++++
 1 file changed, 16 insertions(+)

New commits:
commit f5c4e9dec5a67dbb7d5e42e8956d3f9d74c54fcc
Author: Gulsah Kose <gulsah.1004 at gmail.com>
Date:   Fri Mar 3 00:41:09 2017 +0300

    tdf#90856 Hide "Format Area" command for line objects in Calc
    
    Change-Id: If9e4828f5f0073fba126f9e017a596034efd6348
    Signed-off-by: Gulsah Kose <gulsah.1004 at gmail.com>
    Reviewed-on: https://gerrit.libreoffice.org/34834
    Reviewed-by: Katarina Behrens <Katarina.Behrens at cib.de>
    Tested-by: Katarina Behrens <Katarina.Behrens at cib.de>

diff --git a/sc/source/ui/drawfunc/drawsh2.cxx b/sc/source/ui/drawfunc/drawsh2.cxx
index 5ec9cb4..3188e05 100644
--- a/sc/source/ui/drawfunc/drawsh2.cxx
+++ b/sc/source/ui/drawfunc/drawsh2.cxx
@@ -347,6 +347,22 @@ void ScDrawShell::GetAttrFuncState(SfxItemSet &rSet)
 
     ScDrawView* pDrView = pViewData->GetScDrawView();
     SfxItemSet aViewSet = pDrView->GetAttrFromMarked(false);
+    const SdrMarkList& rMarkList = pDrView->GetMarkedObjectList();
+
+    if ( rMarkList.GetMarkCount() == 1 )
+    {
+        SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
+        sal_uInt16 nObjType = pObj->GetObjIdentifier();
+
+        // If marked object is 2D, disable format area command.
+        if ( nObjType == OBJ_PLIN     ||
+             nObjType == OBJ_LINE     ||
+             nObjType == OBJ_PATHLINE ||
+             nObjType == OBJ_FREELINE ||
+             nObjType == OBJ_EDGE     ||
+             nObjType == OBJ_CARC )
+            rSet.DisableItem( SID_ATTRIBUTES_AREA );
+    }
 
     if ( aViewSet.GetItemState( XATTR_LINESTYLE ) == SfxItemState::DEFAULT )
     {


More information about the Libreoffice-commits mailing list