diff options
author | Gulsah Kose <gulsah.1004@gmail.com> | 2017-03-06 10:22:14 +0300 |
---|---|---|
committer | Maxim Monastirsky <momonasmon@gmail.com> | 2017-03-24 10:57:44 +0300 |
commit | 003fd6b95033a2a0d28e04dec2e756e4c67f9d1a (patch) | |
tree | 46f3e4f781e7afdab8f2e0ffebec16f8fae5f759 | |
parent | 63a5e37a45e48b9f0c9ae2b632042e2a2d57dcbf (diff) |
tdf#90856 Hide "Format Area" command for line objects in Writer
Change-Id: Ib90aba380be7eeef3c7418ea85b553079794cf87
Signed-off-by: Gulsah Kose <gulsah.1004@gmail.com>
-rw-r--r-- | sw/source/uibase/inc/drwbassh.hxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/shells/drwbassh.cxx | 25 |
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 ) |