include/svx/svxids.hrc                                              |    2 
 officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu |    8 ++
 svx/sdi/svx.sdi                                                     |   15 
+++++
 sw/sdi/_grfsh.sdi                                                   |    7 ++
 sw/source/uibase/shells/grfsh.cxx                                   |   29 
++++++++--
 sw/uiconfig/sglobal/menubar/menubar.xml                             |    1 
 sw/uiconfig/sglobal/popupmenu/graphic.xml                           |    1 
 sw/uiconfig/sglobal/toolbar/graphicobjectbar.xml                    |    1 
 sw/uiconfig/sweb/menubar/menubar.xml                                |    1 
 sw/uiconfig/sweb/popupmenu/graphic.xml                              |    1 
 sw/uiconfig/swform/menubar/menubar.xml                              |    1 
 sw/uiconfig/swform/popupmenu/graphic.xml                            |    1 
 sw/uiconfig/swform/toolbar/graphicobjectbar.xml                     |    1 
 sw/uiconfig/swreport/menubar/menubar.xml                            |    1 
 sw/uiconfig/swreport/popupmenu/graphic.xml                          |    1 
 sw/uiconfig/swreport/toolbar/graphicobjectbar.xml                   |    1 
 sw/uiconfig/swriter/menubar/menubar.xml                             |    1 
 sw/uiconfig/swriter/popupmenu/graphic.xml                           |    1 
 sw/uiconfig/swriter/toolbar/graphicobjectbar.xml                    |    1 
 sw/uiconfig/swriter/ui/notebookbar.ui                               |   26 
++++++++
 sw/uiconfig/swxform/menubar/menubar.xml                             |    1 
 sw/uiconfig/swxform/popupmenu/graphic.xml                           |    1 
 sw/uiconfig/swxform/toolbar/graphicobjectbar.xml                    |    1 
 23 files changed, 101 insertions(+), 3 deletions(-)

New commits:
commit 5f116966de4c0d007c2a420b7adc74d72e728b89
Author: giacco <filippo.giac...@gmail.com>
Date:   Thu Oct 20 10:03:44 2016 +0200

    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 <ke...@collabora.com>
    Reviewed-by: Heiko Tietze <tietze.he...@googlemail.com>
    Reviewed-by: jan iversen <j...@documentfoundation.org>
    Tested-by: jan iversen <j...@documentfoundation.org>

diff --git a/include/svx/svxids.hrc b/include/svx/svxids.hrc
index 6f6aaa5..ead4ae0 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 177ab9b..703b048 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 99a8bc0..2029d78 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 bf8270c..be017d1 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 73064df..953fd25 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 e6dbe3d..adda991 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 1286b77..ae7bad9 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 1f27f3c..a452909 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 c3638db..b8c06c6 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 1286b77..ae7bad9 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 cefc7be..80ef99e 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 1286b77..ae7bad9 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 1f27f3c..a452909 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 4b71934..68703f3 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 1286b77..ae7bad9 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 1f27f3c..a452909 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 2d39cd0..94169a1 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 1286b77..ae7bad9 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 84b8be2..564d526 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 faeff25..fa77d74 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 31bdeb7..cbd028f 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 1286b77..ae7bad9 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 1f27f3c..a452909 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"/>
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to