summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-10-01 00:40:45 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-10-01 22:17:16 +0000
commitec3aabe66bde2c8bdea2c3692ac1c4981c8910a3 (patch)
tree3584458d06262670d9482faeffdd69e6902c35ee /svx
parent86617760eb8bc6c0b2713b9496ade9203d1077a5 (diff)
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>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/uitest/sdrobject.cxx48
1 files changed, 42 insertions, 6 deletions
diff --git a/svx/source/uitest/sdrobject.cxx b/svx/source/uitest/sdrobject.cxx
index eaf56ba8012d..bd31316a498f 100644
--- a/svx/source/uitest/sdrobject.cxx
+++ b/svx/source/uitest/sdrobject.cxx
@@ -100,15 +100,51 @@ void SdrUIObject::execute(const OUString& rAction,
}
else if (rAction == "CROP")
{
- Point aPos;
- Fraction aFracX;
- Fraction aFracY;
+ auto itrNX = rParameters.find("X");
+ 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 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);
}
- else if (rAction == "Rotate")
+ else if (rAction == "ROTATE")
{
- Point aPos;
- double nAngle = 0;
+ auto itrNX = rParameters.find("X");
+ 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);
}
else if (rAction == "Mirror")