support crop and rotating for drawinglayer object in UI testing
Change-Id: I57a9a43dc5289a9a987e4bf54a3c8d8d40824e67 Reviewed-on: https://gerrit.libreoffice.org/29421 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
This commit is contained in:
parent
86617760eb
commit
ec3aabe66b
@ -100,15 +100,51 @@ void SdrUIObject::execute(const OUString& rAction,
|
|||||||
}
|
}
|
||||||
else if (rAction == "CROP")
|
else if (rAction == "CROP")
|
||||||
{
|
{
|
||||||
Point aPos;
|
auto itrNX = rParameters.find("X");
|
||||||
Fraction aFracX;
|
if (itrNX == rParameters.end())
|
||||||
Fraction aFracY;
|
throw css::uno::RuntimeException("missing parameter X");
|
||||||
|
|
||||||
|
auto itrNY = rParameters.find("Y");
|
||||||
|
if (itrNY == rParameters.end())
|
||||||
|
throw css::uno::RuntimeException("missing parameter Y");
|
||||||
|
|
||||||
|
long nX = itrNX->second.toInt32();
|
||||||
|
long nY = itrNY->second.toInt32();
|
||||||
|
Point aPos(nX, nY);
|
||||||
|
|
||||||
|
auto itrFracX = rParameters.find("FRAC_X");
|
||||||
|
if (itrFracX == rParameters.end())
|
||||||
|
throw css::uno::RuntimeException("missing parameter FRAC_X");
|
||||||
|
double nFracX = itrFracX->second.toDouble();
|
||||||
|
Fraction aFracX(nFracX);
|
||||||
|
|
||||||
|
auto itrFracY = rParameters.find("FRAC_Y");
|
||||||
|
if (itrFracY == rParameters.end())
|
||||||
|
throw css::uno::RuntimeException("missing parameter FRAC_Y");
|
||||||
|
double nFracY = itrFracY->second.toDouble();
|
||||||
|
Fraction aFracY(nFracY);
|
||||||
|
|
||||||
pObj->Crop(aPos, aFracX, aFracY);
|
pObj->Crop(aPos, aFracX, aFracY);
|
||||||
}
|
}
|
||||||
else if (rAction == "Rotate")
|
else if (rAction == "ROTATE")
|
||||||
{
|
{
|
||||||
Point aPos;
|
auto itrNX = rParameters.find("X");
|
||||||
double nAngle = 0;
|
if (itrNX == rParameters.end())
|
||||||
|
throw css::uno::RuntimeException("missing parameter X");
|
||||||
|
|
||||||
|
auto itrNY = rParameters.find("Y");
|
||||||
|
if (itrNY == rParameters.end())
|
||||||
|
throw css::uno::RuntimeException("missing parameter Y");
|
||||||
|
|
||||||
|
long nX = itrNX->second.toInt32();
|
||||||
|
long nY = itrNY->second.toInt32();
|
||||||
|
Point aPos(nX, nY);
|
||||||
|
|
||||||
|
auto itrAngle = rParameters.find("ANGLE");
|
||||||
|
if (itrAngle == rParameters.end())
|
||||||
|
throw css::uno::RuntimeException("missing parameter ANGLE");
|
||||||
|
|
||||||
|
double nAngle = itrAngle->second.toDouble();
|
||||||
pObj->Rotate(aPos, nAngle, 0, 0);
|
pObj->Rotate(aPos, nAngle, 0, 0);
|
||||||
}
|
}
|
||||||
else if (rAction == "Mirror")
|
else if (rAction == "Mirror")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user