diff options
author | Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de> | 2022-11-14 16:23:30 +0100 |
---|---|---|
committer | Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de> | 2022-11-18 09:06:55 +0100 |
commit | 950bd818eb37e79c2276ce919f90d177255d5520 (patch) | |
tree | 70068c9d3f85e860e783a651a31aaa8ccbab37f8 /svx/source/dialog | |
parent | 0cef06f0a2c0963e8c1579b78975710e6af4471c (diff) |
tdf#148999 Add rescan button to PDF a11y check dialog
Change-Id: I772f529ea4bd225701b9864ad9156c573f41484c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142715
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
Diffstat (limited to 'svx/source/dialog')
-rw-r--r-- | svx/source/dialog/AccessibilityCheckDialog.cxx | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/svx/source/dialog/AccessibilityCheckDialog.cxx b/svx/source/dialog/AccessibilityCheckDialog.cxx index 136bafc265bf..ac34f7306da4 100644 --- a/svx/source/dialog/AccessibilityCheckDialog.cxx +++ b/svx/source/dialog/AccessibilityCheckDialog.cxx @@ -36,14 +36,25 @@ IMPL_LINK_NOARG(AccessibilityCheckEntry, GotoButtonClicked, weld::Button&, void) } AccessibilityCheckDialog::AccessibilityCheckDialog( - weld::Window* pParent, sfx::AccessibilityIssueCollection aIssueCollection) + weld::Window* pParent, sfx::AccessibilityIssueCollection aIssueCollection, + std::function<sfx::AccessibilityIssueCollection()> getIssueCollection) : GenericDialogController(pParent, "svx/ui/accessibilitycheckdialog.ui", "AccessibilityCheckDialog") , m_aIssueCollection(std::move(aIssueCollection)) + , m_getIssueCollection(getIssueCollection) , m_xAccessibilityCheckBox(m_xBuilder->weld_box("accessibilityCheckBox")) + , m_xRescanBtn(m_xBuilder->weld_button("rescan")) { - sal_Int32 i = 0; + m_xRescanBtn->connect_clicked(LINK(this, AccessibilityCheckDialog, RescanButtonClicked)); + + populateIssues(); +} +AccessibilityCheckDialog::~AccessibilityCheckDialog() {} + +void AccessibilityCheckDialog::populateIssues() +{ + sal_Int32 i = 0; for (std::shared_ptr<sfx::AccessibilityIssue> const& pIssue : m_aIssueCollection.getIssues()) { auto xEntry @@ -53,7 +64,15 @@ AccessibilityCheckDialog::AccessibilityCheckDialog( } } -AccessibilityCheckDialog::~AccessibilityCheckDialog() {} +IMPL_LINK_NOARG(AccessibilityCheckDialog, RescanButtonClicked, weld::Button&, void) +{ + // Remove old issue widgets + for (auto const& xEntry : m_aAccessibilityCheckEntries) + m_xAccessibilityCheckBox->move(xEntry->get_widget(), nullptr); + + m_aIssueCollection = m_getIssueCollection(); + populateIssues(); +} } // end svx namespace |