sw/source/uibase/sidebar/A11yCheckIssuesPanel.cxx | 15 +++------------ sw/source/uibase/sidebar/A11yCheckIssuesPanel.hxx | 1 - 2 files changed, 3 insertions(+), 13 deletions(-)
New commits: commit 2239e2f813879b7b9a6a36350fd5d8d340a13388 Author: Balazs Varga <balazs.varga.ext...@allotropia.de> AuthorDate: Mon Jun 16 13:58:28 2025 +0200 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Wed Jun 18 09:59:39 2025 +0200 Related: tdf#166968 - A11Y - remove unnecessary elements from the entries Need to remove all elements from entries before building up and populate the new issues. Otherwise we will have multiple elements. Change-Id: I3a391b8ccf91f14d8650861c39bc3561af6282ce Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186571 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> Reviewed-by: Balazs Varga <balazs.varga.ext...@allotropia.de> (cherry picked from commit 32501882c64e5abaefe2c979afb493b0e378e46a) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186628 Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/sw/source/uibase/sidebar/A11yCheckIssuesPanel.cxx b/sw/source/uibase/sidebar/A11yCheckIssuesPanel.cxx index 62d8f19252c9..701391081e6b 100644 --- a/sw/source/uibase/sidebar/A11yCheckIssuesPanel.cxx +++ b/sw/source/uibase/sidebar/A11yCheckIssuesPanel.cxx @@ -137,18 +137,12 @@ void AccessibilityCheckLevel::removeAllEntries() auto nGroupIndex = size_t(eGroup); for (auto const& xEntry : m_aEntries[nGroupIndex]) m_xBoxes[nGroupIndex]->move(xEntry->get_widget(), nullptr); + // remove the entries from the vector + if (!m_aEntries[nGroupIndex].empty()) + m_aEntries[nGroupIndex].clear(); } } -void AccessibilityCheckLevel::reset() -{ - for (auto& xExpander : m_xExpanders) - xExpander.reset(); - - for (auto& xBox : m_xBoxes) - xBox.reset(); -} - void AccessibilityCheckLevel::addEntryForGroup( AccessibilityCheckGroups eGroup, std::vector<sal_Int32>& rIndices, std::shared_ptr<sfx::AccessibilityIssue> const& pIssue) @@ -280,10 +274,7 @@ void A11yCheckIssuesPanel::ImplDestroy() } for (auto& aLevelEntry : m_aLevelEntries) - { - aLevelEntry->reset(); aLevelEntry.reset(); - } } A11yCheckIssuesPanel::~A11yCheckIssuesPanel() { suppress_fun_call_w_exception(ImplDestroy()); } diff --git a/sw/source/uibase/sidebar/A11yCheckIssuesPanel.hxx b/sw/source/uibase/sidebar/A11yCheckIssuesPanel.hxx index 96e6079a5b0d..cae37c9dcecd 100644 --- a/sw/source/uibase/sidebar/A11yCheckIssuesPanel.hxx +++ b/sw/source/uibase/sidebar/A11yCheckIssuesPanel.hxx @@ -72,7 +72,6 @@ public: AccessibilityCheckLevel(weld::Box* pParent); void removeAllEntries(); - void reset(); void addEntryForGroup(AccessibilityCheckGroups eGroup, std::vector<sal_Int32>& rIndices, std::shared_ptr<sfx::AccessibilityIssue> const& pIssue);