Send isAllowChangeComments flag to ChildSession.
We also set the variable on the core side in order to allow saving edited documents. Signed-off-by: Gökay Şatır <gokaysatir@gmail.com> Change-Id: I9ba97daca7013bf26b25fff785f175e3fb213dfbpull/8522/head
parent
ea7c9c9fe6
commit
27670275ab
|
@ -235,6 +235,10 @@ void Session::parseDocOptions(const StringVector& tokens, int& part, std::string
|
|||
_accessibilityState = value == "true";
|
||||
++offset;
|
||||
}
|
||||
else if (name == "isAllowChangeComments")
|
||||
{
|
||||
_isAllowChangeComments = value == "true";
|
||||
}
|
||||
}
|
||||
|
||||
Util::mapAnonymized(_userId, _userIdAnonym);
|
||||
|
|
|
@ -1687,7 +1687,13 @@ std::shared_ptr<lok::Document> Document::load(const std::shared_ptr<ChildSession
|
|||
_loKitDocument->setViewTimezone(viewId, userTimezone.c_str());
|
||||
_loKitDocument->setAccessibilityState(viewId, accessibilityState);
|
||||
if (session->isReadOnly())
|
||||
{
|
||||
_loKitDocument->setViewReadOnly(viewId, true);
|
||||
if (session->isAllowChangeComments())
|
||||
{
|
||||
_loKitDocument->setAllowChangeComments(viewId, true);
|
||||
}
|
||||
}
|
||||
|
||||
// viewId's monotonically increase, and CallbackDescriptors are never freed.
|
||||
_viewIdToCallbackDescr.emplace(viewId,
|
||||
|
|
|
@ -1217,6 +1217,11 @@ bool ClientSession::loadDocument(const char* /*buffer*/, int /*length*/,
|
|||
|
||||
oss << " readonly=" << isReadOnly();
|
||||
|
||||
if (isAllowChangeComments())
|
||||
{
|
||||
oss << " isAllowChangeComments=true";
|
||||
}
|
||||
|
||||
if (loadPart >= 0)
|
||||
{
|
||||
oss << " part=" << loadPart;
|
||||
|
|
Loading…
Reference in New Issue