[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - include/basegfx

Tomaž Vajngerl (via logerrit) logerrit at kemper.freedesktop.org
Wed Apr 1 14:19:39 UTC 2020


 include/basegfx/matrix/Matrix.hxx |   45 +++++++++++++++++++++++++++++++++++++-
 1 file changed, 44 insertions(+), 1 deletion(-)

New commits:
commit 28419b6655c3ab4a11de8cbad4001a26dd3b8dc7
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Sat Mar 28 20:11:48 2020 +0100
Commit:     Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Wed Apr 1 16:19:08 2020 +0200

    add convenience accessors to Matrix.hxx
    
    Change-Id: Ifaaff3b1526aed111725a46c6cc64c189909a904
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91309
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>
    (cherry picked from commit b53a9c552a30a3aaa2b26ef8b1a3e8cf0f011a5c)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91449
    Tested-by: Tomaž Vajngerl <quikee at gmail.com>

diff --git a/include/basegfx/matrix/Matrix.hxx b/include/basegfx/matrix/Matrix.hxx
index b742d8cdf293..9224e2784b60 100644
--- a/include/basegfx/matrix/Matrix.hxx
+++ b/include/basegfx/matrix/Matrix.hxx
@@ -53,6 +53,29 @@ public:
         return *this;
     }
 
+    double get(sal_uInt16 nRow, sal_uInt16 nColumn) const
+    {
+        if (nRow == 0)
+        {
+            if (nColumn == 0)
+                return v00;
+            else if (nColumn == 1)
+                return v01;
+            else if (nColumn == 2)
+                return v02;
+        }
+        else if (nRow == 1)
+        {
+            if (nColumn == 0)
+                return v10;
+            else if (nColumn == 1)
+                return v11;
+            else if (nColumn == 2)
+                return v12;
+        }
+        return 0.0;
+    }
+
     double a() const { return ma; }
     double b() const { return mb; }
     double c() const { return mc; }
@@ -120,7 +143,27 @@ public:
     }
 
 private:
-    double ma, mb, mc, md, me, mf;
+    union {
+        struct
+        {
+            double ma;
+            double mb;
+            double mc;
+            double md;
+            double me;
+            double mf;
+        };
+
+        struct
+        {
+            double v00;
+            double v10;
+            double v01;
+            double v11;
+            double v02;
+            double v12;
+        };
+    };
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list