summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/source/uibase/inc/drwbassh.hxx2
-rw-r--r--sw/source/uibase/shells/drwbassh.cxx25
2 files changed, 26 insertions, 1 deletions
diff --git a/sw/source/uibase/inc/drwbassh.hxx b/sw/source/uibase/inc/drwbassh.hxx
index 65565443dd66..78e02bbbc5dd 100644
--- a/sw/source/uibase/inc/drwbassh.hxx
+++ b/sw/source/uibase/inc/drwbassh.hxx
@@ -46,7 +46,7 @@ public:
void Execute(SfxRequest &);
void GetState(SfxItemSet &);
void GetDrawAttrStateForIFBX( SfxItemSet& rSet );
- void DisableState(SfxItemSet &rSet) { Disable(rSet);}
+ void DisableState(SfxItemSet &rSet);
bool Disable(SfxItemSet& rSet, sal_uInt16 nWhich = 0);
};
diff --git a/sw/source/uibase/shells/drwbassh.cxx b/sw/source/uibase/shells/drwbassh.cxx
index ac8bd590d96e..fa8f4c5383c3 100644
--- a/sw/source/uibase/shells/drwbassh.cxx
+++ b/sw/source/uibase/shells/drwbassh.cxx
@@ -745,6 +745,31 @@ bool SwDrawBaseShell::Disable(SfxItemSet& rSet, sal_uInt16 nWhich)
return bDisable;
}
+void SwDrawBaseShell::DisableState( SfxItemSet& rSet )
+{
+ SwWrtShell *pSh = &GetShell();
+ SdrView* pSdrView = pSh->GetDrawView();
+ const SdrMarkList& rMarkList = pSdrView->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 );
+ }
+
+ Disable(rSet);
+
+}
+
// Validate of drawing positions
IMPL_LINK(SwDrawBaseShell, ValidatePosition, SvxSwFrameValidation&, rValidation, void )