Kaydet (Commit) 003fd6b9 authored tarafından Gulsah Kose's avatar Gulsah Kose Kaydeden (comit) Maxim Monastirsky

tdf#90856 Hide "Format Area" command for line objects in Writer

Change-Id: Ib90aba380be7eeef3c7418ea85b553079794cf87
Signed-off-by: 's avatarGulsah Kose <gulsah.1004@gmail.com>
üst 63a5e37a
...@@ -46,7 +46,7 @@ public: ...@@ -46,7 +46,7 @@ public:
void Execute(SfxRequest &); void Execute(SfxRequest &);
void GetState(SfxItemSet &); void GetState(SfxItemSet &);
void GetDrawAttrStateForIFBX( SfxItemSet& rSet ); void GetDrawAttrStateForIFBX( SfxItemSet& rSet );
void DisableState(SfxItemSet &rSet) { Disable(rSet);} void DisableState(SfxItemSet &rSet);
bool Disable(SfxItemSet& rSet, sal_uInt16 nWhich = 0); bool Disable(SfxItemSet& rSet, sal_uInt16 nWhich = 0);
}; };
......
...@@ -745,6 +745,31 @@ bool SwDrawBaseShell::Disable(SfxItemSet& rSet, sal_uInt16 nWhich) ...@@ -745,6 +745,31 @@ bool SwDrawBaseShell::Disable(SfxItemSet& rSet, sal_uInt16 nWhich)
return bDisable; 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 // Validate of drawing positions
IMPL_LINK(SwDrawBaseShell, ValidatePosition, SvxSwFrameValidation&, rValidation, void ) IMPL_LINK(SwDrawBaseShell, ValidatePosition, SvxSwFrameValidation&, rValidation, void )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment