diff options
-rw-r--r-- | sw/source/core/access/acctable.cxx | 25 | ||||
-rw-r--r-- | sw/source/core/access/acctable.hxx | 4 |
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; |