diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-06-25 10:33:06 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-06-25 15:29:51 +0100 |
commit | a0ded09c55f944f57201651032eed5dcf7e22e48 (patch) | |
tree | 8b09bd795fcc38ba7bba3b55232ab9d1caa9b37d /sd | |
parent | df7595a5f5871f8343e4ee3869ad153e3ae4a7f3 (diff) |
implement equalize width and height for impress/draw
Equalize width/height adjusts width/height of selected objects to the
width/height of the last selected object.
Change-Id: I7c222a6591112cb674322d310ebd87f04a9198bd
Diffstat (limited to 'sd')
-rw-r--r-- | sd/sdi/_drvwsh.sdi | 10 | ||||
-rw-r--r-- | sd/source/ui/view/drviews2.cxx | 13 | ||||
-rw-r--r-- | sd/source/ui/view/drviewsj.cxx | 16 | ||||
-rw-r--r-- | sd/uiconfig/sdraw/menubar/menubar.xml | 3 |
4 files changed, 38 insertions, 4 deletions
diff --git a/sd/sdi/_drvwsh.sdi b/sd/sdi/_drvwsh.sdi index 0b5469bfc660..6b2f17ccbe08 100644 --- a/sd/sdi/_drvwsh.sdi +++ b/sd/sdi/_drvwsh.sdi @@ -507,6 +507,16 @@ interface DrawView ExecMethod = FuTemporary ; StateMethod = GetMenuState ; ] + SID_EQUALIZEWIDTH // ole : no, status : ? + [ + ExecMethod = FuTemporary ; + StateMethod = GetMenuState ; + ] + SID_EQUALIZEHEIGHT // ole : no, status : ? + [ + ExecMethod = FuTemporary ; + StateMethod = GetMenuState ; + ] SID_CONNECT // ole : no, status : ? [ ExecMethod = FuTemporary ; diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx index ffbb503d834d..90c3d599291d 100644 --- a/sd/source/ui/view/drviews2.cxx +++ b/sd/source/ui/view/drviews2.cxx @@ -2272,6 +2272,19 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) } break; + case SID_EQUALIZEWIDTH: + case SID_EQUALIZEHEIGHT: + { + // End text edit to avoid conflicts + if(mpDrawView->IsTextEdit()) + mpDrawView->SdrEndTextEdit(); + + mpDrawView->EqualizeMarkedObjects(nSId == SID_EQUALIZEWIDTH); + Cancel(); + rReq.Done (); + } + break; + case SID_DISMANTLE: // BASIC { if ( mpDrawView->IsDismantlePossible(false) ) diff --git a/sd/source/ui/view/drviewsj.cxx b/sd/source/ui/view/drviewsj.cxx index 857601ffa853..10a3f5ad403b 100644 --- a/sd/source/ui/view/drviewsj.cxx +++ b/sd/source/ui/view/drviewsj.cxx @@ -284,13 +284,15 @@ void DrawViewShell::GetMenuStateSel( SfxItemSet &rSet ) rSet.Put(SfxBoolItem(SID_OUTLINE_TEXT_AUTOFIT, bSet)); } - rSet.DisableItem( SID_GROUP ); - rSet.DisableItem( SID_COMBINE ); + rSet.DisableItem(SID_GROUP); + rSet.DisableItem(SID_COMBINE); rSet.DisableItem(SID_DISTRIBUTE_DLG); rSet.DisableItem(SID_POLY_MERGE); rSet.DisableItem(SID_POLY_SUBSTRACT); rSet.DisableItem(SID_POLY_INTERSECT); - rSet.DisableItem( SID_CONNECT ); + rSet.DisableItem(SID_EQUALIZEWIDTH); + rSet.DisableItem(SID_EQUALIZEHEIGHT); + rSet.DisableItem(SID_CONNECT); } // multi-selection else if( nMarkCount > 1 ) @@ -377,6 +379,8 @@ void DrawViewShell::GetMenuStateSel( SfxItemSet &rSet ) rSet.DisableItem(SID_POLY_MERGE); rSet.DisableItem(SID_POLY_SUBSTRACT); rSet.DisableItem(SID_POLY_INTERSECT); + rSet.DisableItem(SID_EQUALIZEWIDTH); + rSet.DisableItem(SID_EQUALIZEHEIGHT); } if (b3dObj || @@ -438,10 +442,12 @@ void DrawViewShell::GetMenuStateSel( SfxItemSet &rSet ) } if ( !mpDrawView->IsCombinePossible(false) ) { - rSet.DisableItem( SID_COMBINE ); + rSet.DisableItem(SID_COMBINE); rSet.DisableItem(SID_POLY_MERGE); rSet.DisableItem(SID_POLY_SUBSTRACT); rSet.DisableItem(SID_POLY_INTERSECT); + rSet.DisableItem(SID_EQUALIZEWIDTH); + rSet.DisableItem(SID_EQUALIZEHEIGHT); } if ( !mpDrawView->IsCombinePossible(true) ) { @@ -501,6 +507,8 @@ void DrawViewShell::GetMenuStateSel( SfxItemSet &rSet ) rSet.DisableItem(SID_POLY_MERGE); rSet.DisableItem(SID_POLY_SUBSTRACT); rSet.DisableItem(SID_POLY_INTERSECT); + rSet.DisableItem(SID_EQUALIZEWIDTH); + rSet.DisableItem(SID_EQUALIZEHEIGHT); rSet.DisableItem( SID_CONNECT ); rSet.DisableItem( SID_ANIMATION_EFFECTS ); rSet.DisableItem( SID_MODIFY_FIELD ); diff --git a/sd/uiconfig/sdraw/menubar/menubar.xml b/sd/uiconfig/sdraw/menubar/menubar.xml index f12287b0b5f6..bc8cfeebf813 100644 --- a/sd/uiconfig/sdraw/menubar/menubar.xml +++ b/sd/uiconfig/sdraw/menubar/menubar.xml @@ -346,6 +346,9 @@ <menu:menuitem menu:id=".uno:Merge"/> <menu:menuitem menu:id=".uno:Substract"/> <menu:menuitem menu:id=".uno:Intersect"/> + <menu:menuseparator/> + <menu:menuitem menu:id=".uno:EqualizeWidth"/> + <menu:menuitem menu:id=".uno:EqualizeHeight"/> </menu:menupopup> </menu:menu> <menu:menuseparator/> |