summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2024-06-13 11:20:50 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2024-06-13 19:54:24 +0200
commit5dc1d4453738876c0576c45b826b9f01d29e8905 (patch)
tree95348fb5bf9d45d57c438a400a89335f028127dd
parent78edbb9f6f6957c625fdf6ae4e9834e10e20a57a (diff)
use more concrete UNO types in StatusIndicator
Change-Id: I7266cded882bb2d4eb00bdfe565b7c4085c1459d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168777 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--framework/inc/helper/statusindicator.hxx5
-rw-r--r--framework/source/helper/statusindicator.cxx35
2 files changed, 13 insertions, 27 deletions
diff --git a/framework/inc/helper/statusindicator.hxx b/framework/inc/helper/statusindicator.hxx
index 8d97738d0008..a60a89c1b182 100644
--- a/framework/inc/helper/statusindicator.hxx
+++ b/framework/inc/helper/statusindicator.hxx
@@ -27,9 +27,10 @@
// include all others
#include <cppuhelper/implbase.hxx>
-#include <cppuhelper/weakref.hxx>
+#include <unotools/weakref.hxx>
namespace framework{
+class StatusIndicatorFactory;
/**
@short implement a status indicator object
@@ -61,7 +62,7 @@ class StatusIndicator final : public ::cppu::WeakImplHelper< css::task::XStatus
will be owned by him. If the frame will be closed
he close our factory too ...
*/
- css::uno::WeakReference< css::task::XStatusIndicatorFactory > m_xFactory;
+ unotools::WeakReference< StatusIndicatorFactory > m_xFactory;
sal_Int32 m_nRange;
// We want the callback percentages to increase monotonically
diff --git a/framework/source/helper/statusindicator.cxx b/framework/source/helper/statusindicator.cxx
index 2deb4a0ae5b2..31c1da7d3e9a 100644
--- a/framework/source/helper/statusindicator.cxx
+++ b/framework/source/helper/statusindicator.cxx
@@ -41,12 +41,9 @@ void SAL_CALL StatusIndicator::start(const OUString& sText, sal_Int32 nRange)
comphelper::LibreOfficeKit::statusIndicatorStart(sText);
}
#if !defined(IOS) && !defined(ANDROID)
- css::uno::Reference<css::task::XStatusIndicatorFactory> xFactory(m_xFactory);
+ rtl::Reference<StatusIndicatorFactory> xFactory(m_xFactory);
if (xFactory.is())
- {
- StatusIndicatorFactory* pFactory = static_cast<StatusIndicatorFactory*>(xFactory.get());
- pFactory->start(this, sText, nRange);
- }
+ xFactory->start(this, sText, nRange);
#else
(void)sText;
#endif
@@ -59,12 +56,9 @@ void SAL_CALL StatusIndicator::end()
comphelper::LibreOfficeKit::statusIndicatorFinish();
}
#if !defined(IOS) && !defined(ANDROID)
- css::uno::Reference<css::task::XStatusIndicatorFactory> xFactory(m_xFactory);
+ rtl::Reference<StatusIndicatorFactory> xFactory(m_xFactory);
if (xFactory.is())
- {
- StatusIndicatorFactory* pFactory = static_cast<StatusIndicatorFactory*>(xFactory.get());
- pFactory->end(this);
- }
+ xFactory->end(this);
#endif
}
@@ -73,12 +67,9 @@ void SAL_CALL StatusIndicator::reset()
if (comphelper::LibreOfficeKit::isActive())
return;
#if !defined(IOS) && !defined(ANDROID)
- css::uno::Reference<css::task::XStatusIndicatorFactory> xFactory(m_xFactory);
+ rtl::Reference<StatusIndicatorFactory> xFactory(m_xFactory);
if (xFactory.is())
- {
- StatusIndicatorFactory* pFactory = static_cast<StatusIndicatorFactory*>(xFactory.get());
- pFactory->reset(this);
- }
+ xFactory->reset(this);
#endif
}
@@ -87,12 +78,9 @@ void SAL_CALL StatusIndicator::setText(const OUString& sText)
if (comphelper::LibreOfficeKit::isActive())
return;
#if !defined(IOS) && !defined(ANDROID)
- css::uno::Reference<css::task::XStatusIndicatorFactory> xFactory(m_xFactory);
+ rtl::Reference<StatusIndicatorFactory> xFactory(m_xFactory);
if (xFactory.is())
- {
- StatusIndicatorFactory* pFactory = static_cast<StatusIndicatorFactory*>(xFactory.get());
- pFactory->setText(this, sText);
- }
+ xFactory->setText(this, sText);
#else
(void)sText;
#endif
@@ -114,12 +102,9 @@ void SAL_CALL StatusIndicator::setValue(sal_Int32 nValue)
return;
}
#if !defined(IOS) && !defined(ANDROID)
- css::uno::Reference<css::task::XStatusIndicatorFactory> xFactory(m_xFactory);
+ rtl::Reference<StatusIndicatorFactory> xFactory(m_xFactory);
if (xFactory.is())
- {
- StatusIndicatorFactory* pFactory = static_cast<StatusIndicatorFactory*>(xFactory.get());
- pFactory->setValue(this, nValue);
- }
+ xFactory->setValue(this, nValue);
#endif
}