summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilippe Jung <phil.jung@free.fr>2015-05-02 00:55:37 +0200
committerJan Holesovsky <kendy@collabora.com>2015-05-05 10:04:26 +0000
commit8c4a1663f5d93380268365d35a5581d8065df897 (patch)
treec3fa083b810cb8b42c6b1b4b3f37d76f65a4b056
parentb1df1ac809fd6de972a6ed4f638a1ac8d29ba40d (diff)
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@libreoffice.org> Reviewed-by: Jan Holesovsky <kendy@collabora.com>
-rw-r--r--officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu16
-rw-r--r--sw/inc/fesh.hxx6
-rw-r--r--sw/sdi/_grfsh.sdi12
-rw-r--r--sw/source/core/draw/dflyobj.cxx104
-rw-r--r--sw/source/core/frmedt/feshview.cxx52
-rw-r--r--sw/source/core/inc/dflyobj.hxx3
-rw-r--r--sw/source/ui/app/mn.src3
-rw-r--r--sw/source/uibase/docvw/edtwin.cxx8
-rw-r--r--sw/source/uibase/shells/grfsh.cxx17
-rw-r--r--sw/uiconfig/sglobal/menubar/menubar.xml12
-rw-r--r--sw/uiconfig/sglobal/toolbar/graphicobjectbar.xml1
-rw-r--r--sw/uiconfig/sweb/menubar/menubar.xml12
-rw-r--r--sw/uiconfig/swform/menubar/menubar.xml12
-rw-r--r--sw/uiconfig/swform/toolbar/graphicobjectbar.xml1
-rw-r--r--sw/uiconfig/swreport/menubar/menubar.xml12
-rw-r--r--sw/uiconfig/swreport/toolbar/graphicobjectbar.xml1
-rw-r--r--sw/uiconfig/swriter/menubar/menubar.xml12
-rw-r--r--sw/uiconfig/swriter/toolbar/graphicobjectbar.xml1
-rw-r--r--sw/uiconfig/swxform/menubar/menubar.xml12
-rw-r--r--sw/uiconfig/swxform/toolbar/graphicobjectbar.xml1
20 files changed, 292 insertions, 6 deletions
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
index a71206897d4f..40ddf828cf97 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 69a2b6529094..289fb92f04a7 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 2eb2ab292437..bb50bc9504cd 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 ec6a2f3c7855..6ba8e5158b38 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 0e5b31d4e97f..0045a671e822 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 4afba0e1b51a..173edfad3f22 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 7297344f120b..bbf90727c00b 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 13d140e84e40..700f9489b58b 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 7823ca126637..170f96624114 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 d92a255965fb..4a27b2814053 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 6e7201c82042..1f27f3c6bbd9 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 f6836bb4f99e..922b0cf5595e 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 6f081acc1b47..4795e4476b33 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 6e7201c82042..1f27f3c6bbd9 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 4d9ba26bd992..f9d3fececa89 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 6e7201c82042..1f27f3c6bbd9 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 edcf10ef1c1d..dc794495939c 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 daccb1461598..a41a1dffbf24 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 854d89c139f9..c6cf58f31702 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 6e7201c82042..1f27f3c6bbd9 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>