diff options
author | giacco <filippo.giacche@gmail.com> | 2016-10-20 10:03:44 +0200 |
---|---|---|
committer | jan iversen <jani@documentfoundation.org> | 2016-12-23 18:29:37 +0000 |
commit | 5f116966de4c0d007c2a420b7adc74d72e728b89 (patch) | |
tree | e64d178e0e7ba65b99ad60c9dab364d10b1694b3 | |
parent | 5c983bc2ab020b0dbbd8f58e66b9a6fd8508bfde (diff) |
tdf#87700 command to rotate 180 degrees
added command to rotate an image 180 degrees in Writer
Change-Id: I4a1e40f4c3475aceb24edd44691a74372f61b49a
Reviewed-on: https://gerrit.libreoffice.org/30074
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Reviewed-by: Heiko Tietze <tietze.heiko@googlemail.com>
Reviewed-by: jan iversen <jani@documentfoundation.org>
Tested-by: jan iversen <jani@documentfoundation.org>
23 files changed, 101 insertions, 3 deletions
diff --git a/include/svx/svxids.hrc b/include/svx/svxids.hrc index 6f6aaa563e3a..ead4ae0ac6ff 100644 --- a/include/svx/svxids.hrc +++ b/include/svx/svxids.hrc @@ -947,6 +947,8 @@ #define SID_ATTR_SPECIALCHAR ( SID_SVX_START + 1120 ) #define SID_ROTATE_GRAPHIC_LEFT ( SID_SVX_START + 1121 ) #define SID_ROTATE_GRAPHIC_RIGHT ( SID_SVX_START + 1122 ) +#define SID_ROTATE_GRAPHIC_180 ( SID_SVX_START + 1123 ) + // new slots for panels #define SID_ATTR_FILL_TRANSPARENCE ( SID_SVX_START + 1124 ) diff --git a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu index 177ab9b26e8d..703b048211eb 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu @@ -980,6 +980,14 @@ <value>1</value> </prop> </node> + <node oor:name=".uno:Rotate180" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="en-US">Rotate 1~80°</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> <node oor:name=".uno:NewHtmlDoc" oor:op="replace"> <prop oor:name="Label" oor:type="xs:string"> <value xml:lang="en-US">Create ~HTML Document</value> diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi index 99a8bc0115b7..2029d785dbfd 100644 --- a/svx/sdi/svx.sdi +++ b/svx/sdi/svx.sdi @@ -4395,7 +4395,22 @@ SfxVoidItem RotateLeft SID_ROTATE_GRAPHIC_LEFT ToolBoxConfig = TRUE, GroupId = GID_GRAPHIC; ] +SfxVoidItem Rotate180 SID_ROTATE_GRAPHIC_180 +[ + AutoUpdate = FALSE, + FastCall = FALSE, + ReadOnlyDoc = TRUE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + + AccelConfig = TRUE, + MenuConfig = TRUE, + ToolBoxConfig = TRUE, + GroupId = GID_GRAPHIC; +] SfxVoidItem RotateRight SID_ROTATE_GRAPHIC_RIGHT [ diff --git a/sw/sdi/_grfsh.sdi b/sw/sdi/_grfsh.sdi index bf8270c74bef..be017d104ab2 100644 --- a/sw/sdi/_grfsh.sdi +++ b/sw/sdi/_grfsh.sdi @@ -80,6 +80,13 @@ interface BaseTextGraphic DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR"; ] + SID_ROTATE_GRAPHIC_180 + [ + ExecMethod = ExecuteRotation ; + StateMethod = GetAttrStateForRotation ; + DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR"; + ] + SID_ROTATE_GRAPHIC_RIGHT [ ExecMethod = ExecuteRotation ; diff --git a/sw/source/uibase/shells/grfsh.cxx b/sw/source/uibase/shells/grfsh.cxx index 73064dff0787..953fd25f9327 100644 --- a/sw/source/uibase/shells/grfsh.cxx +++ b/sw/source/uibase/shells/grfsh.cxx @@ -849,6 +849,10 @@ void SwGrfShell::ExecuteRotation(SfxRequest &rReq) { aRotation = 2700; } + else if (rReq.GetSlot() == SID_ROTATE_GRAPHIC_180) + { + aRotation = 1800; + } else { return; @@ -863,12 +867,23 @@ void SwGrfShell::ExecuteRotation(SfxRequest &rReq) rShell.ReRead(OUString(), OUString(), const_cast<const Graphic*>(&aGraphic)); SwFlyFrameAttrMgr aManager(false, &rShell, rShell.IsFrameSelected() ? Frmmgr_Type::NONE : Frmmgr_Type::GRF); - const long nRotatedWidth = aManager.GetSize().Height(); - const long nRotatedHeight = aManager.GetSize().Width(); + long nRotatedWidth = 0; + long nRotatedHeight = 0; + if(rReq.GetSlot() == SID_ROTATE_GRAPHIC_180) + { + nRotatedWidth = aManager.GetSize().Width(); + nRotatedHeight = aManager.GetSize().Height(); + + } + else + { + nRotatedWidth = aManager.GetSize().Height(); + nRotatedHeight = aManager.GetSize().Width(); + + } Size aSize(nRotatedWidth, nRotatedHeight); aManager.SetSize(aSize); aManager.UpdateFlyFrame(); - SfxItemSet aSet( rShell.GetAttrPool(), RES_GRFATR_CROPGRF, RES_GRFATR_CROPGRF ); rShell.GetCurAttr( aSet ); SwCropGrf aCrop( static_cast<const SwCropGrf&>( aSet.Get(RES_GRFATR_CROPGRF) ) ); @@ -888,6 +903,13 @@ void SwGrfShell::ExecuteRotation(SfxRequest &rReq) aCrop.SetRight( aCropRectangle.Top() ); aCrop.SetBottom( aCropRectangle.Right() ); } + else if (rReq.GetSlot() == SID_ROTATE_GRAPHIC_180) + { + aCrop.SetLeft( aCropRectangle.Right() ); + aCrop.SetTop( aCropRectangle.Bottom() ); + aCrop.SetRight( aCropRectangle.Left() ); + aCrop.SetBottom( aCropRectangle.Top() ); + } rShell.SetAttrItem(aCrop); @@ -911,6 +933,7 @@ void SwGrfShell::GetAttrStateForRotation(SfxItemSet &rSet) { case SID_ROTATE_GRAPHIC_LEFT: case SID_ROTATE_GRAPHIC_RIGHT: + case SID_ROTATE_GRAPHIC_180: if( rShell.GetGraphicType() == GraphicType::NONE ) { bDisable = true; diff --git a/sw/uiconfig/sglobal/menubar/menubar.xml b/sw/uiconfig/sglobal/menubar/menubar.xml index e6dbe3d53275..adda991cb408 100644 --- a/sw/uiconfig/sglobal/menubar/menubar.xml +++ b/sw/uiconfig/sglobal/menubar/menubar.xml @@ -328,6 +328,7 @@ <menu:menupopup> <menu:menuitem menu:id=".uno:RotateLeft"/> <menu:menuitem menu:id=".uno:RotateRight"/> + <menu:menuitem menu:id=".uno:Rotate180"/> </menu:menupopup> </menu:menu> <menu:menu menu:id=".uno:GroupMenu"> diff --git a/sw/uiconfig/sglobal/popupmenu/graphic.xml b/sw/uiconfig/sglobal/popupmenu/graphic.xml index 1286b7747f42..ae7bad963939 100644 --- a/sw/uiconfig/sglobal/popupmenu/graphic.xml +++ b/sw/uiconfig/sglobal/popupmenu/graphic.xml @@ -58,6 +58,7 @@ <menu:menupopup> <menu:menuitem menu:id=".uno:RotateLeft"/> <menu:menuitem menu:id=".uno:RotateRight"/> + <menu:menuitem menu:id=".uno:Rotate180"/> </menu:menupopup> </menu:menu> <menu:menuseparator/> diff --git a/sw/uiconfig/sglobal/toolbar/graphicobjectbar.xml b/sw/uiconfig/sglobal/toolbar/graphicobjectbar.xml index 1f27f3c6bbd9..a4529094136b 100644 --- a/sw/uiconfig/sglobal/toolbar/graphicobjectbar.xml +++ b/sw/uiconfig/sglobal/toolbar/graphicobjectbar.xml @@ -30,6 +30,7 @@ <toolbar:toolbaritem xlink:href=".uno:FlipHorizontal" toolbar:helpid="20425"/> <toolbar:toolbaritem xlink:href=".uno:RotateLeft" toolbar:helpid=""/> <toolbar:toolbaritem xlink:href=".uno:RotateRight" toolbar:helpid=""/> + <toolbar:toolbaritem xlink:href=".uno:Rotate180" toolbar:helpid=""/> <toolbar:toolbaritem xlink:href=".uno:Crop" toolbar:helpid=""/> <toolbar:toolbarseparator/> <toolbar:toolbaritem xlink:href=".uno:FrameDialog" toolbar:helpid="20458"/> diff --git a/sw/uiconfig/sweb/menubar/menubar.xml b/sw/uiconfig/sweb/menubar/menubar.xml index c3638db27f4c..b8c06c67ddd4 100644 --- a/sw/uiconfig/sweb/menubar/menubar.xml +++ b/sw/uiconfig/sweb/menubar/menubar.xml @@ -273,6 +273,7 @@ <menu:menupopup> <menu:menuitem menu:id=".uno:RotateLeft"/> <menu:menuitem menu:id=".uno:RotateRight"/> + <menu:menuitem menu:id=".uno:Rotate180"/> </menu:menupopup> </menu:menu> <menu:menu menu:id=".uno:GroupMenu"> diff --git a/sw/uiconfig/sweb/popupmenu/graphic.xml b/sw/uiconfig/sweb/popupmenu/graphic.xml index 1286b7747f42..ae7bad963939 100644 --- a/sw/uiconfig/sweb/popupmenu/graphic.xml +++ b/sw/uiconfig/sweb/popupmenu/graphic.xml @@ -58,6 +58,7 @@ <menu:menupopup> <menu:menuitem menu:id=".uno:RotateLeft"/> <menu:menuitem menu:id=".uno:RotateRight"/> + <menu:menuitem menu:id=".uno:Rotate180"/> </menu:menupopup> </menu:menu> <menu:menuseparator/> diff --git a/sw/uiconfig/swform/menubar/menubar.xml b/sw/uiconfig/swform/menubar/menubar.xml index cefc7be45f5d..80ef99ea6784 100644 --- a/sw/uiconfig/swform/menubar/menubar.xml +++ b/sw/uiconfig/swform/menubar/menubar.xml @@ -327,6 +327,7 @@ <menu:menupopup> <menu:menuitem menu:id=".uno:RotateLeft"/> <menu:menuitem menu:id=".uno:RotateRight"/> + <menu:menuitem menu:id=".uno:Rotate180"/> </menu:menupopup> </menu:menu> <menu:menu menu:id=".uno:GroupMenu"> diff --git a/sw/uiconfig/swform/popupmenu/graphic.xml b/sw/uiconfig/swform/popupmenu/graphic.xml index 1286b7747f42..ae7bad963939 100644 --- a/sw/uiconfig/swform/popupmenu/graphic.xml +++ b/sw/uiconfig/swform/popupmenu/graphic.xml @@ -58,6 +58,7 @@ <menu:menupopup> <menu:menuitem menu:id=".uno:RotateLeft"/> <menu:menuitem menu:id=".uno:RotateRight"/> + <menu:menuitem menu:id=".uno:Rotate180"/> </menu:menupopup> </menu:menu> <menu:menuseparator/> diff --git a/sw/uiconfig/swform/toolbar/graphicobjectbar.xml b/sw/uiconfig/swform/toolbar/graphicobjectbar.xml index 1f27f3c6bbd9..a4529094136b 100644 --- a/sw/uiconfig/swform/toolbar/graphicobjectbar.xml +++ b/sw/uiconfig/swform/toolbar/graphicobjectbar.xml @@ -30,6 +30,7 @@ <toolbar:toolbaritem xlink:href=".uno:FlipHorizontal" toolbar:helpid="20425"/> <toolbar:toolbaritem xlink:href=".uno:RotateLeft" toolbar:helpid=""/> <toolbar:toolbaritem xlink:href=".uno:RotateRight" toolbar:helpid=""/> + <toolbar:toolbaritem xlink:href=".uno:Rotate180" toolbar:helpid=""/> <toolbar:toolbaritem xlink:href=".uno:Crop" toolbar:helpid=""/> <toolbar:toolbarseparator/> <toolbar:toolbaritem xlink:href=".uno:FrameDialog" toolbar:helpid="20458"/> diff --git a/sw/uiconfig/swreport/menubar/menubar.xml b/sw/uiconfig/swreport/menubar/menubar.xml index 4b71934b2284..68703f3fe506 100644 --- a/sw/uiconfig/swreport/menubar/menubar.xml +++ b/sw/uiconfig/swreport/menubar/menubar.xml @@ -329,6 +329,7 @@ <menu:menupopup> <menu:menuitem menu:id=".uno:RotateLeft"/> <menu:menuitem menu:id=".uno:RotateRight"/> + <menu:menuitem menu:id=".uno:Rotate180"/> </menu:menupopup> </menu:menu> <menu:menu menu:id=".uno:GroupMenu"> diff --git a/sw/uiconfig/swreport/popupmenu/graphic.xml b/sw/uiconfig/swreport/popupmenu/graphic.xml index 1286b7747f42..ae7bad963939 100644 --- a/sw/uiconfig/swreport/popupmenu/graphic.xml +++ b/sw/uiconfig/swreport/popupmenu/graphic.xml @@ -58,6 +58,7 @@ <menu:menupopup> <menu:menuitem menu:id=".uno:RotateLeft"/> <menu:menuitem menu:id=".uno:RotateRight"/> + <menu:menuitem menu:id=".uno:Rotate180"/> </menu:menupopup> </menu:menu> <menu:menuseparator/> diff --git a/sw/uiconfig/swreport/toolbar/graphicobjectbar.xml b/sw/uiconfig/swreport/toolbar/graphicobjectbar.xml index 1f27f3c6bbd9..a4529094136b 100644 --- a/sw/uiconfig/swreport/toolbar/graphicobjectbar.xml +++ b/sw/uiconfig/swreport/toolbar/graphicobjectbar.xml @@ -30,6 +30,7 @@ <toolbar:toolbaritem xlink:href=".uno:FlipHorizontal" toolbar:helpid="20425"/> <toolbar:toolbaritem xlink:href=".uno:RotateLeft" toolbar:helpid=""/> <toolbar:toolbaritem xlink:href=".uno:RotateRight" toolbar:helpid=""/> + <toolbar:toolbaritem xlink:href=".uno:Rotate180" toolbar:helpid=""/> <toolbar:toolbaritem xlink:href=".uno:Crop" toolbar:helpid=""/> <toolbar:toolbarseparator/> <toolbar:toolbaritem xlink:href=".uno:FrameDialog" toolbar:helpid="20458"/> diff --git a/sw/uiconfig/swriter/menubar/menubar.xml b/sw/uiconfig/swriter/menubar/menubar.xml index 2d39cd0fdd50..94169a1926e3 100644 --- a/sw/uiconfig/swriter/menubar/menubar.xml +++ b/sw/uiconfig/swriter/menubar/menubar.xml @@ -547,6 +547,7 @@ <menu:menupopup> <menu:menuitem menu:id=".uno:RotateLeft"/> <menu:menuitem menu:id=".uno:RotateRight"/> + <menu:menuitem menu:id=".uno:Rotate180"/> </menu:menupopup> </menu:menu> <menu:menu menu:id=".uno:GroupMenu"> diff --git a/sw/uiconfig/swriter/popupmenu/graphic.xml b/sw/uiconfig/swriter/popupmenu/graphic.xml index 1286b7747f42..ae7bad963939 100644 --- a/sw/uiconfig/swriter/popupmenu/graphic.xml +++ b/sw/uiconfig/swriter/popupmenu/graphic.xml @@ -58,6 +58,7 @@ <menu:menupopup> <menu:menuitem menu:id=".uno:RotateLeft"/> <menu:menuitem menu:id=".uno:RotateRight"/> + <menu:menuitem menu:id=".uno:Rotate180"/> </menu:menupopup> </menu:menu> <menu:menuseparator/> diff --git a/sw/uiconfig/swriter/toolbar/graphicobjectbar.xml b/sw/uiconfig/swriter/toolbar/graphicobjectbar.xml index 84b8be2d1768..564d52636eb2 100644 --- a/sw/uiconfig/swriter/toolbar/graphicobjectbar.xml +++ b/sw/uiconfig/swriter/toolbar/graphicobjectbar.xml @@ -28,6 +28,7 @@ <toolbar:toolbaritem xlink:href=".uno:FlipHorizontal" toolbar:helpid="20425"/> <toolbar:toolbaritem xlink:href=".uno:RotateLeft" toolbar:helpid=""/> <toolbar:toolbaritem xlink:href=".uno:RotateRight" toolbar:helpid=""/> + <toolbar:toolbaritem xlink:href=".uno:Rotate180" toolbar:helpid=""/> <toolbar:toolbarseparator/> <toolbar:toolbaritem xlink:href=".uno:GrafTransparence" toolbar:helpid="10869"/> <toolbar:toolbarseparator/> diff --git a/sw/uiconfig/swriter/ui/notebookbar.ui b/sw/uiconfig/swriter/ui/notebookbar.ui index faeff25335ce..fa77d74cac91 100644 --- a/sw/uiconfig/swriter/ui/notebookbar.ui +++ b/sw/uiconfig/swriter/ui/notebookbar.ui @@ -5358,6 +5358,32 @@ <property name="position">1</property> </packing> </child> + <child> + <object class="sfxlo-NotebookbarToolBox" id="rotate2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="show_arrow">False</property> + <child> + <object class="GtkToolButton" id="Rotate180"> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="is_important">True</property> + <property name="action_name">.uno:Rotate180</property> + <property name="use_underline">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="homogeneous">True</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> </object> <packing> <property name="expand">False</property> diff --git a/sw/uiconfig/swxform/menubar/menubar.xml b/sw/uiconfig/swxform/menubar/menubar.xml index 31bdeb7cad64..cbd028f8d9db 100644 --- a/sw/uiconfig/swxform/menubar/menubar.xml +++ b/sw/uiconfig/swxform/menubar/menubar.xml @@ -329,6 +329,7 @@ <menu:menupopup> <menu:menuitem menu:id=".uno:RotateLeft"/> <menu:menuitem menu:id=".uno:RotateRight"/> + <menu:menuitem menu:id=".uno:Rotate180"/> </menu:menupopup> </menu:menu> <menu:menu menu:id=".uno:GroupMenu"> diff --git a/sw/uiconfig/swxform/popupmenu/graphic.xml b/sw/uiconfig/swxform/popupmenu/graphic.xml index 1286b7747f42..ae7bad963939 100644 --- a/sw/uiconfig/swxform/popupmenu/graphic.xml +++ b/sw/uiconfig/swxform/popupmenu/graphic.xml @@ -58,6 +58,7 @@ <menu:menupopup> <menu:menuitem menu:id=".uno:RotateLeft"/> <menu:menuitem menu:id=".uno:RotateRight"/> + <menu:menuitem menu:id=".uno:Rotate180"/> </menu:menupopup> </menu:menu> <menu:menuseparator/> diff --git a/sw/uiconfig/swxform/toolbar/graphicobjectbar.xml b/sw/uiconfig/swxform/toolbar/graphicobjectbar.xml index 1f27f3c6bbd9..a4529094136b 100644 --- a/sw/uiconfig/swxform/toolbar/graphicobjectbar.xml +++ b/sw/uiconfig/swxform/toolbar/graphicobjectbar.xml @@ -30,6 +30,7 @@ <toolbar:toolbaritem xlink:href=".uno:FlipHorizontal" toolbar:helpid="20425"/> <toolbar:toolbaritem xlink:href=".uno:RotateLeft" toolbar:helpid=""/> <toolbar:toolbaritem xlink:href=".uno:RotateRight" toolbar:helpid=""/> + <toolbar:toolbaritem xlink:href=".uno:Rotate180" toolbar:helpid=""/> <toolbar:toolbaritem xlink:href=".uno:Crop" toolbar:helpid=""/> <toolbar:toolbarseparator/> <toolbar:toolbaritem xlink:href=".uno:FrameDialog" toolbar:helpid="20458"/> |