sc/source/ui/drawfunc/fupoor.cxx | 9 ++++----- sd/source/ui/func/fudraw.cxx | 12 +++++++----- sd/source/ui/inc/fudraw.hxx | 2 +- sw/source/uibase/docvw/edtwin.cxx | 11 ++++++----- 4 files changed, 18 insertions(+), 16 deletions(-)
New commits: commit f669eec43ee902071c8f56a322a6dfb1a4a66e45 Author: Samuel Mehrbrodt <samuel.mehrbr...@cib.de> Date: Tue Mar 15 16:06:05 2016 +0100 tdf#97919 Resize media objects proportionally by default as we do with images Change-Id: I5b27b8310736b9dfd5c274614ad4d1e4becb1fa9 Reviewed-on: https://gerrit.libreoffice.org/23277 Reviewed-by: Samuel Mehrbrodt <samuel.mehrbr...@cib.de> Tested-by: Samuel Mehrbrodt <samuel.mehrbr...@cib.de> diff --git a/sc/source/ui/drawfunc/fupoor.cxx b/sc/source/ui/drawfunc/fupoor.cxx index d9cbdf0..29116e2 100644 --- a/sc/source/ui/drawfunc/fupoor.cxx +++ b/sc/source/ui/drawfunc/fupoor.cxx @@ -290,16 +290,15 @@ bool FuPoor::doConstructOrthogonal() const } } - // Detect image and resize proportionally, but don't constrain movement by default + // Detect image/media and resize proportionally, but don't constrain movement by default if (pView->AreObjectsMarked()) { const SdrMarkList& rMarkList = pView->GetMarkedObjectList(); if (rMarkList.GetMarkCount() == 1) { - if (rMarkList.GetMark(0)->GetMarkedSdrObj()->GetObjIdentifier() == OBJ_GRAF) - { - return true; - } + sal_uInt16 aObjIdentifier = rMarkList.GetMark(0)->GetMarkedSdrObj()->GetObjIdentifier(); + return aObjIdentifier == OBJ_GRAF || + aObjIdentifier == OBJ_MEDIA; } } else if (aSfxRequest.GetSlot() == SID_DRAW_XPOLYGON || aSfxRequest.GetSlot() == SID_DRAW_XPOLYGON_NOFILL) diff --git a/sd/source/ui/func/fudraw.cxx b/sd/source/ui/func/fudraw.cxx index 9d735c4..5404dc3 100644 --- a/sd/source/ui/func/fudraw.cxx +++ b/sd/source/ui/func/fudraw.cxx @@ -78,7 +78,7 @@ FuDraw::FuDraw(ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, , bDragHelpLine(false) , nHelpLine(0) , bPermanent(false) - , bIsImageSelected(false) + , bIsMediaSelected(false) { } @@ -155,8 +155,8 @@ bool FuDraw::MouseButtonDown(const MouseEvent& rMEvt) bDragHelpLine = false; aMDPos = mpWindow->PixelToLogic( rMEvt.GetPosPixel() ); - // Check whether an image is selected - bIsImageSelected = false; + // Check whether a media object is selected + bIsMediaSelected = false; if (mpView->AreObjectsMarked()) { const SdrMarkList& rMarkList = mpView->GetMarkedObjectList(); @@ -167,7 +167,9 @@ bool FuDraw::MouseButtonDown(const MouseEvent& rMEvt) // proportionally scaled by default. if (mpView->GetDragMode() != SDRDRAG_CROP) { - bIsImageSelected = pMark->GetMarkedSdrObj()->GetObjIdentifier() == OBJ_GRAF; + sal_uInt16 aObjIdentifier = pMark->GetMarkedSdrObj()->GetObjIdentifier(); + bIsMediaSelected = aObjIdentifier == OBJ_GRAF || + aObjIdentifier == OBJ_MEDIA; } } } @@ -259,7 +261,7 @@ bool FuDraw::MouseMove(const MouseEvent& rMEvt) if (mpView->IsAction()) { // #i33136# and fdo#88339 - if(bRestricted && (bIsImageSelected || doConstructOrthogonal())) + if(bRestricted && (bIsMediaSelected || doConstructOrthogonal())) { // Scale proportionally by default: // rectangle->quadrat, ellipse->circle, Images etc. diff --git a/sd/source/ui/inc/fudraw.hxx b/sd/source/ui/inc/fudraw.hxx index b315e0b..6a22089 100644 --- a/sd/source/ui/inc/fudraw.hxx +++ b/sd/source/ui/inc/fudraw.hxx @@ -77,7 +77,7 @@ protected: bool bDragHelpLine; sal_uInt16 nHelpLine; bool bPermanent; - bool bIsImageSelected; + bool bIsMediaSelected; private: void DoModifiers(const MouseEvent& rMEvt, bool bSnapModPressed); diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx index b8624c3..780a853 100644 --- a/sw/source/uibase/docvw/edtwin.cxx +++ b/sw/source/uibase/docvw/edtwin.cxx @@ -4079,7 +4079,8 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt) if( bIsDocReadOnly ) break; - bool bIsSelectionGfx = rSh.GetSelectionType() & nsSelectionType::SEL_GRF; + bool bIsMediaSelected = rSh.GetSelectionType() & nsSelectionType::SEL_GRF || + rSh.GetSelectionType() & nsSelectionType::SEL_MEDIA; bool bisResize = g_eSdrMoveHdl != HDL_MOVE; if (pSdrView) @@ -4089,17 +4090,17 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt) if (rMEvt.IsShift()) { - pSdrView->SetAngleSnapEnabled(!bIsSelectionGfx); + pSdrView->SetAngleSnapEnabled(!bIsMediaSelected); if (bisResize) - pSdrView->SetOrtho(!bIsSelectionGfx); + pSdrView->SetOrtho(!bIsMediaSelected); else pSdrView->SetOrtho(true); } else { - pSdrView->SetAngleSnapEnabled(bIsSelectionGfx); + pSdrView->SetAngleSnapEnabled(bIsMediaSelected); if (bisResize) - pSdrView->SetOrtho(bIsSelectionGfx); + pSdrView->SetOrtho(bIsMediaSelected); else pSdrView->SetOrtho(false); } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits