[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - comphelper/source desktop/source framework/source include/comphelper
Henry Castro (via logerrit)
logerrit at kemper.freedesktop.org
Thu Jul 15 13:22:39 UTC 2021
comphelper/source/misc/lok.cxx | 12 ++++++------
desktop/source/lib/init.cxx | 4 ++--
framework/source/helper/statusindicator.cxx | 2 +-
include/comphelper/lok.hxx | 5 +++--
4 files changed, 12 insertions(+), 11 deletions(-)
New commits:
commit 04c05b67f0dbc2437901b5a5be7ac4d5efdeeaa4
Author: Henry Castro <hcastro at collabora.com>
AuthorDate: Thu Jul 8 16:21:46 2021 -0400
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Thu Jul 15 15:22:05 2021 +0200
lok: include the label of the status indicator
Change-Id: Ib2714e3d2b6add54ffba753d3519aeba7a3f1959
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118682
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Andras Timar <andras.timar at collabora.com>
diff --git a/comphelper/source/misc/lok.cxx b/comphelper/source/misc/lok.cxx
index 5c922e84e2b1..a7b77ea0a3ae 100644
--- a/comphelper/source/misc/lok.cxx
+++ b/comphelper/source/misc/lok.cxx
@@ -260,31 +260,31 @@ bool isAllowlistedLanguage(const OUString& lang)
#endif
}
-static void (*pStatusIndicatorCallback)(void *data, statusIndicatorCallbackType type, int percent)(nullptr);
+static void (*pStatusIndicatorCallback)(void *data, statusIndicatorCallbackType type, int percent, const char* pText)(nullptr);
static void *pStatusIndicatorCallbackData(nullptr);
-void setStatusIndicatorCallback(void (*callback)(void *data, statusIndicatorCallbackType type, int percent), void *data)
+void setStatusIndicatorCallback(void (*callback)(void *data, statusIndicatorCallbackType type, int percent, const char* pText), void *data)
{
pStatusIndicatorCallback = callback;
pStatusIndicatorCallbackData = data;
}
-void statusIndicatorStart()
+void statusIndicatorStart(const OUString& sText)
{
if (pStatusIndicatorCallback)
- pStatusIndicatorCallback(pStatusIndicatorCallbackData, statusIndicatorCallbackType::Start, 0);
+ pStatusIndicatorCallback(pStatusIndicatorCallbackData, statusIndicatorCallbackType::Start, 0, sText.toUtf8().getStr());
}
void statusIndicatorSetValue(int percent)
{
if (pStatusIndicatorCallback)
- pStatusIndicatorCallback(pStatusIndicatorCallbackData, statusIndicatorCallbackType::SetValue, percent);
+ pStatusIndicatorCallback(pStatusIndicatorCallbackData, statusIndicatorCallbackType::SetValue, percent, nullptr);
}
void statusIndicatorFinish()
{
if (pStatusIndicatorCallback)
- pStatusIndicatorCallback(pStatusIndicatorCallbackData, statusIndicatorCallbackType::Finish, 0);
+ pStatusIndicatorCallback(pStatusIndicatorCallbackData, statusIndicatorCallbackType::Finish, 0, nullptr);
}
void setFreemiumDenyList(const char* freemiumDenyList)
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index eded3bf4a8ed..98adaa61e00d 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -5936,7 +5936,7 @@ static void lo_runLoop(LibreOfficeKit* /*pThis*/,
static bool bInitialized = false;
-static void lo_status_indicator_callback(void *data, comphelper::LibreOfficeKit::statusIndicatorCallbackType type, int percent)
+static void lo_status_indicator_callback(void *data, comphelper::LibreOfficeKit::statusIndicatorCallbackType type, int percent, const char* pText)
{
LibLibreOffice_Impl* pLib = static_cast<LibLibreOffice_Impl*>(data);
@@ -5946,7 +5946,7 @@ static void lo_status_indicator_callback(void *data, comphelper::LibreOfficeKit:
switch (type)
{
case comphelper::LibreOfficeKit::statusIndicatorCallbackType::Start:
- pLib->mpCallback(LOK_CALLBACK_STATUS_INDICATOR_START, nullptr, pLib->mpCallbackData);
+ pLib->mpCallback(LOK_CALLBACK_STATUS_INDICATOR_START, pText, pLib->mpCallbackData);
break;
case comphelper::LibreOfficeKit::statusIndicatorCallbackType::SetValue:
pLib->mpCallback(LOK_CALLBACK_STATUS_INDICATOR_SET_VALUE,
diff --git a/framework/source/helper/statusindicator.cxx b/framework/source/helper/statusindicator.cxx
index 2073b8e68d9d..2deb4a0ae5b2 100644
--- a/framework/source/helper/statusindicator.cxx
+++ b/framework/source/helper/statusindicator.cxx
@@ -38,7 +38,7 @@ void SAL_CALL StatusIndicator::start(const OUString& sText, sal_Int32 nRange)
m_nRange = nRange;
m_nLastCallbackPercent = -1;
- comphelper::LibreOfficeKit::statusIndicatorStart();
+ comphelper::LibreOfficeKit::statusIndicatorStart(sText);
}
#if !defined(IOS) && !defined(ANDROID)
css::uno::Reference<css::task::XStatusIndicatorFactory> xFactory(m_xFactory);
diff --git a/include/comphelper/lok.hxx b/include/comphelper/lok.hxx
index 2d8081da902c..d68fabb2e600 100644
--- a/include/comphelper/lok.hxx
+++ b/include/comphelper/lok.hxx
@@ -34,7 +34,8 @@ enum class statusIndicatorCallbackType
};
COMPHELPER_DLLPUBLIC void setStatusIndicatorCallback(
- void (*callback)(void* data, statusIndicatorCallbackType type, int percent), void* data);
+ void (*callback)(void* data, statusIndicatorCallbackType type, int percent, const char* pText),
+ void* data);
// Functions that can be called from arbitrary places in LibreOffice.
@@ -105,7 +106,7 @@ COMPHELPER_DLLPUBLIC bool isAllowlistedLanguage(const OUString& lang);
// Status indicator handling. Even if in theory there could be several status indicators active at
// the same time, in practice there is only one at a time, so we don't handle any identification of
// status indicator in this API.
-COMPHELPER_DLLPUBLIC void statusIndicatorStart();
+COMPHELPER_DLLPUBLIC void statusIndicatorStart(const OUString& sText);
COMPHELPER_DLLPUBLIC void statusIndicatorSetValue(int percent);
COMPHELPER_DLLPUBLIC void statusIndicatorFinish();
More information about the Libreoffice-commits
mailing list