wsd: remove unused (Is)ViewWithCommentsFileExtension(s)

Change-Id: I25158862746ce6a3e4ee16ff9d661ec96810ce24
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
Ashod Nakashian 2024-05-07 06:23:07 -04:00
parent 55526f42f2
commit 439f658800
3 changed files with 3 additions and 21 deletions

View File

@ -235,7 +235,6 @@ static std::chrono::milliseconds careerSpanMs(std::chrono::milliseconds::zero())
int ChildSpawnTimeoutMs = CHILD_TIMEOUT_MS * 4;
std::atomic<unsigned> COOLWSD::NumConnections;
std::unordered_set<std::string> COOLWSD::EditFileExtensions;
std::unordered_set<std::string> COOLWSD::ViewWithCommentsFileExtensions;
#if MOBILEAPP

View File

@ -317,7 +317,6 @@ public:
#endif
static std::unordered_set<std::string> EditFileExtensions;
static std::unordered_set<std::string> ViewWithCommentsFileExtensions;
static unsigned MaxConnections;
static unsigned MaxDocuments;
static std::string OverrideWatermark;
@ -384,22 +383,6 @@ public:
return EditFileExtensions.find(lowerCaseExtension) == EditFileExtensions.end();
}
/// Return true if extension is marked as view_comment action in discovery.xml.
static bool IsViewWithCommentsFileExtension(const std::string& extension)
{
std::string lowerCaseExtension = extension;
std::transform(lowerCaseExtension.begin(), lowerCaseExtension.end(), lowerCaseExtension.begin(), ::tolower);
if (Util::isMobileApp())
{
if (lowerCaseExtension == "pdf")
return true; // true for only pdf - it is not editable
return false; // mark everything else editable on mobile
}
return ViewWithCommentsFileExtensions.find(lowerCaseExtension) !=
ViewWithCommentsFileExtensions.end();
}
/// Returns the value of the specified application configuration,
/// or the default, if one doesn't exist.
template<typename T>

View File

@ -1904,9 +1904,9 @@ std::string ClientRequestDispatcher::getDiscoveryXML()
}
else if (elem->getAttribute("name") == "view_comment")
{
const std::string ext = elem->getAttribute("ext");
if (COOLWSD::ViewWithCommentsFileExtensions.insert(ext).second) // Skip duplicates.
LOG_DBG_S("Enabling commenting on [" << ext << "] extension files");
// We don't seem to treat this list differently.
// The assumption seems to be that if a file is not editable,
// then it's view-only. And if it's view-only, it supports comments.
}
}