comphelper/source/misc/lok.cxx | 12 ++++++------ desktop/source/lib/init.cxx | 4 ++-- framework/source/helper/statusindicator.cxx | 2 +- include/comphelper/lok.hxx | 7 ++++--- 4 files changed, 13 insertions(+), 12 deletions(-)
New commits: commit 83e0648c40b02bddb086b09f4564a7dc2c3a9ea8 Author: Henry Castro <hcas...@collabora.com> AuthorDate: Thu Jul 8 16:21:46 2021 -0400 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Thu Jul 15 15:22:25 2021 +0200 lok: include the label of the status indicator Change-Id: Ib2714e3d2b6add54ffba753d3519aeba7a3f1959 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118681 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Andras Timar <andras.ti...@collabora.com> diff --git a/comphelper/source/misc/lok.cxx b/comphelper/source/misc/lok.cxx index 1ef1ae5766b3..d7b34bccafee 100644 --- a/comphelper/source/misc/lok.cxx +++ b/comphelper/source/misc/lok.cxx @@ -264,31 +264,31 @@ bool isWhitelistedLanguage(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 48fbc1dba6e4..19cb7973dca7 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -6053,7 +6053,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); @@ -6063,7 +6063,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 25d67694c5df..12ea12b79476 100644 --- a/framework/source/helper/statusindicator.cxx +++ b/framework/source/helper/statusindicator.cxx @@ -41,7 +41,7 @@ void SAL_CALL StatusIndicator::start(const OUString& sText , 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 1755f4d796b0..50e9dfecb9c5 100644 --- a/include/comphelper/lok.hxx +++ b/include/comphelper/lok.hxx @@ -32,8 +32,9 @@ COMPHELPER_DLLPUBLIC void setActive(bool bActive = true); enum class statusIndicatorCallbackType { Start, SetValue, Finish }; -COMPHELPER_DLLPUBLIC void setStatusIndicatorCallback(void (*callback)(void *data, statusIndicatorCallbackType type, int percent), void *data); - +COMPHELPER_DLLPUBLIC void setStatusIndicatorCallback( + 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 isWhitelistedLanguage(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(); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits