[Libreoffice-commits] online.git: loolwsd/DocumentBroker.cpp loolwsd/MasterProcessSession.cpp loolwsd/MasterProcessSession.hpp
Pranav Kant
pranavk at collabora.com
Mon May 9 16:33:30 UTC 2016
loolwsd/DocumentBroker.cpp | 7 +++++++
loolwsd/MasterProcessSession.cpp | 4 ++++
loolwsd/MasterProcessSession.hpp | 3 +++
3 files changed, 14 insertions(+)
New commits:
commit 5500b090167b46a9b02b465c0cce75abacde37f8
Author: Pranav Kant <pranavk at collabora.com>
Date: Mon May 9 21:50:43 2016 +0530
bccu#1776: Restore input mode if we are in one before saving
Change-Id: I46d57dce69777fdfe6afb95f9534b170972fe390
diff --git a/loolwsd/DocumentBroker.cpp b/loolwsd/DocumentBroker.cpp
index b51f872..7b1af96 100644
--- a/loolwsd/DocumentBroker.cpp
+++ b/loolwsd/DocumentBroker.cpp
@@ -289,6 +289,13 @@ bool DocumentBroker::sendUnoSave()
if (queue)
{
queue->put("uno .uno:Save");
+
+ // Set calc cell mode back to edit mode
+ // if we were in edit before save
+ if (sessionIt.second->isCursorVisible())
+ {
+ queue->put("uno .uno:SetInputMode");
+ }
return true;
}
}
diff --git a/loolwsd/MasterProcessSession.cpp b/loolwsd/MasterProcessSession.cpp
index 6d24b1a..3d5ee3c 100644
--- a/loolwsd/MasterProcessSession.cpp
+++ b/loolwsd/MasterProcessSession.cpp
@@ -175,6 +175,10 @@ bool MasterProcessSession::_handleInput(const char *buffer, int length)
}
}
}
+ else if (tokens.count() == 2 && tokens[0] == "cursorvisible:")
+ {
+ peer->setCursorVisible(tokens[1] == "true");
+ }
}
if (peer && !_isDocPasswordProtected)
diff --git a/loolwsd/MasterProcessSession.hpp b/loolwsd/MasterProcessSession.hpp
index 19a4788..2472eb5 100644
--- a/loolwsd/MasterProcessSession.hpp
+++ b/loolwsd/MasterProcessSession.hpp
@@ -50,6 +50,8 @@ class MasterProcessSession final : public LOOLSession, public std::enable_shared
void setEditLock(const bool value);
void markEditLock(const bool value) { _bEditLock = value; }
bool isEditLocked() const { return _bEditLock; }
+ void setCursorVisible(const bool value) { _isCursorVisible = value; }
+ bool isCursorVisible() { return _isCursorVisible; }
bool shutdownPeer(Poco::UInt16 statusCode, const std::string& message);
@@ -86,6 +88,7 @@ public:
int _curPart;
int _loadPart;
+ bool _isCursorVisible;
/// Kind::ToClient instances store URLs of completed 'save as' documents.
MessageQueue _saveAsQueue;
std::shared_ptr<DocumentBroker> _docBroker;
More information about the Libreoffice-commits
mailing list