loolwsd/ChildSession.cpp |    5 +++--
 loolwsd/ChildSession.hpp |   14 +++++++++-----
 2 files changed, 12 insertions(+), 7 deletions(-)

New commits:
commit 0d395f18b57a2f4ec9f056d80b09ddfbdf5b7fc3
Author: Ashod Nakashian <ashod.nakash...@collabora.co.uk>
Date:   Sun Aug 21 12:56:58 2016 -0400

    loolwsd: cleanup of ChildSession
    
    Change-Id: I63bd6ff24a54b0ba3e0361ea385bf866f98faf76
    Reviewed-on: https://gerrit.libreoffice.org/28306
    Reviewed-by: Ashod Nakashian <ashnak...@gmail.com>
    Tested-by: Ashod Nakashian <ashnak...@gmail.com>

diff --git a/loolwsd/ChildSession.cpp b/loolwsd/ChildSession.cpp
index ebcc5f7..a0bb227 100644
--- a/loolwsd/ChildSession.cpp
+++ b/loolwsd/ChildSession.cpp
@@ -39,8 +39,9 @@ ChildSession::ChildSession(const std::string& id,
     LOOLSession(id, Kind::ToMaster, ws),
     _multiView(std::getenv("LOK_VIEW_CALLBACK")),
     _jailId(jailId),
+    _docManager(docManager),
     _viewId(-1),
-    _docManager(docManager)
+    _isDocLoaded(false)
 {
     Log::info("ChildSession ctor [" + getName() + "].");
 }
@@ -935,7 +936,7 @@ void ChildSession::loKitCallback(const int nType, const 
std::string& rPayload)
     {
     case LOK_CALLBACK_INVALIDATE_TILES:
         {
-            const auto curPart = getPart();
+            const auto curPart = _loKitDocument->getPart();
 
             StringTokenizer tokens(rPayload, " ", 
StringTokenizer::TOK_IGNORE_EMPTY | StringTokenizer::TOK_TRIM);
             if (tokens.count() == 4)
diff --git a/loolwsd/ChildSession.hpp b/loolwsd/ChildSession.hpp
index 1f6d2eb..ddb804f 100644
--- a/loolwsd/ChildSession.hpp
+++ b/loolwsd/ChildSession.hpp
@@ -65,7 +65,6 @@ public:
     bool getStatus(const char *buffer, int length);
     bool getPartPageRectangles(const char *buffer, int length);
     unsigned getViewId() const { return _viewId; }
-    int getPart() const { return _loKitDocument->getPart(); }
 
     void loKitCallback(const int nType, const std::string& rPayload);
 
@@ -96,16 +95,21 @@ private:
     virtual bool _handleInput(const char *buffer, int length) override;
 
 private:
-    std::shared_ptr<lok::Document> _loKitDocument;
-    std::string _docType;
     const bool _multiView;
     const std::string _jailId;
+    IDocumentManager& _docManager;
+
     /// View ID, returned by createView() or 0 by default.
     int _viewId;
+
+    /// Whether document has been opened succesfuly
+    bool _isDocLoaded;
+
+    std::shared_ptr<lok::Document> _loKitDocument;
+    std::string _docType;
     std::map<int, std::string> _lastDocStates;
-    IDocumentManager& _docManager;
 
-    /// Synchronize _loKitDocument acess.
+    /// Synchronize _loKitDocument access.
     /// This should be owned by Document.
     static std::recursive_mutex Mutex;
 };
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to