summaryrefslogtreecommitdiff
path: root/sw/source/core/access
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2023-08-30 15:37:51 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2023-08-31 10:41:43 +0200
commitc21ed0c9136c0a26b6e7258492c635e988bb87a5 (patch)
tree74a8d57c006553f50c1361f805dfb8765728f190 /sw/source/core/access
parent89b6d1cd2ed3ea4633a8f4e90daf99001decef3e (diff)
use concrete type for SwAccessibleTable::Cells_t
avoid some unnecessary casting Change-Id: If9998f5ffd3c4b71f81f10e8f274671bb72da017 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156317 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/core/access')
-rw-r--r--sw/source/core/access/acctable.cxx25
-rw-r--r--sw/source/core/access/acctable.hxx4
2 files changed, 10 insertions, 19 deletions
diff --git a/sw/source/core/access/acctable.cxx b/sw/source/core/access/acctable.cxx
index 0e3101c71cef..3c8beaf9a0a4 100644
--- a/sw/source/core/access/acctable.cxx
+++ b/sw/source/core/access/acctable.cxx
@@ -1501,31 +1501,23 @@ void SwAccessibleTable::FireSelectionEvent( )
aEvent.EventId = AccessibleEventId::SELECTION_CHANGED_REMOVE;
- for (const auto& rCell : m_vecCellRemove)
+ for (const unotools::WeakReference<SwAccessibleContext>& rxCell : m_vecCellRemove)
{
// fdo#57197: check if the object is still alive
- uno::Reference<XAccessible> const xAcc(rCell.second);
- if (xAcc.is())
- {
- SwAccessibleContext *const pAccCell(rCell.first);
- assert(pAccCell);
+ rtl::Reference<SwAccessibleContext> const pAccCell(rxCell);
+ if (pAccCell)
pAccCell->FireAccessibleEvent(aEvent);
- }
}
if (m_vecCellAdd.size() <= SELECTION_WITH_NUM)
{
aEvent.EventId = AccessibleEventId::SELECTION_CHANGED_ADD;
- for (const auto& rCell : m_vecCellAdd)
+ for (const unotools::WeakReference<SwAccessibleContext>& rxCell : m_vecCellAdd)
{
// fdo#57197: check if the object is still alive
- uno::Reference<XAccessible> const xAcc(rCell.second);
- if (xAcc.is())
- {
- SwAccessibleContext *const pAccCell(rCell.first);
- assert(pAccCell);
+ rtl::Reference<SwAccessibleContext> const pAccCell(rxCell);
+ if (pAccCell)
pAccCell->FireAccessibleEvent(aEvent);
- }
}
return ;
}
@@ -1539,14 +1531,13 @@ void SwAccessibleTable::FireSelectionEvent( )
void SwAccessibleTable::AddSelectionCell(
SwAccessibleContext *const pAccCell, bool const bAddOrRemove)
{
- uno::Reference<XAccessible> const xTmp(pAccCell);
if (bAddOrRemove)
{
- m_vecCellAdd.emplace_back(pAccCell, xTmp);
+ m_vecCellAdd.emplace_back(pAccCell);
}
else
{
- m_vecCellRemove.emplace_back(pAccCell, xTmp);
+ m_vecCellRemove.emplace_back(pAccCell);
}
}
diff --git a/sw/source/core/access/acctable.hxx b/sw/source/core/access/acctable.hxx
index 5187caed411e..9996ffa33b0d 100644
--- a/sw/source/core/access/acctable.hxx
+++ b/sw/source/core/access/acctable.hxx
@@ -25,6 +25,7 @@
#include <com/sun/star/accessibility/XAccessibleSelection.hpp>
#include <svl/listener.hxx>
+#include <unotools/weakref.hxx>
#include "acccontext.hxx"
@@ -46,8 +47,7 @@ class SwAccessibleTable :
{
std::unique_ptr<SwAccessibleTableData_Impl> mpTableData; // the table's data, protected by SolarMutex
OUString m_sDesc;
- typedef std::vector< std::pair<SwAccessibleContext*,
- css::uno::WeakReference<css::accessibility::XAccessible> > > Cells_t;
+ typedef std::vector< unotools::WeakReference<SwAccessibleContext> > Cells_t;
Cells_t m_vecCellAdd;
Cells_t m_vecCellRemove;