[Libreoffice-commits] core.git: 2 commits - filter/source include/svx svx/source sw/source

Matúš Kukan matus.kukan at collabora.com
Fri Jul 11 00:32:31 PDT 2014


 filter/source/msfilter/msdffimp.cxx |    2 
 include/svx/svddrgmt.hxx            |    3 +
 include/svx/svdoashp.hxx            |    9 +--
 svx/source/svdraw/svdoashp.cxx      |  105 ++++++++++++++++++------------------
 sw/source/core/frmedt/feshview.cxx  |    6 +-
 sw/source/uibase/wrtsh/select.cxx   |    6 +-
 6 files changed, 70 insertions(+), 61 deletions(-)

New commits:
commit d01e35e1203c85334c504ea7b313db199973c7ae
Author: Matúš Kukan <matus.kukan at collabora.com>
Date:   Fri Jul 11 09:19:59 2014 +0200

    Clean up usage of 'this' and constness.
    
    Change-Id: I35085bebdec47598a5f927924b429b02b44c0e65

diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index 66e49fd..fa8672f 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -4601,7 +4601,7 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
                             Point aRight( aLeft.X() + 1000, aLeft.Y() );
                             pRet->NbcMirror( aLeft, aRight );
                         }
-                        basegfx::B2DPolyPolygon aPoly( SdrObjCustomShape::GetLineGeometry( (SdrObjCustomShape*)pRet, true ) );
+                        basegfx::B2DPolyPolygon aPoly( static_cast<SdrObjCustomShape*>(pRet)->GetLineGeometry( true ) );
                         SdrObject::Free( pRet );
 
                         pRet = new SdrEdgeObj();
diff --git a/include/svx/svdoashp.hxx b/include/svx/svdoashp.hxx
index fbf2c12..169dd13 100644
--- a/include/svx/svdoashp.hxx
+++ b/include/svx/svdoashp.hxx
@@ -105,13 +105,13 @@ public:
 // #i47293#
 //  SVX_DLLPRIVATE std::vector< com::sun::star::uno::Reference< com::sun::star::drawing::XCustomShapeHandle > > GetFixedInteractionHandle() const;
 
-    SVX_DLLPRIVATE std::vector< SdrCustomShapeInteraction > GetInteractionHandles( const SdrObjCustomShape* pCustomShape ) const;
+    SVX_DLLPRIVATE std::vector< SdrCustomShapeInteraction > GetInteractionHandles() const;
 
     SVX_DLLPRIVATE void DragCreateObject( SdrDragStat& rDrag );
 
-    SVX_DLLPRIVATE void DragResizeCustomShape( const Rectangle& rNewRect, SdrObjCustomShape* pObj ) const;
+    SVX_DLLPRIVATE void DragResizeCustomShape( const Rectangle& rNewRect );
     SVX_DLLPRIVATE void DragMoveCustomShapeHdl( const Point aDestination,
-            const sal_uInt16 nCustomShapeHdlNum, SdrObjCustomShape* pObj, bool bMoveCalloutRectangle ) const;
+            const sal_uInt16 nCustomShapeHdlNum, bool bMoveCalloutRectangle );
 
     // #i37011# centralize throw-away of render geometry
     void InvalidateRenderGeometry();
@@ -128,7 +128,7 @@ public:
     const SdrObject* GetSdrObjectShadowFromCustomShape() const;
     bool GetTextBounds( Rectangle& rTextBound ) const;
     bool IsTextPath() const;
-    static basegfx::B2DPolyPolygon GetLineGeometry( const SdrObjCustomShape* pCustomShape, const bool bBezierAllowed );
+    basegfx::B2DPolyPolygon GetLineGeometry( const bool bBezierAllowed ) const;
 
 protected:
     // #115391# new method for SdrObjCustomShape and SdrTextObj to correctly handle and set
diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx
index b3941f9..9e021dc 100644
--- a/svx/source/svdraw/svdoashp.cxx
+++ b/svx/source/svdraw/svdoashp.cxx
@@ -439,7 +439,7 @@ const SdrObject* SdrObjCustomShape::GetSdrObjectFromCustomShape() const
     {
         Reference< XCustomShapeEngine > xCustomShapeEngine( GetCustomShapeEngine() );
         if ( xCustomShapeEngine.is() )
-            ((SdrObjCustomShape*)this)->mXRenderedCustomShape = xCustomShapeEngine->render();
+            const_cast<SdrObjCustomShape*>(this)->mXRenderedCustomShape = xCustomShapeEngine->render();
     }
     SdrObject* pRenderedCustomShape = mXRenderedCustomShape.is()
                 ? GetSdrObjectFromXShape( mXRenderedCustomShape )
@@ -462,7 +462,8 @@ const SdrObject* SdrObjCustomShape::GetSdrObjectShadowFromCustomShape() const
             {
                 // create a clone with all attributes changed to shadow attributes
                 // and translation executed, too.
-                ((SdrObjCustomShape*)this)->mpLastShadowGeometry = ImpCreateShadowObjectClone(*pSdrObject, rOriginalSet);
+                const_cast<SdrObjCustomShape*>(this)->mpLastShadowGeometry =
+                    ImpCreateShadowObjectClone(*pSdrObject, rOriginalSet);
             }
         }
     }
@@ -577,10 +578,10 @@ bool SdrObjCustomShape::GetTextBounds( Rectangle& rTextBound ) const
     }
     return bRet;
 }
-basegfx::B2DPolyPolygon SdrObjCustomShape::GetLineGeometry( const SdrObjCustomShape* pCustomShape, const bool bBezierAllowed )
+basegfx::B2DPolyPolygon SdrObjCustomShape::GetLineGeometry( const bool bBezierAllowed ) const
 {
     basegfx::B2DPolyPolygon aRetval;
-    Reference< XCustomShapeEngine > xCustomShapeEngine( pCustomShape->GetCustomShapeEngine() );
+    Reference< XCustomShapeEngine > xCustomShapeEngine( GetCustomShapeEngine() );
     if ( xCustomShapeEngine.is() )
     {
         com::sun::star::drawing::PolyPolygonBezierCoords aBezierCoords = xCustomShapeEngine->getLineGeometry();
@@ -599,12 +600,12 @@ basegfx::B2DPolyPolygon SdrObjCustomShape::GetLineGeometry( const SdrObjCustomSh
     return aRetval;
 }
 
-std::vector< SdrCustomShapeInteraction > SdrObjCustomShape::GetInteractionHandles( const SdrObjCustomShape* pCustomShape ) const
+std::vector< SdrCustomShapeInteraction > SdrObjCustomShape::GetInteractionHandles() const
 {
     std::vector< SdrCustomShapeInteraction > xRet;
     try
     {
-        Reference< XCustomShapeEngine > xCustomShapeEngine( pCustomShape->GetCustomShapeEngine() );
+        Reference< XCustomShapeEngine > xCustomShapeEngine( GetCustomShapeEngine() );
         if ( xCustomShapeEngine.is() )
         {
             int i;
@@ -1575,7 +1576,7 @@ void SdrObjCustomShape::NbcResize( const Point& rRef, const Fraction& rxFact, co
 
     // taking care of handles that should not been changed
     Rectangle aOld( aRect );
-    std::vector< SdrCustomShapeInteraction > aInteractionHandles( GetInteractionHandles( this ) );
+    std::vector< SdrCustomShapeInteraction > aInteractionHandles( GetInteractionHandles() );
 
     SdrTextObj::NbcResize( rRef, xFact, yFact );
 
@@ -1871,7 +1872,7 @@ void SdrObjCustomShape::ImpCheckCustomGluePointsAreAdded()
 // #i38892#
 const SdrGluePointList* SdrObjCustomShape::GetGluePointList() const
 {
-    ((SdrObjCustomShape*)this)->ImpCheckCustomGluePointsAreAdded();
+    const_cast<SdrObjCustomShape*>(this)->ImpCheckCustomGluePointsAreAdded();
     return SdrTextObj::GetGluePointList();
 }
 
@@ -1894,7 +1895,7 @@ SdrGluePointList* SdrObjCustomShape::ForceGluePointList()
 sal_uInt32 SdrObjCustomShape::GetHdlCount() const
 {
     const sal_uInt32 nBasicHdlCount(SdrTextObj::GetHdlCount());
-    std::vector< SdrCustomShapeInteraction > aInteractionHandles( GetInteractionHandles( this ) );
+    std::vector< SdrCustomShapeInteraction > aInteractionHandles( GetInteractionHandles() );
     return ( aInteractionHandles.size() + nBasicHdlCount );
 }
 
@@ -1907,7 +1908,7 @@ SdrHdl* SdrObjCustomShape::GetHdl( sal_uInt32 nHdlNum ) const
         pH = SdrTextObj::GetHdl( nHdlNum );
     else
     {
-        std::vector< SdrCustomShapeInteraction > aInteractionHandles( GetInteractionHandles( this ) );
+        std::vector< SdrCustomShapeInteraction > aInteractionHandles( GetInteractionHandles() );
         const sal_uInt32 nCustomShapeHdlNum(nHdlNum - nBasicHdlCount);
 
         if ( nCustomShapeHdlNum < aInteractionHandles.size() )
@@ -1975,42 +1976,42 @@ bool SdrObjCustomShape::beginSpecialDrag(SdrDragStat& rDrag) const
     return true;
 }
 
-void SdrObjCustomShape::DragResizeCustomShape( const Rectangle& rNewRect, SdrObjCustomShape* pObj ) const
+void SdrObjCustomShape::DragResizeCustomShape( const Rectangle& rNewRect )
 {
-    Rectangle   aOld( pObj->aRect );
-    bool    bOldMirroredX( pObj->IsMirroredX() );
-    bool    bOldMirroredY( pObj->IsMirroredY() );
+    Rectangle   aOld( aRect );
+    bool    bOldMirroredX( IsMirroredX() );
+    bool    bOldMirroredY( IsMirroredY() );
 
     Rectangle aNewRect( rNewRect );
     aNewRect.Justify();
 
-    std::vector< SdrCustomShapeInteraction > aInteractionHandles( GetInteractionHandles( pObj ) );
+    std::vector< SdrCustomShapeInteraction > aInteractionHandles( GetInteractionHandles() );
 
-    GeoStat aGeoStat( pObj->GetGeoStat() );
-    if ( aNewRect.TopLeft()!= pObj->aRect.TopLeft() &&
-        ( pObj->aGeo.nDrehWink || pObj->aGeo.nShearWink ) )
+    GeoStat aGeoStat( GetGeoStat() );
+    if ( aNewRect.TopLeft()!= aRect.TopLeft() &&
+        ( aGeo.nDrehWink || aGeo.nShearWink ) )
     {
         Point aNewPos( aNewRect.TopLeft() );
-        if ( pObj->aGeo.nShearWink ) ShearPoint( aNewPos, aOld.TopLeft(), aGeoStat.nTan );
-        if ( pObj->aGeo.nDrehWink )  RotatePoint(aNewPos, aOld.TopLeft(), aGeoStat.nSin, aGeoStat.nCos );
+        if ( aGeo.nShearWink ) ShearPoint( aNewPos, aOld.TopLeft(), aGeoStat.nTan );
+        if ( aGeo.nDrehWink )  RotatePoint(aNewPos, aOld.TopLeft(), aGeoStat.nSin, aGeoStat.nCos );
         aNewRect.SetPos( aNewPos );
     }
-    if ( aNewRect != pObj->aRect )
+    if ( aNewRect != aRect )
     {
-        pObj->SetLogicRect( aNewRect );
-        pObj->InvalidateRenderGeometry();
+        SetLogicRect( aNewRect );
+        InvalidateRenderGeometry();
 
         if ( rNewRect.Left() > rNewRect.Right() )
         {
-            Point aTop( ( pObj->GetSnapRect().Left() + pObj->GetSnapRect().Right() ) >> 1, pObj->GetSnapRect().Top() );
+            Point aTop( ( GetSnapRect().Left() + GetSnapRect().Right() ) >> 1, GetSnapRect().Top() );
             Point aBottom( aTop.X(), aTop.Y() + 1000 );
-            pObj->NbcMirror( aTop, aBottom );
+            NbcMirror( aTop, aBottom );
         }
         if ( rNewRect.Top() > rNewRect.Bottom() )
         {
-            Point aLeft( pObj->GetSnapRect().Left(), ( pObj->GetSnapRect().Top() + pObj->GetSnapRect().Bottom() ) >> 1 );
+            Point aLeft( GetSnapRect().Left(), ( GetSnapRect().Top() + GetSnapRect().Bottom() ) >> 1 );
             Point aRight( aLeft.X() + 1000, aLeft.Y() );
-            pObj->NbcMirror( aLeft, aRight );
+            NbcMirror( aLeft, aRight );
         }
 
         for (std::vector< SdrCustomShapeInteraction >::const_iterator aIter( aInteractionHandles.begin() ), aEnd( aInteractionHandles.end() );
@@ -2027,17 +2028,17 @@ void SdrObjCustomShape::DragResizeCustomShape( const Rectangle& rNewRect, SdrObj
                     {
                         nX = ( aIter->aPosition.X - aOld.Right() );
                         if ( rNewRect.Left() > rNewRect.Right() )
-                            nX = pObj->aRect.Left() - nX;
+                            nX = aRect.Left() - nX;
                         else
-                            nX += pObj->aRect.Right();
+                            nX += aRect.Right();
                     }
                     else
                     {
                         nX = ( aIter->aPosition.X - aOld.Left() );
                         if ( rNewRect.Left() > rNewRect.Right() )
-                            nX = pObj->aRect.Right() - nX;
+                            nX = aRect.Right() - nX;
                         else
-                            nX += pObj->aRect.Left();
+                            nX += aRect.Left();
                     }
                     aIter->xInteraction->setControllerPosition( com::sun::star::awt::Point( nX, aIter->xInteraction->getPosition().Y ) );
                 }
@@ -2048,17 +2049,17 @@ void SdrObjCustomShape::DragResizeCustomShape( const Rectangle& rNewRect, SdrObj
                     {
                         nY = ( aIter->aPosition.Y - aOld.Bottom() );
                         if ( rNewRect.Top() > rNewRect.Bottom() )
-                            nY = pObj->aRect.Top() - nY;
+                            nY = aRect.Top() - nY;
                         else
-                            nY += pObj->aRect.Bottom();
+                            nY += aRect.Bottom();
                     }
                     else
                     {
                         nY = ( aIter->aPosition.Y - aOld.Top() );
                         if ( rNewRect.Top() > rNewRect.Bottom() )
-                            nY = pObj->aRect.Bottom() - nY;
+                            nY = aRect.Bottom() - nY;
                         else
-                            nY += pObj->aRect.Top();
+                            nY += aRect.Top();
                     }
                     aIter->xInteraction->setControllerPosition( com::sun::star::awt::Point( aIter->xInteraction->getPosition().X, nY ) );
                 }
@@ -2071,9 +2072,9 @@ void SdrObjCustomShape::DragResizeCustomShape( const Rectangle& rNewRect, SdrObj
 }
 
 void SdrObjCustomShape::DragMoveCustomShapeHdl( const Point aDestination,
-        const sal_uInt16 nCustomShapeHdlNum, SdrObjCustomShape* pObj, bool bMoveCalloutRectangle ) const
+        const sal_uInt16 nCustomShapeHdlNum, bool bMoveCalloutRectangle )
 {
-    std::vector< SdrCustomShapeInteraction > aInteractionHandles( GetInteractionHandles( pObj ) );
+    std::vector< SdrCustomShapeInteraction > aInteractionHandles( GetInteractionHandles() );
     if ( nCustomShapeHdlNum < aInteractionHandles.size() )
     {
         SdrCustomShapeInteraction aInteractionHandle( aInteractionHandles[ nCustomShapeHdlNum ] );
@@ -2087,11 +2088,11 @@ void SdrObjCustomShape::DragMoveCustomShapeHdl( const Point aDestination,
                     sal_Int32 nXDiff = aPt.X - aInteractionHandle.aPosition.X;
                     sal_Int32 nYDiff = aPt.Y - aInteractionHandle.aPosition.Y;
 
-                    pObj->aRect.Move( nXDiff, nYDiff );
-                    pObj->aOutRect.Move( nXDiff, nYDiff );
-                    pObj->maSnapRect.Move( nXDiff, nYDiff );
-                    pObj->SetRectsDirty(true);
-                    pObj->InvalidateRenderGeometry();
+                    aRect.Move( nXDiff, nYDiff );
+                    aOutRect.Move( nXDiff, nYDiff );
+                    maSnapRect.Move( nXDiff, nYDiff );
+                    SetRectsDirty(true);
+                    InvalidateRenderGeometry();
 
                     for (std::vector< SdrCustomShapeInteraction >::const_iterator aIter( aInteractionHandles.begin() ), aEnd( aInteractionHandles.end() ) ;
                       aIter != aEnd; ++aIter)
@@ -2122,7 +2123,7 @@ bool SdrObjCustomShape::applySpecialDrag(SdrDragStat& rDrag)
         case HDL_CUSTOMSHAPE1 :
         {
             rDrag.SetEndDragChangesGeoAndAttributes(true);
-            DragMoveCustomShapeHdl( rDrag.GetNow(), (sal_uInt16)pHdl->GetPointNum(), this, !rDrag.GetDragMethod()->IsShiftPressed() );
+            DragMoveCustomShapeHdl( rDrag.GetNow(), (sal_uInt16)pHdl->GetPointNum(), !rDrag.GetDragMethod()->IsShiftPressed() );
             SetRectsDirty();
             InvalidateRenderGeometry();
             SetChanged();
@@ -2138,7 +2139,7 @@ bool SdrObjCustomShape::applySpecialDrag(SdrDragStat& rDrag)
         case HDL_LOWER :
         case HDL_LWRGT :
         {
-            DragResizeCustomShape(ImpDragCalcRect(rDrag), this);
+            DragResizeCustomShape( ImpDragCalcRect(rDrag) );
             break;
         }
         case HDL_MOVE :
@@ -2159,7 +2160,7 @@ void SdrObjCustomShape::DragCreateObject( SdrDragStat& rStat )
     Rectangle aRect1;
     rStat.TakeCreateRect( aRect1 );
 
-    std::vector< SdrCustomShapeInteraction > aInteractionHandles( GetInteractionHandles( this ) );
+    std::vector< SdrCustomShapeInteraction > aInteractionHandles( GetInteractionHandles() );
 
     sal_uInt32 nDefaultObjectSizeWidth = 3000;      // default width from SDOptions ?
     sal_uInt32 nDefaultObjectSizeHeight= 3000;
@@ -2228,7 +2229,7 @@ bool SdrObjCustomShape::EndCreate( SdrDragStat& rStat, SdrCreateCmd eCmd )
 
 basegfx::B2DPolyPolygon SdrObjCustomShape::TakeCreatePoly(const SdrDragStat& /*rDrag*/) const
 {
-    return GetLineGeometry( this, false );
+    return GetLineGeometry( false );
 }
 
 
@@ -2510,7 +2511,7 @@ bool SdrObjCustomShape::NbcAdjustTextFrameWidthAndHeight(bool bHgt, bool bWdt)
     if ( bRet )
     {
         // taking care of handles that should not been changed
-        std::vector< SdrCustomShapeInteraction > aInteractionHandles( GetInteractionHandles( this ) );
+        std::vector< SdrCustomShapeInteraction > aInteractionHandles( GetInteractionHandles() );
 
         aRect = aNewTextRect;
         SetRectsDirty();
@@ -2543,7 +2544,7 @@ bool SdrObjCustomShape::AdjustTextFrameWidthAndHeight(bool bHgt, bool bWdt)
             aBoundRect0 = GetCurrentBoundRect();
 
         // taking care of handles that should not been changed
-        std::vector< SdrCustomShapeInteraction > aInteractionHandles( GetInteractionHandles( this ) );
+        std::vector< SdrCustomShapeInteraction > aInteractionHandles( GetInteractionHandles() );
 
         aRect = aNewTextRect;
         SetRectsDirty();
@@ -2867,7 +2868,7 @@ OUString SdrObjCustomShape::TakeObjNamePlural() const
 
 basegfx::B2DPolyPolygon SdrObjCustomShape::TakeXorPoly() const
 {
-    return GetLineGeometry( (SdrObjCustomShape*)this, false );
+    return GetLineGeometry( false );
 }
 
 basegfx::B2DPolyPolygon SdrObjCustomShape::TakeContour() const
@@ -2887,7 +2888,7 @@ SdrObject* SdrObjCustomShape::DoConvertToPolyObj(bool bBezier, bool bAddText) co
     if ( !mXRenderedCustomShape.is() )
     {
         // force CustomShape
-        ((SdrObjCustomShape*)this)->GetSdrObjectFromCustomShape();
+        GetSdrObjectFromCustomShape();
     }
 
     if ( mXRenderedCustomShape.is() )
commit d98c817cc71e62a2beecc7142062f9ef33a7149b
Author: Matúš Kukan <matus.kukan at collabora.com>
Date:   Thu Jul 10 20:56:43 2014 +0200

    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

diff --git a/include/svx/svddrgmt.hxx b/include/svx/svddrgmt.hxx
index db16b0e..6e2fa4a 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 e5b3e8f..fbf2c12 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 26c563c..b3941f9 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 7cb37cc..75b3d33 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 29fa6c4..8e05860 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;
 }
 


More information about the Libreoffice-commits mailing list