summaryrefslogtreecommitdiffstats
path: root/kit
diff options
context:
space:
mode:
authorAshod Nakashian <ashod.nakashian@collabora.co.uk>2021-02-10 22:05:01 -0500
committerAshod Nakashian <Ashod@users.noreply.github.com>2021-02-13 13:25:48 -0500
commit6d11e400a732ffa963c9ade67e271e4792c99225 (patch)
treedad336858dfdb1fd07604032be597daa34356ca3 /kit
parentwsd: encapsulate common request members (diff)
downloadonline-6d11e400a732ffa963c9ade67e271e4792c99225.tar.gz
online-6d11e400a732ffa963c9ade67e271e4792c99225.zip
wsd: userName is optional
This resolves a dependency on userName (a.k.a. UserFriendlyName) that was a source of issues when missing. It turns out that when it's missing but spellOnline is set, an edge-case caused an exception that failed loading. The spellOnline value, in its turn, was incorrectly set to "null" when in fact it was missing. This resulted in online spell-checking being active by default. Perhaps this was intentional, but here we don't change this behavior at all. Instead, we avoid sending "null" when it's missing, and by default we always enable online spell-checking, unless it is explicitly set to "false". This way, the exception is not thrown and spellOnline doesn't have invalid values, while preserving the current behavior. Change-Id: I4a09ac44ff5d6147c715afa0fb34af9650da4afd Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
Diffstat (limited to 'kit')
-rw-r--r--kit/Kit.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/kit/Kit.cpp b/kit/Kit.cpp
index 531ee1a31d..5390291156 100644
--- a/kit/Kit.cpp
+++ b/kit/Kit.cpp
@@ -1419,7 +1419,7 @@ private:
Poco::Dynamic::Var var = parser.parse(renderOpts);
renderOptsObj = var.extract<Object::Ptr>();
}
- else if (!userName.empty())
+ else
{
renderOptsObj = new Object();
}
@@ -1431,11 +1431,9 @@ private:
renderOptsObj->set(".uno:Author", makePropertyValue("string", userName));
}
- if (!spellOnline.empty())
- {
- bool bSet = (spellOnline != "false");
- renderOptsObj->set(".uno:SpellOnline", makePropertyValue("boolean", bSet));
- }
+ // By default we enable spell-checking, unless it's disabled explicitly.
+ const bool bSet = (spellOnline != "false");
+ renderOptsObj->set(".uno:SpellOnline", makePropertyValue("boolean", bSet));
if (renderOptsObj)
{