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: I9ba97daca7013bf26b25fff785f175e3fb213dfb
pull/8522/head
Gökay Şatır 2024-03-08 13:53:06 +03:00 committed by Gökay ŞATIR
parent ea7c9c9fe6
commit 27670275ab
3 changed files with 15 additions and 0 deletions

View File

@ -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);

View File

@ -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,

View File

@ -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;