[Libreoffice-commits] online.git: loolwsd/ChildSession.cpp loolwsd/ChildSession.hpp
Ashod Nakashian
ashod.nakashian at collabora.co.uk
Mon Aug 22 05:50:07 UTC 2016
loolwsd/ChildSession.cpp | 5 +++--
loolwsd/ChildSession.hpp | 14 +++++++++-----
2 files changed, 12 insertions(+), 7 deletions(-)
New commits:
commit 0d395f18b57a2f4ec9f056d80b09ddfbdf5b7fc3
Author: Ashod Nakashian <ashod.nakashian at 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 <ashnakash at gmail.com>
Tested-by: Ashod Nakashian <ashnakash at 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;
};
More information about the Libreoffice-commits
mailing list