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 0e7021de592b07894c57ab920acb40e10be8b26e 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:21:45 2021 +0200 lok: include the label of the status indicator Change-Id: Ib2714e3d2b6add54ffba753d3519aeba7a3f1959 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118658 Tested-by: Jenkins Reviewed-by: Andras Timar <andras.ti...@collabora.com> diff --git a/comphelper/source/misc/lok.cxx b/comphelper/source/misc/lok.cxx index fe7c742e4ec3..b11bf4e83582 100644 --- a/comphelper/source/misc/lok.cxx +++ b/comphelper/source/misc/lok.cxx @@ -255,31 +255,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); } } // namespace diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 7d3fc9f078ab..4060af238700 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -6006,7 +6006,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); @@ -6016,7 +6016,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 07b8ef6aa426..99f3dd30dfce 100644 --- a/include/comphelper/lok.hxx +++ b/include/comphelper/lok.hxx @@ -33,7 +33,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. @@ -104,7 +105,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(); } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits