sd/source/ui/func/fudraw.cxx |   21 +++++++++++++++------
 sd/source/ui/inc/fudraw.hxx  |    1 +
 2 files changed, 16 insertions(+), 6 deletions(-)

New commits:
commit ef58e10844dff60cd218306b059ec81d8421f961
Author: Samuel Mehrbrodt <s.mehrbr...@gmail.com>
Date:   Fri Sep 26 18:45:42 2014 +0200

    fdo#83808 Scale images proportionally by default in Impress/Draw
    
    Change-Id: I16cacb90150aef3aa2ad4607e05298f0bc47c1ae

diff --git a/sd/source/ui/func/fudraw.cxx b/sd/source/ui/func/fudraw.cxx
index 99e63b2..360aed0 100644
--- a/sd/source/ui/func/fudraw.cxx
+++ b/sd/source/ui/func/fudraw.cxx
@@ -93,11 +93,21 @@ bool FuDraw::MouseButtonDown(const MouseEvent& rMEvt)
     SetMouseButtonCode(rMEvt.GetButtons());
 
     bool bReturn = false;
-
     bDragHelpLine = false;
-
     aMDPos = mpWindow->PixelToLogic( rMEvt.GetPosPixel() );
 
+    // Check whether an image is selected
+    bIsImageSelected = false;
+    if (mpView->AreObjectsMarked())
+    {
+        const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
+        if (rMarkList.GetMarkCount() == 1)
+        {
+            SdrMark* pMark = rMarkList.GetMark(0);
+            bIsImageSelected = pMark->GetMarkedSdrObj()->GetObjIdentifier() == 
OBJ_GRAF;
+        }
+    }
+
     if ( rMEvt.IsLeft() )
     {
         FrameView* pFrameView = mpViewShell->GetFrameView();
@@ -217,7 +227,6 @@ bool FuDraw::MouseMove(const MouseEvent& rMEvt)
     Point aPos = mpWindow->PixelToLogic( rMEvt.GetPosPixel() );
 
     bool bOrtho = false;
-
     bool bRestricted = true;
 
     if (mpView->IsDragObj())
@@ -235,10 +244,10 @@ bool FuDraw::MouseMove(const MouseEvent& rMEvt)
     if (mpView->IsAction())
     {
         // #i33136#
-        if(bRestricted && doConstructOrthogonal())
+        if(bIsImageSelected || (bRestricted && doConstructOrthogonal()))
         {
-            // Restrict movement:
-            // rectangle->quadrat, ellipse->circle etc.
+            // Scale proportionally by default:
+            // rectangle->quadrat, ellipse->circle, Images etc.
             bOrtho = !rMEvt.IsShift();
         }
         else
diff --git a/sd/source/ui/inc/fudraw.hxx b/sd/source/ui/inc/fudraw.hxx
index fb13e98..41efba2 100644
--- a/sd/source/ui/inc/fudraw.hxx
+++ b/sd/source/ui/inc/fudraw.hxx
@@ -78,6 +78,7 @@ protected:
     bool    bDragHelpLine;
     sal_uInt16  nHelpLine;
     bool    bPermanent;
+    bool bIsImageSelected;
 
 };
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to