summaryrefslogtreecommitdiff
path: root/sc/source/ui/drawfunc/drawsh2.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/ui/drawfunc/drawsh2.cxx')
-rw-r--r--sc/source/ui/drawfunc/drawsh2.cxx16
1 files changed, 16 insertions, 0 deletions
diff --git a/sc/source/ui/drawfunc/drawsh2.cxx b/sc/source/ui/drawfunc/drawsh2.cxx
index 5ec9cb43cf0c..3188e05394dd 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 )
{