sw/source/uibase/sidebar/A11yCheckIssuesPanel.cxx | 15 +++------------ sw/source/uibase/sidebar/A11yCheckIssuesPanel.hxx | 1 - 2 files changed, 3 insertions(+), 13 deletions(-)
New commits: commit 32501882c64e5abaefe2c979afb493b0e378e46a Author: Balazs Varga <balazs.varga.ext...@allotropia.de> AuthorDate: Mon Jun 16 13:58:28 2025 +0200 Commit: Balazs Varga <balazs.varga.ext...@allotropia.de> CommitDate: Tue Jun 17 17:08:10 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> diff --git a/sw/source/uibase/sidebar/A11yCheckIssuesPanel.cxx b/sw/source/uibase/sidebar/A11yCheckIssuesPanel.cxx index 4faf99d307f1..e495998871fa 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) @@ -274,10 +268,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);