[Libreoffice-commits] online.git: loolwsd/Storage.cpp
Pranav Kant
pranavk at collabora.co.uk
Thu Nov 10 17:38:09 UTC 2016
loolwsd/Storage.cpp | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
New commits:
commit dacf16f2d85d2fb5a4de8da52ce64b6409a7dbcd
Author: Pranav Kant <pranavk at collabora.co.uk>
Date: Thu Nov 10 23:06:15 2016 +0530
tdf#103671: 'true' -> true
Treat booleans as booleans, not string
Change-Id: Id0d3bee44b42461671379754e64e5e2f9b318045
diff --git a/loolwsd/Storage.cpp b/loolwsd/Storage.cpp
index dcaa0a7..c58b1bf 100644
--- a/loolwsd/Storage.cpp
+++ b/loolwsd/Storage.cpp
@@ -346,17 +346,17 @@ WopiStorage::WOPIFileInfo WopiStorage::getWOPIFileInfo(const Poco::URI& uriPubli
const auto userNameVar = getOrWarn(object,"UserFriendlyName");
userName = (userNameVar.isString() ? userNameVar.toString() : "anonymous");
const auto canWriteVar = getOrWarn(object, "UserCanWrite");
- canWrite = canWriteVar.isString() ? (canWriteVar.toString() == "true") : false;
+ canWrite = canWriteVar.isBoolean() ? canWriteVar.convert<bool>() : false;
const auto postMessageOriginVar = getOrWarn(object, "PostMessageOrigin");
postMessageOrigin = postMessageOriginVar.isString() ? postMessageOriginVar.toString() : "";
const auto hidePrintOptionVar = getOrWarn(object, "HidePrintOption");
- hidePrintOption = hidePrintOptionVar.isString() ? (hidePrintOptionVar.toString() == "true") : false;
+ hidePrintOption = hidePrintOptionVar.isBoolean() ? hidePrintOptionVar.convert<bool>() : false;
const auto hideSaveOptionVar = getOrWarn(object, "HideSaveOption");
- hideSaveOption = hideSaveOptionVar.isString() ? (hideSaveOptionVar.toString() == "true") : false;
+ hideSaveOption = hideSaveOptionVar.isBoolean() ? hideSaveOptionVar.convert<bool>() : false;
const auto hideExportOptionVar = getOrWarn(object, "HideExportOption");
- hideExportOption = hideExportOptionVar.isString() ? (hideExportOptionVar.toString() == "true") : false;
+ hideExportOption = hideExportOptionVar.isBoolean() ? hideExportOptionVar.convert<bool>() : false;
const auto enableOwnerTerminationVar = getOrWarn(object, "EnableOwnerTermination");
- enableOwnerTermination = enableOwnerTerminationVar.isString() ? (enableOwnerTerminationVar.toString() == "true") : false;
+ enableOwnerTermination = enableOwnerTerminationVar.isBoolean() ? enableOwnerTerminationVar.convert<bool>() : false;
}
else
Log::error("WOPI::CheckFileInfo is missing JSON payload");
More information about the Libreoffice-commits
mailing list