[Libreoffice-commits] core.git: officecfg/registry sw/inc sw/sdi sw/source sw/uiconfig

Philippe Jung phil.jung at free.fr
Tue May 5 03:04:50 PDT 2015


 officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu |   16 +
 sw/inc/fesh.hxx                                                     |    6 
 sw/sdi/_grfsh.sdi                                                   |   12 -
 sw/source/core/draw/dflyobj.cxx                                     |  104 ++++++++++
 sw/source/core/frmedt/feshview.cxx                                  |   52 +++++
 sw/source/core/inc/dflyobj.hxx                                      |    3 
 sw/source/ui/app/mn.src                                             |    3 
 sw/source/uibase/docvw/edtwin.cxx                                   |    8 
 sw/source/uibase/shells/grfsh.cxx                                   |   17 +
 sw/uiconfig/sglobal/menubar/menubar.xml                             |   12 +
 sw/uiconfig/sglobal/toolbar/graphicobjectbar.xml                    |    1 
 sw/uiconfig/sweb/menubar/menubar.xml                                |   12 +
 sw/uiconfig/swform/menubar/menubar.xml                              |   12 +
 sw/uiconfig/swform/toolbar/graphicobjectbar.xml                     |    1 
 sw/uiconfig/swreport/menubar/menubar.xml                            |   12 +
 sw/uiconfig/swreport/toolbar/graphicobjectbar.xml                   |    1 
 sw/uiconfig/swriter/menubar/menubar.xml                             |   12 +
 sw/uiconfig/swriter/toolbar/graphicobjectbar.xml                    |    1 
 sw/uiconfig/swxform/menubar/menubar.xml                             |   12 +
 sw/uiconfig/swxform/toolbar/graphicobjectbar.xml                    |    1 
 20 files changed, 292 insertions(+), 6 deletions(-)

New commits:
commit 8c4a1663f5d93380268365d35a5581d8065df897
Author: Philippe Jung <phil.jung at free.fr>
Date:   Sat May 2 00:55:37 2015 +0200

    tdf#34555 add crop features to sw
    
    Adds Crop (by handles) to writer. Proposal of new Format menu and image
    context menu organisation.
    
    This is part of a serie of 4 patches that adds Save graphic, Change Picture,
    Edit with external tool, Crop (by handles) in all products (scalc,
    sdraw, simpress, swriter).
    Main menus, toolbars and contextual menus are updated accordingly.
    
    Change-Id: I6fe8907e08519326c78f0bc71f27032b5716bb8e
    Reviewed-on: https://gerrit.libreoffice.org/15590
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
index a712068..40ddf82 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
@@ -765,6 +765,22 @@
           <value>1</value>
         </prop>
       </node>
+      <node oor:name=".uno:ChangePicture" oor:op="replace">
+        <prop oor:name="Label" oor:type="xs:string">
+          <value xml:lang="en-US">~Change Image...</value>
+        </prop>
+        <prop oor:name="Properties" oor:type="xs:int">
+            <value>1</value>
+        </prop>
+      </node>
+      <node oor:name=".uno:CompressGraphic" oor:op="replace">
+        <prop oor:name="Label" oor:type="xs:string">
+          <value xml:lang="en-US">Co~mpress Image...</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/sw/inc/fesh.hxx b/sw/inc/fesh.hxx
index 69a2b65..289fb92 100644
--- a/sw/inc/fesh.hxx
+++ b/sw/inc/fesh.hxx
@@ -473,6 +473,12 @@ public:
     /// Set DragMode (e.g. Rotate), but do nothing when frame is selected.
     void SetDragMode( sal_uInt16 eSdrDragMode );
 
+    // Get the current drag mode
+    SdrDragMode GetDragMode() const;
+
+    // Start cropping the selected image
+    void StartCropImage();
+
     size_t IsObjSelected() const;   ///< @return object count, but doesn't count the objects in groups.
     bool IsObjSelected( const SdrObject& rObj ) const;
     bool IsObjSameLevelWithMarked(const SdrObject* pObj) const;
diff --git a/sw/sdi/_grfsh.sdi b/sw/sdi/_grfsh.sdi
index 2eb2ab2..bb50bc9 100644
--- a/sw/sdi/_grfsh.sdi
+++ b/sw/sdi/_grfsh.sdi
@@ -90,6 +90,13 @@ interface BaseTextGraphic
         DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
     ]
 
+    SID_OBJECT_CROP
+    [
+        ExecMethod = Execute ;
+        StateMethod = GetAttrState ;
+        DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
+    ]
+
     SID_INSERT_GRAPHIC // zeigt auf FN_FORMAT_GRAFIC_DLG
     [
         ExecMethod = Execute ;
@@ -231,11 +238,6 @@ interface BaseTextGraphic
         StateMethod = GetAttrState ;
         DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
     ]
-    SID_CHANGE_PICTURE
-    [
-        ExecMethod = FuTemporary ;
-        StateMethod = GetMenuState ;
-    ]
     SID_GRFFILTER_SOLARIZE  // status(final|play|rec)
     [
         ExecMethod = ExecAttr ;
diff --git a/sw/source/core/draw/dflyobj.cxx b/sw/source/core/draw/dflyobj.cxx
index ec6a2f3..6ba8e51 100644
--- a/sw/source/core/draw/dflyobj.cxx
+++ b/sw/source/core/draw/dflyobj.cxx
@@ -19,10 +19,12 @@
 
 #include "hintids.hxx"
 #include <comphelper/lok.hxx>
+#include <tools/mapunit.hxx>
 #include <svx/svdtrans.hxx>
 #include <editeng/protitem.hxx>
 #include <editeng/opaqitem.hxx>
 #include <svx/svdpage.hxx>
+#include <vcl/svapp.hxx>
 
 #include <fmtclds.hxx>
 #include <fmtornt.hxx>
@@ -45,6 +47,7 @@
 #include "grfatr.hxx"
 #include "pagefrm.hxx"
 #include "rootfrm.hxx"
+#include "wrtsh.hxx"
 
 #include <svx/sdr/properties/defaultproperties.hxx>
 #include <basegfx/range/b2drange.hxx>
@@ -729,6 +732,83 @@ void SwVirtFlyDrawObj::NbcMove(const Size& rSiz)
         pFmt->SetFmtAttr( aSet );
 }
 
+
+void SwVirtFlyDrawObj::NbcCrop(const Point& rRef, const Fraction& xFact, const Fraction& yFact)
+{
+    // Get Wrt Shell
+    SwWrtShell *pSh = dynamic_cast<SwWrtShell*>( GetFlyFrm()->getRootFrm()->GetCurrShell() );
+    if (!pSh || !pSh->ISA(SwWrtShell))
+        return;
+
+    // Compute old and new rect. This will give us the deformation to apply to
+    // the object to crop
+    Rectangle aOldRect( aOutRect );
+
+    Rectangle aNewRect( aOutRect );
+    ResizeRect( aNewRect, rRef, xFact, yFact );
+
+    // Get graphic object size in 100th of mm
+    GraphicObject *pGraphicObject = (GraphicObject *) pSh->GetGraphicObj();
+    if (!pGraphicObject)
+        return;
+    const MapMode aMapMode100thmm(MAP_100TH_MM);
+    Size aGraphicSize(pGraphicObject->GetPrefSize());
+    if( MAP_PIXEL == pGraphicObject->GetPrefMapMode().GetMapUnit() )
+        aGraphicSize = Application::GetDefaultDevice()->PixelToLogic( aGraphicSize, aMapMode100thmm );
+    else
+        aGraphicSize = Application::GetDefaultDevice()->LogicToLogic( aGraphicSize, pGraphicObject->GetPrefMapMode(), aMapMode100thmm);
+    if( aGraphicSize.A() == 0 || aGraphicSize.B() == 0 )
+        return ;
+
+    // Get old values for crop in 10th of mm
+    SfxItemSet aSet( pSh->GetAttrPool(), RES_GRFATR_CROPGRF, RES_GRFATR_CROPGRF );
+    pSh->GetCurAttr( aSet );
+    SwCropGrf aCrop( (const SwCropGrf&) aSet.Get(RES_GRFATR_CROPGRF) );
+
+    Rectangle aCropRectangle(
+        convertTwipToMm100(aCrop.GetLeft()),
+        convertTwipToMm100(aCrop.GetTop()),
+        convertTwipToMm100(aCrop.GetRight()),
+        convertTwipToMm100(aCrop.GetBottom()) );
+
+    // Compute delta to apply
+    double fScaleX = ( aGraphicSize.Width() - aCropRectangle.Left() - aCropRectangle.Right() ) / (double)aOldRect.GetWidth();
+    double fScaleY = ( aGraphicSize.Height() - aCropRectangle.Top() - aCropRectangle.Bottom() ) / (double)aOldRect.GetHeight();
+
+    sal_Int32 nDiffLeft = aNewRect.Left() - aOldRect.Left();
+    sal_Int32 nDiffTop = aNewRect.Top() - aOldRect.Top();
+    sal_Int32 nDiffRight = aNewRect.Right() - aOldRect.Right();
+    sal_Int32 nDiffBottom = aNewRect.Bottom() - aOldRect.Bottom();
+
+    // Compute new values in 10th of mm
+    sal_Int32 nLeftCrop = static_cast<sal_Int32>( aCropRectangle.Left() + nDiffLeft * fScaleX );
+    sal_Int32 nTopCrop = static_cast<sal_Int32>( aCropRectangle.Top() + nDiffTop * fScaleY );
+    sal_Int32 nRightCrop = static_cast<sal_Int32>( aCropRectangle.Right() - nDiffRight * fScaleX );
+    sal_Int32 nBottomCrop = static_cast<sal_Int32>( aCropRectangle.Bottom() - nDiffBottom * fScaleY );
+
+    // Apply values
+    pSh->StartAllAction();
+//    pSh->StartUndo(UNDO_START);
+
+    // Set new crop values in twips
+    aCrop.SetLeft  (convertMm100ToTwip(nLeftCrop));
+    aCrop.SetTop   (convertMm100ToTwip(nTopCrop));
+    aCrop.SetRight (convertMm100ToTwip(nRightCrop));
+    aCrop.SetBottom(convertMm100ToTwip(nBottomCrop));
+    pSh->SetAttrItem(aCrop);
+
+    // Set new frame size
+    SwFrmFmt *pFmt = GetFmt();
+    SwFmtFrmSize aSz( pFmt->GetFrmSize() );
+    aSz.SetWidth(aNewRect.GetWidth());
+    aSz.SetHeight(aNewRect.GetHeight());
+    pFmt->GetDoc()->SetAttr( aSz, *pFmt );
+
+//    pSh->EndUndo(UNDO_END);
+    pSh->EndAllAction();
+
+}
+
 void SwVirtFlyDrawObj::NbcResize(const Point& rRef,
             const Fraction& xFact, const Fraction& yFact)
 {
@@ -847,6 +927,30 @@ void SwVirtFlyDrawObj::Resize(const Point& rRef,
     GetFmt()->GetDoc()->GetIDocumentUndoRedo().DoDrawUndo(false);
 }
 
+void SwVirtFlyDrawObj::Crop(const Point& rRef, const Fraction& xFact, const Fraction& yFact)
+{
+    NbcCrop( rRef, xFact, yFact );
+    SetChanged();
+    GetFmt()->GetDoc()->GetIDocumentUndoRedo().DoDrawUndo(false);
+}
+
+void SwVirtFlyDrawObj::addCropHandles(SdrHdlList& rTarget) const
+{
+    Rectangle aRect(GetSnapRect());
+
+    if(!aRect.IsEmpty())
+    {
+       rTarget.AddHdl(new SdrCropHdl(aRect.TopLeft()     , HDL_UPLFT, 0, 0));
+       rTarget.AddHdl(new SdrCropHdl(aRect.TopCenter()   , HDL_UPPER, 0, 0));
+       rTarget.AddHdl(new SdrCropHdl(aRect.TopRight()    , HDL_UPRGT, 0, 0));
+       rTarget.AddHdl(new SdrCropHdl(aRect.LeftCenter()  , HDL_LEFT , 0, 0));
+       rTarget.AddHdl(new SdrCropHdl(aRect.RightCenter() , HDL_RIGHT, 0, 0));
+       rTarget.AddHdl(new SdrCropHdl(aRect.BottomLeft()  , HDL_LWLFT, 0, 0));
+       rTarget.AddHdl(new SdrCropHdl(aRect.BottomCenter(), HDL_LOWER, 0, 0));
+       rTarget.AddHdl(new SdrCropHdl(aRect.BottomRight() , HDL_LWRGT, 0, 0));
+    }
+}
+
 // Macro
 
 Pointer  SwVirtFlyDrawObj::GetMacroPointer(
diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx
index 0e5b31d..0045a67 100644
--- a/sw/source/core/frmedt/feshview.cxx
+++ b/sw/source/core/frmedt/feshview.cxx
@@ -179,6 +179,11 @@ bool SwFEShell::SelectObj( const Point& rPt, sal_uInt8 nFlag, SdrObject *pObj )
                 {
                     GetWin()->Invalidate( pOldSelFly->Frm().SVRect() );
                 }
+
+                // Cancel crop mode
+                if ( SDRDRAG_CROP == GetDragMode() )
+                    SetDragMode( SDRDRAG_MOVE );
+
                 bUnmark = true;
             }
         }
@@ -602,6 +607,52 @@ void SwFEShell::SetDragMode( sal_uInt16 eDragMode )
         Imp()->GetDrawView()->SetDragMode( (SdrDragMode)eDragMode );
 }
 
+SdrDragMode SwFEShell::GetDragMode() const
+{
+    SdrDragMode nRet = (SdrDragMode)0;
+    if ( Imp()->HasDrawView() )
+    {
+        nRet = Imp()->GetDrawView()->GetDragMode();
+    }
+    return nRet;
+}
+
+void SwFEShell::StartCropImage()
+{
+    if ( !Imp()->HasDrawView() )
+    {
+        return;
+    }
+    SdrView *pView = Imp()->GetDrawView();
+    if (!pView) return;
+
+    const SdrMarkList &rMarkList = pView->GetMarkedObjectList();
+    if( 0 == rMarkList.GetMarkCount() ) {
+        // No object selected
+        return;
+    }
+
+    // If more than a single SwVirtFlyDrawObj is selected, select only the first SwVirtFlyDrawObj
+    if ( rMarkList.GetMarkCount() > 1 )
+    {
+        for ( sal_uInt16 i = 0; i < rMarkList.GetMarkCount(); ++i )
+        {
+            SdrObject *pTmpObj = rMarkList.GetMark( i )->GetMarkedSdrObj();
+            sal_Bool bForget = pTmpObj->ISA(SwVirtFlyDrawObj);
+            if( bForget )
+            {
+                pView->UnmarkAll();
+                pView->MarkObj( pTmpObj, Imp()->GetPageView(), sal_False, sal_False );
+                break;
+            }
+        }
+    }
+
+    // Activate CROP mode
+    pView->SetEditMode( SDREDITMODE_EDIT );
+    SetDragMode( SDRDRAG_CROP );
+}
+
 long SwFEShell::BeginDrag( const Point* pPt, bool bIsShift)
 {
     SdrView *pView = Imp()->GetDrawView();
@@ -669,6 +720,7 @@ long SwFEShell::EndDrag( const Point *, bool )
 
         GetDoc()->getIDocumentState().SetModified();
         ::FrameNotify( this, FLY_DRAG );
+
         return 1;
     }
     return 0;
diff --git a/sw/source/core/inc/dflyobj.hxx b/sw/source/core/inc/dflyobj.hxx
index 4afba0e..173edfa 100644
--- a/sw/source/core/inc/dflyobj.hxx
+++ b/sw/source/core/inc/dflyobj.hxx
@@ -101,9 +101,12 @@ public:
     virtual       void       NbcMove  (const Size& rSiz) SAL_OVERRIDE;
     virtual       void       NbcResize(const Point& rRef, const Fraction& xFact,
                                        const Fraction& yFact) SAL_OVERRIDE;
+    virtual       void       NbcCrop(const Point& rRef, const Fraction& xFact, const Fraction& yFact) SAL_OVERRIDE;
     virtual       void       Move  (const Size& rSiz) SAL_OVERRIDE;
     virtual       void       Resize(const Point& rRef, const Fraction& xFact,
                                     const Fraction& yFact, bool bUnsetRelative = true) SAL_OVERRIDE;
+    virtual       void       Crop(const Point& rRef, const Fraction& xFact, const Fraction& yFact) SAL_OVERRIDE;
+    virtual       void       addCropHandles(SdrHdlList& rTarget) const;
 
     const SwFrmFmt *GetFmt() const;
           SwFrmFmt *GetFmt();
diff --git a/sw/source/ui/app/mn.src b/sw/source/ui/app/mn.src
index 7297344..bbf9072 100644
--- a/sw/source/ui/app/mn.src
+++ b/sw/source/ui/app/mn.src
@@ -1157,6 +1157,9 @@ Menu MN_GRF_POPUPMENU
         MenuItem { ITEM_SAVE_GRAPHIC };
         SEPARATOR ;
 
+        MenuItem { ITEM_OBJECT_CROP };
+        SEPARATOR ;
+
         MN_ANCHOR
         MN_MOUSE_FRAME_WITH_CONTOUR
         MN_ALIGNMENT_FRAME
diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx
index 13d140e..700f948 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -3999,6 +3999,9 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt)
 
                     if (pSdrView)
                     {
+                        if (pSdrView->GetDragMode() == SDRDRAG_CROP)
+                            bisResize = false;
+
                         if (rMEvt.IsShift())
                         {
                             pSdrView->SetAngleSnapEnabled(!bIsSelectionGfx);
@@ -4208,7 +4211,10 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
     SdrView *pSdrView = rSh.GetDrawView();
     if ( pSdrView )
     {
-        pSdrView->SetOrtho(false);
+        // tdf34555: ortho was always reset before being used in EndSdrDrag
+        // Now, it is reset only if not in Crop mode.
+        if (pSdrView->GetDragMode() != SDRDRAG_CROP)
+            pSdrView->SetOrtho(false);
 
         if ( pSdrView->MouseButtonUp( rMEvt,this ) )
         {
diff --git a/sw/source/uibase/shells/grfsh.cxx b/sw/source/uibase/shells/grfsh.cxx
index 7823ca1..170f966 100644
--- a/sw/source/uibase/shells/grfsh.cxx
+++ b/sw/source/uibase/shells/grfsh.cxx
@@ -475,6 +475,15 @@ void SwGrfShell::Execute(SfxRequest &rReq)
         }
         break;
 
+        case SID_OBJECT_CROP:
+        {
+            GraphicObject *pGraphicObject = (GraphicObject *) rSh.GetGraphicObj();
+            if (0 != pGraphicObject  && SDRDRAG_CROP != rSh.GetDragMode()) {
+                rSh.StartCropImage();
+            }
+        }
+        break;
+
         default:
             OSL_ENSURE(false, "wrong dispatcher");
             return;
@@ -803,6 +812,14 @@ void SwGrfShell::GetAttrState(SfxItemSet &rSet)
             }
             break;
 
+        case SID_OBJECT_CROP:
+            {
+                bDisable = 0 != rSh.IsSelObjProtected( FLYPROTECT_CONTENT|FLYPROTECT_PARENT );
+                if( rSh.GetGraphicType() == GRAPHIC_NONE )
+                    bDisable = true;
+            }
+            break;
+
         default:
             bDisable = false;
         }
diff --git a/sw/uiconfig/sglobal/menubar/menubar.xml b/sw/uiconfig/sglobal/menubar/menubar.xml
index d92a255..4a27b28 100644
--- a/sw/uiconfig/sglobal/menubar/menubar.xml
+++ b/sw/uiconfig/sglobal/menubar/menubar.xml
@@ -279,6 +279,18 @@
         </menu:menupopup>
       </menu:menu>
       <menu:menuseparator/>
+      <menu:menu menu:id=".uno:FormatImageMenu">
+        <menu:menupopup>
+          <menu:menuitem menu:id=".uno:Crop"/>
+          <menu:menuseparator/>
+          <menu:menuitem menu:id=".uno:ExternalEdit"/>
+          <menu:menuitem menu:id=".uno:ChangePicture"/>
+          <menu:menuitem menu:id=".uno:CompressGraphic"/>
+          <menu:menuseparator/>
+          <menu:menuitem menu:id=".uno:SaveGraphic"/>
+        </menu:menupopup>
+      </menu:menu>
+      <menu:menuseparator/>
       <menu:menu menu:id=".uno:AnchorMenu">
         <menu:menupopup>
           <menu:menuitem menu:id=".uno:SetAnchorToPage" menu:style="radio"/>
diff --git a/sw/uiconfig/sglobal/toolbar/graphicobjectbar.xml b/sw/uiconfig/sglobal/toolbar/graphicobjectbar.xml
index 6e7201c..1f27f3c 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:Crop" toolbar:helpid=""/>
  <toolbar:toolbarseparator/>
  <toolbar:toolbaritem xlink:href=".uno:FrameDialog" toolbar:helpid="20458"/>
 </toolbar:toolbar>
diff --git a/sw/uiconfig/sweb/menubar/menubar.xml b/sw/uiconfig/sweb/menubar/menubar.xml
index f6836bb..922b0cf 100644
--- a/sw/uiconfig/sweb/menubar/menubar.xml
+++ b/sw/uiconfig/sweb/menubar/menubar.xml
@@ -222,6 +222,18 @@
         </menu:menupopup>
       </menu:menu>
       <menu:menuseparator/>
+      <menu:menu menu:id=".uno:FormatImageMenu">
+        <menu:menupopup>
+          <menu:menuitem menu:id=".uno:Crop"/>
+          <menu:menuseparator/>
+          <menu:menuitem menu:id=".uno:ExternalEdit"/>
+          <menu:menuitem menu:id=".uno:ChangePicture"/>
+          <menu:menuitem menu:id=".uno:CompressGraphic"/>
+          <menu:menuseparator/>
+          <menu:menuitem menu:id=".uno:SaveGraphic"/>
+        </menu:menupopup>
+      </menu:menu>
+      <menu:menuseparator/>
       <menu:menu menu:id=".uno:AnchorMenu">
         <menu:menupopup>
           <menu:menuitem menu:id=".uno:SetAnchorToPage" menu:style="radio"/>
diff --git a/sw/uiconfig/swform/menubar/menubar.xml b/sw/uiconfig/swform/menubar/menubar.xml
index 6f081ac..4795e44 100644
--- a/sw/uiconfig/swform/menubar/menubar.xml
+++ b/sw/uiconfig/swform/menubar/menubar.xml
@@ -278,6 +278,18 @@
         </menu:menupopup>
       </menu:menu>
       <menu:menuseparator/>
+      <menu:menu menu:id=".uno:FormatImageMenu">
+        <menu:menupopup>
+          <menu:menuitem menu:id=".uno:Crop"/>
+          <menu:menuseparator/>
+          <menu:menuitem menu:id=".uno:ExternalEdit"/>
+          <menu:menuitem menu:id=".uno:ChangePicture"/>
+          <menu:menuitem menu:id=".uno:CompressGraphic"/>
+          <menu:menuseparator/>
+          <menu:menuitem menu:id=".uno:SaveGraphic"/>
+        </menu:menupopup>
+      </menu:menu>
+      <menu:menuseparator/>
       <menu:menu menu:id=".uno:AnchorMenu">
         <menu:menupopup>
           <menu:menuitem menu:id=".uno:SetAnchorToPage" menu:style="radio"/>
diff --git a/sw/uiconfig/swform/toolbar/graphicobjectbar.xml b/sw/uiconfig/swform/toolbar/graphicobjectbar.xml
index 6e7201c..1f27f3c 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:Crop" toolbar:helpid=""/>
  <toolbar:toolbarseparator/>
  <toolbar:toolbaritem xlink:href=".uno:FrameDialog" toolbar:helpid="20458"/>
 </toolbar:toolbar>
diff --git a/sw/uiconfig/swreport/menubar/menubar.xml b/sw/uiconfig/swreport/menubar/menubar.xml
index 4d9ba26..f9d3fec 100644
--- a/sw/uiconfig/swreport/menubar/menubar.xml
+++ b/sw/uiconfig/swreport/menubar/menubar.xml
@@ -280,6 +280,18 @@
         </menu:menupopup>
       </menu:menu>
       <menu:menuseparator/>
+      <menu:menu menu:id=".uno:FormatImageMenu">
+        <menu:menupopup>
+          <menu:menuitem menu:id=".uno:Crop"/>
+          <menu:menuseparator/>
+          <menu:menuitem menu:id=".uno:ExternalEdit"/>
+          <menu:menuitem menu:id=".uno:ChangePicture"/>
+          <menu:menuitem menu:id=".uno:CompressGraphic"/>
+          <menu:menuseparator/>
+          <menu:menuitem menu:id=".uno:SaveGraphic"/>
+        </menu:menupopup>
+      </menu:menu>
+      <menu:menuseparator/>
       <menu:menu menu:id=".uno:AnchorMenu">
         <menu:menupopup>
           <menu:menuitem menu:id=".uno:SetAnchorToPage" menu:style="radio"/>
diff --git a/sw/uiconfig/swreport/toolbar/graphicobjectbar.xml b/sw/uiconfig/swreport/toolbar/graphicobjectbar.xml
index 6e7201c..1f27f3c 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:Crop" toolbar:helpid=""/>
  <toolbar:toolbarseparator/>
  <toolbar:toolbaritem xlink:href=".uno:FrameDialog" toolbar:helpid="20458"/>
 </toolbar:toolbar>
diff --git a/sw/uiconfig/swriter/menubar/menubar.xml b/sw/uiconfig/swriter/menubar/menubar.xml
index edcf10e..dc79449 100644
--- a/sw/uiconfig/swriter/menubar/menubar.xml
+++ b/sw/uiconfig/swriter/menubar/menubar.xml
@@ -296,6 +296,18 @@
         </menu:menupopup>
       </menu:menu>
       <menu:menuseparator/>
+      <menu:menu menu:id=".uno:FormatImageMenu">
+        <menu:menupopup>
+          <menu:menuitem menu:id=".uno:Crop"/>
+          <menu:menuseparator/>
+          <menu:menuitem menu:id=".uno:ExternalEdit"/>
+          <menu:menuitem menu:id=".uno:ChangePicture"/>
+          <menu:menuitem menu:id=".uno:CompressGraphic"/>
+          <menu:menuseparator/>
+          <menu:menuitem menu:id=".uno:SaveGraphic"/>
+        </menu:menupopup>
+      </menu:menu>
+      <menu:menuseparator/>
       <menu:menu menu:id=".uno:AnchorMenu">
         <menu:menupopup>
           <menu:menuitem menu:id=".uno:SetAnchorToPage" menu:style="radio"/>
diff --git a/sw/uiconfig/swriter/toolbar/graphicobjectbar.xml b/sw/uiconfig/swriter/toolbar/graphicobjectbar.xml
index daccb14..a41a1df 100644
--- a/sw/uiconfig/swriter/toolbar/graphicobjectbar.xml
+++ b/sw/uiconfig/swriter/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:Crop" toolbar:helpid=""/>
  <toolbar:toolbarseparator/>
  <toolbar:toolbaritem xlink:href=".uno:GraphicDialog" toolbar:visible="false"/>
 </toolbar:toolbar>
diff --git a/sw/uiconfig/swxform/menubar/menubar.xml b/sw/uiconfig/swxform/menubar/menubar.xml
index 854d89c..c6cf58f 100644
--- a/sw/uiconfig/swxform/menubar/menubar.xml
+++ b/sw/uiconfig/swxform/menubar/menubar.xml
@@ -280,6 +280,18 @@
         </menu:menupopup>
       </menu:menu>
       <menu:menuseparator/>
+      <menu:menu menu:id=".uno:FormatImageMenu">
+        <menu:menupopup>
+          <menu:menuitem menu:id=".uno:Crop"/>
+          <menu:menuseparator/>
+          <menu:menuitem menu:id=".uno:ExternalEdit"/>
+          <menu:menuitem menu:id=".uno:ChangePicture"/>
+          <menu:menuitem menu:id=".uno:CompressGraphic"/>
+          <menu:menuseparator/>
+          <menu:menuitem menu:id=".uno:SaveGraphic"/>
+        </menu:menupopup>
+      </menu:menu>
+      <menu:menuseparator/>
       <menu:menu menu:id=".uno:AnchorMenu">
         <menu:menupopup>
           <menu:menuitem menu:id=".uno:SetAnchorToPage" menu:style="radio"/>
diff --git a/sw/uiconfig/swxform/toolbar/graphicobjectbar.xml b/sw/uiconfig/swxform/toolbar/graphicobjectbar.xml
index 6e7201c..1f27f3c 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:Crop" toolbar:helpid=""/>
  <toolbar:toolbarseparator/>
  <toolbar:toolbaritem xlink:href=".uno:FrameDialog" toolbar:helpid="20458"/>
 </toolbar:toolbar>


More information about the Libreoffice-commits mailing list