Fraction->double in ResizeMultMarkedObj

Change-Id: Ic91d5e20d0de17f73b2ff1b12c7092a5236d2627
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/201736
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin
2026-03-18 07:09:19 +01:00
committed by Noel Grandin
parent e1e569df66
commit 5c66e050a5
2 changed files with 13 additions and 12 deletions
+1 -1
View File
@@ -232,7 +232,7 @@ public:
void MoveMarkedObj(const Size& rSiz, bool bCopy=false);
void ResizeMarkedObj(const Point& rRef, double xFact, double yFact, bool bCopy=false);
bool IsMarkedObjSizeValid(const Size& aTargetSize);
SAL_DLLPRIVATE void ResizeMultMarkedObj(const Point& rRef, const Fraction& xFact, const Fraction& yFact, const bool bWdh, const bool bHgt);
SAL_DLLPRIVATE void ResizeMultMarkedObj(const Point& rRef, double xFact, double yFact, const bool bWdh, const bool bHgt);
SAL_DLLPRIVATE Degree100 GetMarkedObjRotate() const;
void RotateMarkedObj(const Point& rRef, Degree100 nAngle, bool bCopy=false);
SAL_DLLPRIVATE void MirrorMarkedObj(const Point& rRef1, const Point& rRef2, bool bCopy=false);
+12 -11
View File
@@ -272,8 +272,8 @@ void SdrEditView::ResizeMarkedObj(const Point& rRef, double xFact, double yFact,
EndUndo();
}
void SdrEditView::ResizeMultMarkedObj(const Point& rRef,
const Fraction& xFact,
const Fraction& yFact,
double xFact,
double yFact,
const bool bWdh,
const bool bHgt)
{
@@ -296,13 +296,12 @@ void SdrEditView::ResizeMultMarkedObj(const Point& rRef,
AddUndo(GetModel().GetSdrUndoFactory().CreateUndoGeoObject(*pO));
}
Fraction aFrac(1,1);
if (bWdh && xFact.IsValid() && bHgt && yFact.IsValid())
pO->Resize(rRef, double(xFact), double(yFact));
else if (bWdh && xFact.IsValid())
pO->Resize(rRef, double(xFact), double(aFrac));
else if (bHgt && yFact.IsValid())
pO->Resize(rRef, double(aFrac), double(yFact));
if (bWdh && xFact != 0.0 && bHgt && yFact != 0.0)
pO->Resize(rRef, xFact, yFact);
else if (bWdh && xFact != 0.0)
pO->Resize(rRef, xFact, 1.0);
else if (bHgt && yFact != 0.0)
pO->Resize(rRef, 1.0, yFact);
}
if( bUndo )
EndUndo();
@@ -1785,8 +1784,10 @@ void SdrEditView::SetGeoAttrToMarked(const SfxItemSet& rAttr, bool addPageMargin
// change size and height
if (bChgSiz && (m_bResizeFreeAllowed || m_bResizePropAllowed)) {
Fraction aWdt(nSizX,aRect.Right()-aRect.Left());
Fraction aHgt(nSizY,aRect.Bottom()-aRect.Top());
auto nWidth = aRect.Right()-aRect.Left();
double aWdt = nWidth == 0 ? 0 : (double(nSizX) / nWidth);
auto nHeight = aRect.Bottom()-aRect.Top();
double aHgt = nHeight == 0 ? 0 : (double(nSizY) / nHeight);
Point aRef(ImpGetPoint(aRect,eSizePoint));
if(GetSdrPageView())