[Libreoffice-commits] core.git: svx/source

Markus Mohrhard markus.mohrhard at googlemail.com
Sat Oct 1 22:19:34 UTC 2016


 svx/source/uitest/sdrobject.cxx |   48 +++++++++++++++++++++++++++++++++++-----
 1 file changed, 42 insertions(+), 6 deletions(-)

New commits:
commit ec3aabe66bde2c8bdea2c3692ac1c4981c8910a3
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sat Oct 1 00:40:45 2016 +0200

    support crop and rotating for drawinglayer object in UI testing
    
    Change-Id: I57a9a43dc5289a9a987e4bf54a3c8d8d40824e67
    Reviewed-on: https://gerrit.libreoffice.org/29421
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>

diff --git a/svx/source/uitest/sdrobject.cxx b/svx/source/uitest/sdrobject.cxx
index eaf56ba..bd31316 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")


More information about the Libreoffice-commits mailing list