[Libreoffice-commits] online.git: common/MessageQueue.cpp common/MessageQueue.hpp

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Nov 15 08:07:57 UTC 2018


 common/MessageQueue.cpp |    3 ++-
 common/MessageQueue.hpp |   29 +++++++++++++++++++++++------
 2 files changed, 25 insertions(+), 7 deletions(-)

New commits:
commit 0122ba2a6a352bf621066f9551ba9e3251fb556f
Author:     Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Thu Nov 15 09:07:27 2018 +0100
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Thu Nov 15 09:07:38 2018 +0100

    CursorPosition: make members private

diff --git a/common/MessageQueue.cpp b/common/MessageQueue.cpp
index 85f342bf0..a86bc7d59 100644
--- a/common/MessageQueue.cpp
+++ b/common/MessageQueue.cpp
@@ -402,7 +402,8 @@ int TileQueue::priority(const std::string& tileMsg)
     for (int i = static_cast<int>(_viewOrder.size()) - 1; i >= 0; --i)
     {
         auto& cursor = _cursorPositions[_viewOrder[i]];
-        if (tile.intersectsWithRect(cursor.X, cursor.Y, cursor.Width, cursor.Height))
+        if (tile.intersectsWithRect(cursor.getX(), cursor.getY(), cursor.getWidth(),
+                                    cursor.getHeight()))
             return i;
     }
 
diff --git a/common/MessageQueue.hpp b/common/MessageQueue.hpp
index 761e64bc3..16711adbd 100644
--- a/common/MessageQueue.hpp
+++ b/common/MessageQueue.hpp
@@ -139,17 +139,34 @@ private:
     class CursorPosition
     {
     public:
-        int Part;
-        int X;
-        int Y;
-        int Width;
-        int Height;
+        CursorPosition() {}
+        CursorPosition(int part, int x, int y, int width, int height)
+            : _part(part)
+            , _x(x)
+            , _y(y)
+            , _width(width)
+            , _height(height)
+        {
+        }
+
+        int getPart() const { return _part; }
+        int getX() const { return _x; }
+        int getY() const { return _y; }
+        int getWidth() const { return _width; }
+        int getHeight() const { return _height; }
+
+    private:
+        int _part = 0;
+        int _x = 0;
+        int _y = 0;
+        int _width = 0;
+        int _height = 0;
     };
 
 public:
     void updateCursorPosition(int viewId, int part, int x, int y, int width, int height)
     {
-        const TileQueue::CursorPosition cursorPosition = CursorPosition({ part, x, y, width, height });
+        const TileQueue::CursorPosition cursorPosition = CursorPosition(part, x, y, width, height);
 
         std::unique_lock<std::mutex> lock = getLock();
 


More information about the Libreoffice-commits mailing list