[Libreoffice-commits] online.git: kit/Kit.cpp kit/Kit.hpp

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Oct 31 08:02:34 UTC 2018


 kit/Kit.cpp |    8 ++++----
 kit/Kit.hpp |   22 ++++++++++++++++++++--
 2 files changed, 24 insertions(+), 6 deletions(-)

New commits:
commit 4c423fad84c1ee9d4e1a3eba4a75888e8863a9bc
Author:     Miklos Vajna <vmiklos at collabora.co.uk>
AuthorDate: Wed Oct 31 09:02:08 2018 +0100
Commit:     Miklos Vajna <vmiklos at collabora.co.uk>
CommitDate: Wed Oct 31 09:02:15 2018 +0100

    CallbackDescriptor: make members private

diff --git a/kit/Kit.cpp b/kit/Kit.cpp
index d063e0bb6..b731d0eb9 100644
--- a/kit/Kit.cpp
+++ b/kit/Kit.cpp
@@ -1219,13 +1219,13 @@ public:
 
         CallbackDescriptor* descriptor = static_cast<CallbackDescriptor*>(data);
         assert(descriptor && "Null callback data.");
-        assert(descriptor->Doc && "Null Document instance.");
+        assert(descriptor->getDoc() && "Null Document instance.");
 
-        std::shared_ptr<TileQueue> tileQueue = descriptor->Doc->getTileQueue();
+        std::shared_ptr<TileQueue> tileQueue = descriptor->getDoc()->getTileQueue();
         assert(tileQueue && "Null TileQueue.");
 
         const std::string payload = p ? p : "(nil)";
-        LOG_TRC("Document::ViewCallback [" << descriptor->ViewId <<
+        LOG_TRC("Document::ViewCallback [" << descriptor->getViewId() <<
                 "] [" << LOKitHelper::kitCallbackTypeToString(type) <<
                 "] [" << payload << "].");
 
@@ -1301,7 +1301,7 @@ public:
             tileQueue->put("callback except-" + targetViewId + ' ' + std::to_string(type) + ' ' + payload);
         }
         else
-            tileQueue->put("callback " + std::to_string(descriptor->ViewId) + ' ' + std::to_string(type) + ' ' + payload);
+            tileQueue->put("callback " + std::to_string(descriptor->getViewId()) + ' ' + std::to_string(type) + ' ' + payload);
     }
 
 private:
diff --git a/kit/Kit.hpp b/kit/Kit.hpp
index cf7d34d46..efd768f14 100644
--- a/kit/Kit.hpp
+++ b/kit/Kit.hpp
@@ -49,8 +49,26 @@ class DocumentManagerInterface;
 /// callback to a specific view.
 struct CallbackDescriptor
 {
-    DocumentManagerInterface* const Doc;
-    const int ViewId;
+    CallbackDescriptor(DocumentManagerInterface* const doc,
+                       const int viewId) :
+        _doc(doc),
+        _viewId(viewId)
+    {
+    }
+
+    DocumentManagerInterface* getDoc() const
+    {
+        return _doc;
+    }
+
+    int getViewId() const
+    {
+        return _viewId;
+    }
+
+private:
+    DocumentManagerInterface* const _doc;
+    const int _viewId;
 };
 
 /// User Info container used to store user information


More information about the Libreoffice-commits mailing list