diff options
author | Matúš Kukan <matus.kukan@collabora.com> | 2014-07-10 20:56:43 +0200 |
---|---|---|
committer | Matúš Kukan <matus.kukan@collabora.com> | 2014-07-11 09:32:08 +0200 |
commit | d98c817cc71e62a2beecc7142062f9ef33a7149b (patch) | |
tree | b204588f46e938c5549c2a4ff4b87d8e71bc9591 | |
parent | d5dd1216804afae35d7fe7dbb1d37b0ca1fcce88 (diff) |
Allow to move only callout handle with shift key (cp#1000084)
When line callout was used, you couldn't move the point next to
the rectangle.
Now it's possible with shift key pressed.
Change-Id: I70565e4e3f80daf0e1007031ef7d49036fb0e26b
-rw-r--r-- | include/svx/svddrgmt.hxx | 3 | ||||
-rw-r--r-- | include/svx/svdoashp.hxx | 3 | ||||
-rw-r--r-- | svx/source/svdraw/svdoashp.cxx | 8 | ||||
-rw-r--r-- | sw/source/core/frmedt/feshview.cxx | 6 | ||||
-rw-r--r-- | sw/source/uibase/wrtsh/select.cxx | 6 |
5 files changed, 17 insertions, 9 deletions
diff --git a/include/svx/svddrgmt.hxx b/include/svx/svddrgmt.hxx index db16b0ec5b07..6e2fa4a87359 100644 --- a/include/svx/svddrgmt.hxx +++ b/include/svx/svddrgmt.hxx @@ -127,6 +127,7 @@ private: // bitfield bool mbMoveOnly : 1; bool mbSolidDraggingActive : 1; + bool mbShiftPressed : 1; protected: // access for derivated classes to maSdrDragEntries @@ -193,6 +194,8 @@ public: void Show(); void Hide(); + bool IsShiftPressed() { return mbShiftPressed; } + void SetShiftPressed(bool bShiftPressed) { mbShiftPressed = bShiftPressed; } virtual void TakeSdrDragComment(OUString& rStr) const=0; virtual bool BeginSdrDrag()=0; virtual void MoveSdrDrag(const Point& rPnt)=0; diff --git a/include/svx/svdoashp.hxx b/include/svx/svdoashp.hxx index e5b3e8f8b29d..fbf2c1256523 100644 --- a/include/svx/svdoashp.hxx +++ b/include/svx/svdoashp.hxx @@ -110,7 +110,8 @@ public: SVX_DLLPRIVATE void DragCreateObject( SdrDragStat& rDrag ); SVX_DLLPRIVATE void DragResizeCustomShape( const Rectangle& rNewRect, SdrObjCustomShape* pObj ) const; - SVX_DLLPRIVATE void DragMoveCustomShapeHdl( const Point aDestination, const sal_uInt16 nCustomShapeHdlNum, SdrObjCustomShape* pObj ) const; + SVX_DLLPRIVATE void DragMoveCustomShapeHdl( const Point aDestination, + const sal_uInt16 nCustomShapeHdlNum, SdrObjCustomShape* pObj, bool bMoveCalloutRectangle ) const; // #i37011# centralize throw-away of render geometry void InvalidateRenderGeometry(); diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx index 26c563c8d6f8..b3941f910041 100644 --- a/svx/source/svdraw/svdoashp.cxx +++ b/svx/source/svdraw/svdoashp.cxx @@ -37,6 +37,7 @@ #include <svx/svddrag.hxx> #include <svx/xpool.hxx> #include <svx/xpoly.hxx> +#include <svx/svddrgmt.hxx> #include <svx/svdmodel.hxx> #include <svx/svdpage.hxx> #include "svx/svditer.hxx" @@ -2069,7 +2070,8 @@ void SdrObjCustomShape::DragResizeCustomShape( const Rectangle& rNewRect, SdrObj } } -void SdrObjCustomShape::DragMoveCustomShapeHdl( const Point aDestination, const sal_uInt16 nCustomShapeHdlNum, SdrObjCustomShape* pObj ) const +void SdrObjCustomShape::DragMoveCustomShapeHdl( const Point aDestination, + const sal_uInt16 nCustomShapeHdlNum, SdrObjCustomShape* pObj, bool bMoveCalloutRectangle ) const { std::vector< SdrCustomShapeInteraction > aInteractionHandles( GetInteractionHandles( pObj ) ); if ( nCustomShapeHdlNum < aInteractionHandles.size() ) @@ -2080,7 +2082,7 @@ void SdrObjCustomShape::DragMoveCustomShapeHdl( const Point aDestination, const try { com::sun::star::awt::Point aPt( aDestination.X(), aDestination.Y() ); - if ( aInteractionHandle.nMode & CUSTOMSHAPE_HANDLE_MOVE_SHAPE ) + if ( aInteractionHandle.nMode & CUSTOMSHAPE_HANDLE_MOVE_SHAPE && bMoveCalloutRectangle ) { sal_Int32 nXDiff = aPt.X - aInteractionHandle.aPosition.X; sal_Int32 nYDiff = aPt.Y - aInteractionHandle.aPosition.Y; @@ -2120,7 +2122,7 @@ bool SdrObjCustomShape::applySpecialDrag(SdrDragStat& rDrag) case HDL_CUSTOMSHAPE1 : { rDrag.SetEndDragChangesGeoAndAttributes(true); - DragMoveCustomShapeHdl( rDrag.GetNow(), (sal_uInt16)pHdl->GetPointNum(), this ); + DragMoveCustomShapeHdl( rDrag.GetNow(), (sal_uInt16)pHdl->GetPointNum(), this, !rDrag.GetDragMethod()->IsShiftPressed() ); SetRectsDirty(); InvalidateRenderGeometry(); SetChanged(); diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx index 7cb37cccf3d6..75b3d3342765 100644 --- a/sw/source/core/frmedt/feshview.cxx +++ b/sw/source/core/frmedt/feshview.cxx @@ -19,6 +19,7 @@ #include "hintids.hxx" #include <svx/sdrobjectfilter.hxx> +#include <svx/svddrgmt.hxx> #include <svx/svditer.hxx> #include <svx/svdobj.hxx> #include <svx/svdouno.hxx> @@ -599,14 +600,15 @@ void SwFEShell::SetDragMode( sal_uInt16 eDragMode ) Imp()->GetDrawView()->SetDragMode( (SdrDragMode)eDragMode ); } -long SwFEShell::BeginDrag( const Point* pPt, bool ) +long SwFEShell::BeginDrag( const Point* pPt, bool bIsShift) { SdrView *pView = Imp()->GetDrawView(); if ( pView && pView->AreObjectsMarked() ) { delete pChainFrom; delete pChainTo; pChainFrom = pChainTo = 0; SdrHdl* pHdl = pView->PickHandle( *pPt ); - pView->BegDragObj( *pPt, 0, pHdl ); + if (pView->BegDragObj( *pPt, 0, pHdl )) + pView->GetDragMethod()->SetShiftPressed( bIsShift ); ::FrameNotify( this, FLY_DRAG ); return 1; } diff --git a/sw/source/uibase/wrtsh/select.cxx b/sw/source/uibase/wrtsh/select.cxx index 29fa6c402aca..8e058602f1bd 100644 --- a/sw/source/uibase/wrtsh/select.cxx +++ b/sw/source/uibase/wrtsh/select.cxx @@ -648,16 +648,16 @@ void SwWrtShell::SetRedlineModeAndCheckInsMode( sal_uInt16 eMode ) // Edit frame -long SwWrtShell::BeginFrmDrag(const Point *pPt, bool) +long SwWrtShell::BeginFrmDrag(const Point *pPt, bool bIsShift) { fnDrag = &SwFEShell::Drag; if(bStartDrag) { Point aTmp( nStartDragX, nStartDragY ); - SwFEShell::BeginDrag( &aTmp, false ); + SwFEShell::BeginDrag( &aTmp, bIsShift ); } else - SwFEShell::BeginDrag( pPt, false ); + SwFEShell::BeginDrag( pPt, bIsShift ); return 1; } |