wsd: avoid single-character strings
Change-Id: I709e8e797bc5e68984823d8c46c590e109d23f18 Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>pull/950/head
parent
a26d587760
commit
583c627a66
|
@ -201,7 +201,7 @@ namespace FileUtil
|
|||
std::string newTmp = root + "/lool-" + Util::rng::getFilename(16);
|
||||
if (::mkdir(newTmp.c_str(), S_IRWXU) < 0)
|
||||
{
|
||||
LOG_SYS("Failed to create random temp directory [" << newTmp << "]");
|
||||
LOG_SYS("Failed to create random temp directory [" << newTmp << ']');
|
||||
return root;
|
||||
}
|
||||
return newTmp;
|
||||
|
@ -295,7 +295,7 @@ namespace FileUtil
|
|||
return real;
|
||||
}
|
||||
|
||||
LOG_SYS("Failed to get the realpath of [" << path << "]");
|
||||
LOG_SYS("Failed to get the realpath of [" << path << ']');
|
||||
return path;
|
||||
}
|
||||
|
||||
|
@ -344,7 +344,7 @@ namespace FileUtil
|
|||
};
|
||||
if (utimes(filename.c_str(), timestamps) != 0)
|
||||
{
|
||||
LOG_SYS("Failed to update the timestamp of [" << filename << "]");
|
||||
LOG_SYS("Failed to update the timestamp of [" << filename << ']');
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -82,7 +82,7 @@ T getJSONValue(const Poco::JSON::Object::Ptr &object, const std::string& key)
|
|||
catch (const Poco::Exception& exc)
|
||||
{
|
||||
LOG_ERR("getJSONValue for [" << key << "]: " << exc.displayText() <<
|
||||
(exc.nested() ? " (" + exc.nested()->displayText() + ")" : ""));
|
||||
(exc.nested() ? " (" + exc.nested()->displayText() + ')' : ""));
|
||||
}
|
||||
|
||||
return T();
|
||||
|
|
|
@ -139,7 +139,7 @@ public:
|
|||
catch (const Poco::Exception& exc)
|
||||
{
|
||||
LOG_WRN("LOOLWebSocket::shutdown: Exception: " << exc.displayText() <<
|
||||
(exc.nested() ? " (" + exc.nested()->displayText() + ")" : ""));
|
||||
(exc.nested() ? " (" + exc.nested()->displayText() + ')' : ""));
|
||||
|
||||
// Just close it.
|
||||
try
|
||||
|
|
|
@ -517,14 +517,14 @@ bool ChildSession::uploadSignedDocument(const char* buffer, int length, const St
|
|||
}
|
||||
const std::string tmpDir = FileUtil::createRandomDir(JAILED_DOCUMENT_ROOT);
|
||||
const Poco::Path filenameParam(filename);
|
||||
const std::string url = JAILED_DOCUMENT_ROOT + tmpDir + "/" + filenameParam.getFileName();
|
||||
const std::string url = JAILED_DOCUMENT_ROOT + tmpDir + '/' + filenameParam.getFileName();
|
||||
|
||||
getLOKitDocument()->saveAs(url.c_str(),
|
||||
filetype.empty() ? nullptr : filetype.c_str(),
|
||||
nullptr);
|
||||
|
||||
Authorization authorization(Authorization::Type::Token, token);
|
||||
Poco::URI uriObject(wopiUrl + "/" + filename + "/contents");
|
||||
Poco::URI uriObject(wopiUrl + '/' + filename + "/contents");
|
||||
|
||||
authorization.authorizeURI(uriObject);
|
||||
|
||||
|
@ -962,9 +962,9 @@ bool ChildSession::downloadAs(const char* /*buffer*/, int /*length*/, const Stri
|
|||
|
||||
// The file is removed upon downloading.
|
||||
const std::string tmpDir = FileUtil::createRandomDir(jailDoc);
|
||||
const std::string urlToSend = tmpDir + "/" + filenameParam.getFileName();
|
||||
const std::string urlToSend = tmpDir + '/' + filenameParam.getFileName();
|
||||
const std::string url = jailDoc + urlToSend;
|
||||
const std::string urlAnonym = jailDoc + tmpDir + "/" + Poco::Path(nameAnonym).getFileName();
|
||||
const std::string urlAnonym = jailDoc + tmpDir + '/' + Poco::Path(nameAnonym).getFileName();
|
||||
|
||||
LOG_DBG("Calling LOK's saveAs with: url='" << urlAnonym << "', format='" <<
|
||||
(format.empty() ? "(nullptr)" : format.c_str()) << "', ' filterOptions=" <<
|
||||
|
@ -1653,7 +1653,7 @@ bool ChildSession::renderWindow(const char* /*buffer*/, int /*length*/, const St
|
|||
const auto elapsedMs = std::chrono::duration_cast<std::chrono::milliseconds>(
|
||||
std::chrono::steady_clock::now() - start);
|
||||
const double elapsedMics = elapsedMs.count() * 1000.; // Need MPixels/second, use Pixels/mics.
|
||||
LOG_TRC("paintWindow for " << winId << " returned " << width << "X" << height << "@(" << startX
|
||||
LOG_TRC("paintWindow for " << winId << " returned " << width << 'X' << height << "@(" << startX
|
||||
<< ',' << startY << ',' << " with dpi scale: " << dpiScale
|
||||
<< " and rendered in " << elapsedMs << " (" << area / elapsedMics
|
||||
<< " MP/s).");
|
||||
|
@ -1882,7 +1882,8 @@ bool ChildSession::exportSignAndUploadDocument(const char* buffer, int length, c
|
|||
// export document to a temp file
|
||||
const std::string aTempDir = FileUtil::createRandomDir(JAILED_DOCUMENT_ROOT);
|
||||
const Poco::Path filenameParam(filename);
|
||||
const std::string aTempDocumentURL = JAILED_DOCUMENT_ROOT + aTempDir + "/" + filenameParam.getFileName();
|
||||
const std::string aTempDocumentURL
|
||||
= JAILED_DOCUMENT_ROOT + aTempDir + '/' + filenameParam.getFileName();
|
||||
|
||||
getLOKitDocument()->saveAs(aTempDocumentURL.c_str(), filetype.c_str(), nullptr);
|
||||
|
||||
|
@ -1904,7 +1905,7 @@ bool ChildSession::exportSignAndUploadDocument(const char* buffer, int length, c
|
|||
|
||||
// upload
|
||||
Authorization authorization(Authorization::Type::Token, token);
|
||||
Poco::URI uriObject(wopiUrl + "/" + filename + "/contents");
|
||||
Poco::URI uriObject(wopiUrl + '/' + filename + "/contents");
|
||||
|
||||
authorization.authorizeURI(uriObject);
|
||||
|
||||
|
@ -2082,7 +2083,7 @@ bool ChildSession::saveAs(const char* /*buffer*/, int /*length*/, const StringVe
|
|||
|
||||
const std::string tmpDir = FileUtil::createRandomDir(jailDoc);
|
||||
const Poco::Path filenameParam(pathSegments[pathSegments.size() - 1]);
|
||||
url = std::string("file://") + jailDoc + tmpDir + "/" + filenameParam.getFileName();
|
||||
url = std::string("file://") + jailDoc + tmpDir + '/' + filenameParam.getFileName();
|
||||
wopiFilename = wopiURL.getPath();
|
||||
}
|
||||
|
||||
|
|
|
@ -62,7 +62,7 @@ protected:
|
|||
|
||||
for (const auto& pair : Headers)
|
||||
{
|
||||
LOK_ASSERT_MESSAGE("Request must have [" + pair.first + "]", request.has(pair.first));
|
||||
LOK_ASSERT_MESSAGE("Request must have [" + pair.first + ']', request.has(pair.first));
|
||||
LOK_ASSERT_EQUAL(pair.second, request[pair.first]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -381,7 +381,7 @@ int Config::main(const std::vector<std::string>& args)
|
|||
|
||||
for (std::size_t i = 1; i < args.size(); ++i)
|
||||
{
|
||||
std::cout << "[" << args[i] << "]: " << Util::anonymizeUrl(args[i], AnonymizationSalt) << std::endl;
|
||||
std::cout << '[' << args[i] << "]: " << Util::anonymizeUrl(args[i], AnonymizationSalt) << std::endl;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
@ -133,7 +133,7 @@ std::string FileServerRequestHandler::cssVarsToStyle(const std::string& cssVars)
|
|||
LOG_WRN("Skipping the token [" << tokens.getParam(token) << "] since it has more than one '=' pair");
|
||||
continue;
|
||||
}
|
||||
styleOSS << keyValue[0] << ":" << keyValue[1] << ";";
|
||||
styleOSS << keyValue[0] << ':' << keyValue[1] << ';';
|
||||
}
|
||||
styleOSS << "}</style>";
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ template <typename T> bool equal(const T& lhs, const T& rhs)
|
|||
|
||||
if (subLeft != subRight)
|
||||
{
|
||||
LOG_ERR("!!! Data mismatch: [" << subLeft << "] != [" << subRight << "]");
|
||||
LOG_ERR("!!! Data mismatch: [" << subLeft << "] != [" << subRight << ']');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -213,7 +213,7 @@ public:
|
|||
oss << ", host: " << _hostUntrusted;
|
||||
oss << ", path: " << _pathSegs.size();
|
||||
for (std::size_t i = 0; i < _pathSegs.size(); ++i)
|
||||
oss << "\n[" << i << "] '" << _pathSegs[i] << "'";
|
||||
oss << "\n[" << i << "] '" << _pathSegs[i] << '\'';
|
||||
oss << "\nfull URI: " << _uriString;
|
||||
return oss.str();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue