summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-03-17 13:24:19 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-03-17 15:44:09 +0100
commit7fccffa78a26641053268b9c9e431156ce628552 (patch)
tree395ab0c1e2dfcd3f32faefea140447ad51afef80 /editeng
parent794fd10af7361d5a64a0f8bfbe5c8b5f308617a5 (diff)
use actual type in AccessibleContextBase
instead of casting everywhere Change-Id: I547ad294e612488aef11788bb54e086897c19f93 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131707 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'editeng')
-rw-r--r--editeng/source/accessibility/AccessibleContextBase.cxx20
1 files changed, 7 insertions, 13 deletions
diff --git a/editeng/source/accessibility/AccessibleContextBase.cxx b/editeng/source/accessibility/AccessibleContextBase.cxx
index ef09f28cde8c..1b8b41c10f3f 100644
--- a/editeng/source/accessibility/AccessibleContextBase.cxx
+++ b/editeng/source/accessibility/AccessibleContextBase.cxx
@@ -76,11 +76,9 @@ AccessibleContextBase::~AccessibleContextBase()
bool AccessibleContextBase::SetState (sal_Int16 aState)
{
::osl::ClearableMutexGuard aGuard (m_aMutex);
- ::utl::AccessibleStateSetHelper* pStateSet =
- static_cast< ::utl::AccessibleStateSetHelper*>(mxStateSet.get());
- if ((pStateSet != nullptr) && !pStateSet->contains(aState))
+ if ((mxStateSet != nullptr) && !mxStateSet->contains(aState))
{
- pStateSet->AddState (aState);
+ mxStateSet->AddState (aState);
// Clear the mutex guard so that it is not locked during calls to
// listeners.
aGuard.clear();
@@ -105,11 +103,9 @@ bool AccessibleContextBase::SetState (sal_Int16 aState)
bool AccessibleContextBase::ResetState (sal_Int16 aState)
{
::osl::ClearableMutexGuard aGuard (m_aMutex);
- ::utl::AccessibleStateSetHelper* pStateSet =
- static_cast< ::utl::AccessibleStateSetHelper*>(mxStateSet.get());
- if ((pStateSet != nullptr) && pStateSet->contains(aState))
+ if ((mxStateSet != nullptr) && mxStateSet->contains(aState))
{
- pStateSet->RemoveState (aState);
+ mxStateSet->RemoveState (aState);
// Clear the mutex guard so that it is not locked during calls to listeners.
aGuard.clear();
@@ -129,10 +125,8 @@ bool AccessibleContextBase::ResetState (sal_Int16 aState)
bool AccessibleContextBase::GetState (sal_Int16 aState)
{
::osl::MutexGuard aGuard (m_aMutex);
- ::utl::AccessibleStateSetHelper* pStateSet =
- static_cast< ::utl::AccessibleStateSetHelper*>(mxStateSet.get());
- if (pStateSet != nullptr)
- return pStateSet->contains(aState);
+ if (mxStateSet != nullptr)
+ return mxStateSet->contains(aState);
else
// If there is no state set then return false as a default value.
return false;
@@ -313,7 +307,7 @@ uno::Reference<XAccessibleStateSet> SAL_CALL
else
{
// Create a copy of the state set and return it.
- pStateSet = static_cast< ::utl::AccessibleStateSetHelper*>(mxStateSet.get());
+ pStateSet = mxStateSet;
if (pStateSet != nullptr)
pStateSet = new ::utl::AccessibleStateSetHelper (*pStateSet);