summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <s.mehrbrodt@gmail.com>2014-09-26 18:45:42 +0200
committerSamuel Mehrbrodt <s.mehrbrodt@gmail.com>2014-09-26 18:46:15 +0200
commitef58e10844dff60cd218306b059ec81d8421f961 (patch)
treec3109ec14252cb9922c6738f4c09f5720ceb603a
parent173e0172092fa87606a80a7b0d6b89323c7166b5 (diff)
fdo#83808 Scale images proportionally by default in Impress/Draw
Change-Id: I16cacb90150aef3aa2ad4607e05298f0bc47c1ae
-rw-r--r--sd/source/ui/func/fudraw.cxx21
-rw-r--r--sd/source/ui/inc/fudraw.hxx1
2 files changed, 16 insertions, 6 deletions
diff --git a/sd/source/ui/func/fudraw.cxx b/sd/source/ui/func/fudraw.cxx
index 99e63b280847..360aed0bfba4 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 fb13e98ccc27..41efba206209 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;
};