diff options
Diffstat (limited to 'comphelper/source/misc/lok.cxx')
-rw-r--r-- | comphelper/source/misc/lok.cxx | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/comphelper/source/misc/lok.cxx b/comphelper/source/misc/lok.cxx index 208fe7bb25df..1ef1ae5766b3 100644 --- a/comphelper/source/misc/lok.cxx +++ b/comphelper/source/misc/lok.cxx @@ -10,6 +10,7 @@ #include <comphelper/lok.hxx> #include <i18nlangtag/languagetag.hxx> #include <sal/log.hxx> +#include <algorithm> #include <iostream> #include <map> @@ -38,6 +39,8 @@ static bool g_bLocalRendering(false); static Compat g_eCompatFlags(Compat::none); +static std::vector<OUString> g_vFreemiumDenyList; + namespace { @@ -288,6 +291,31 @@ void statusIndicatorFinish() pStatusIndicatorCallback(pStatusIndicatorCallbackData, statusIndicatorCallbackType::Finish, 0); } +void setFreemiumDenyList(const char* freemiumDenyList) +{ + if(!g_vFreemiumDenyList.empty()) + return; + + OUString DenyListString(freemiumDenyList, strlen(freemiumDenyList), RTL_TEXTENCODING_UTF8); + + OUString command = DenyListString.getToken(0, ' '); + for (size_t i = 1; !command.isEmpty(); i++) + { + g_vFreemiumDenyList.emplace_back(command); + command = DenyListString.getToken(i, ' '); + } +} + +const std::vector<OUString>& getFreemiumDenyList() +{ + return g_vFreemiumDenyList; +} + +bool isCommandFreemiumDenied(const OUString& command) +{ + return std::find(g_vFreemiumDenyList.begin(), g_vFreemiumDenyList.end(), command) != g_vFreemiumDenyList.end(); +} + } // namespace LibreOfficeKit } // namespace comphelper |