sd image resizing: Small code cleanup
The decision whether to resize proportionally should be made in FuPoor::doConstructOrthogonal Change-Id: I9f27bc377db2933f781f962b0048527ded533b34 Reviewed-on: https://gerrit.libreoffice.org/23281 Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
This commit is contained in:
@@ -78,7 +78,6 @@ FuDraw::FuDraw(ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView,
|
|||||||
, bDragHelpLine(false)
|
, bDragHelpLine(false)
|
||||||
, nHelpLine(0)
|
, nHelpLine(0)
|
||||||
, bPermanent(false)
|
, bPermanent(false)
|
||||||
, bIsMediaSelected(false)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -155,25 +154,6 @@ bool FuDraw::MouseButtonDown(const MouseEvent& rMEvt)
|
|||||||
bDragHelpLine = false;
|
bDragHelpLine = false;
|
||||||
aMDPos = mpWindow->PixelToLogic( rMEvt.GetPosPixel() );
|
aMDPos = mpWindow->PixelToLogic( rMEvt.GetPosPixel() );
|
||||||
|
|
||||||
// Check whether a media object is selected
|
|
||||||
bIsMediaSelected = false;
|
|
||||||
if (mpView->AreObjectsMarked())
|
|
||||||
{
|
|
||||||
const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
|
|
||||||
if (rMarkList.GetMarkCount() == 1)
|
|
||||||
{
|
|
||||||
SdrMark* pMark = rMarkList.GetMark(0);
|
|
||||||
// tdf#89758 Extra check to avoid interactive crop preview from being
|
|
||||||
// proportionally scaled by default.
|
|
||||||
if (mpView->GetDragMode() != SDRDRAG_CROP)
|
|
||||||
{
|
|
||||||
sal_uInt16 aObjIdentifier = pMark->GetMarkedSdrObj()->GetObjIdentifier();
|
|
||||||
bIsMediaSelected = aObjIdentifier == OBJ_GRAF ||
|
|
||||||
aObjIdentifier == OBJ_MEDIA;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( rMEvt.IsLeft() )
|
if ( rMEvt.IsLeft() )
|
||||||
{
|
{
|
||||||
FrameView* pFrameView = mpViewShell->GetFrameView();
|
FrameView* pFrameView = mpViewShell->GetFrameView();
|
||||||
@@ -261,7 +241,7 @@ bool FuDraw::MouseMove(const MouseEvent& rMEvt)
|
|||||||
if (mpView->IsAction())
|
if (mpView->IsAction())
|
||||||
{
|
{
|
||||||
// #i33136# and fdo#88339
|
// #i33136# and fdo#88339
|
||||||
if(bRestricted && (bIsMediaSelected || doConstructOrthogonal()))
|
if(bRestricted && doConstructOrthogonal())
|
||||||
{
|
{
|
||||||
// Scale proportionally by default:
|
// Scale proportionally by default:
|
||||||
// rectangle->quadrat, ellipse->circle, Images etc.
|
// rectangle->quadrat, ellipse->circle, Images etc.
|
||||||
|
@@ -1123,7 +1123,23 @@ bool FuPoor::cancel()
|
|||||||
// #i33136#
|
// #i33136#
|
||||||
bool FuPoor::doConstructOrthogonal() const
|
bool FuPoor::doConstructOrthogonal() const
|
||||||
{
|
{
|
||||||
|
// Check whether a media object is selected
|
||||||
|
bool bIsMediaSelected = false;
|
||||||
|
// tdf#89758 Avoid interactive crop preview from being proportionally scaled by default.
|
||||||
|
if (mpView->AreObjectsMarked() && mpView->GetDragMode() != SDRDRAG_CROP)
|
||||||
|
{
|
||||||
|
const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
|
||||||
|
if (rMarkList.GetMarkCount() == 1)
|
||||||
|
{
|
||||||
|
SdrMark* pMark = rMarkList.GetMark(0);
|
||||||
|
sal_uInt16 aObjIdentifier = pMark->GetMarkedSdrObj()->GetObjIdentifier();
|
||||||
|
bIsMediaSelected = aObjIdentifier == OBJ_GRAF ||
|
||||||
|
aObjIdentifier == OBJ_MEDIA;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
bIsMediaSelected ||
|
||||||
SID_DRAW_XLINE == nSlotId ||
|
SID_DRAW_XLINE == nSlotId ||
|
||||||
SID_DRAW_CIRCLEARC == nSlotId ||
|
SID_DRAW_CIRCLEARC == nSlotId ||
|
||||||
SID_DRAW_SQUARE == nSlotId ||
|
SID_DRAW_SQUARE == nSlotId ||
|
||||||
|
@@ -77,7 +77,6 @@ protected:
|
|||||||
bool bDragHelpLine;
|
bool bDragHelpLine;
|
||||||
sal_uInt16 nHelpLine;
|
sal_uInt16 nHelpLine;
|
||||||
bool bPermanent;
|
bool bPermanent;
|
||||||
bool bIsMediaSelected;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void DoModifiers(const MouseEvent& rMEvt, bool bSnapModPressed);
|
void DoModifiers(const MouseEvent& rMEvt, bool bSnapModPressed);
|
||||||
|
Reference in New Issue
Block a user