sw/source/uibase/sidebar/A11yCheckIssuesPanel.cxx | 8 ++++++-- vcl/jsdialog/enabled.cxx | 3 +-- vcl/jsdialog/jsdialogbuilder.cxx | 13 ++++++++----- 3 files changed, 15 insertions(+), 9 deletions(-)
New commits: commit 28f61b1c117de7e49ce862a5590e0b90f4bf26af Author: Szymon Kłos <szymon.k...@collabora.com> AuthorDate: Mon Apr 28 11:31:55 2025 +0000 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Mon Apr 28 18:20:21 2025 +0200 lok: setup accessibility sidebar panel root - we need to point correct node to generate good JSON (Deck has dump method) - in case of a11y panel entries we are deeper in the structure - we need to assign correct LOKWindowId to the sidebar fragments to put widgets into correct basket Change-Id: I72a09acdbfae6c2688ee04b5593a457a7c518911 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184716 Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> diff --git a/sw/source/uibase/sidebar/A11yCheckIssuesPanel.cxx b/sw/source/uibase/sidebar/A11yCheckIssuesPanel.cxx index 070c7b534b1a..19ba253a1cdb 100644 --- a/sw/source/uibase/sidebar/A11yCheckIssuesPanel.cxx +++ b/sw/source/uibase/sidebar/A11yCheckIssuesPanel.cxx @@ -37,7 +37,9 @@ namespace sw::sidebar { AccessibilityCheckEntry::AccessibilityCheckEntry( weld::Container* pParent, std::shared_ptr<sfx::AccessibilityIssue> const& rAccessibilityIssue) - : m_xBuilder(Application::CreateBuilder(pParent, u"svx/ui/accessibilitycheckentry.ui"_ustr)) + : m_xBuilder(Application::CreateBuilder(pParent, u"svx/ui/accessibilitycheckentry.ui"_ustr, + false, + reinterpret_cast<sal_uInt64>(SfxViewShell::Current()))) , m_xContainer(m_xBuilder->weld_container(u"accessibilityCheckEntryBox"_ustr)) , m_xLabel(m_xBuilder->weld_label(u"accessibilityCheckEntryLabel"_ustr)) , m_xGotoButton(m_xBuilder->weld_link_button(u"accessibilityCheckEntryLinkButton"_ustr)) @@ -98,7 +100,9 @@ IMPL_LINK_NOARG(AccessibilityCheckEntry, FixButtonClicked, weld::Button&, void) } AccessibilityCheckLevel::AccessibilityCheckLevel(weld::Box* pParent) - : m_xBuilder(Application::CreateBuilder(pParent, u"svx/ui/accessibilitychecklevel.ui"_ustr)) + : m_xBuilder(Application::CreateBuilder(pParent, u"svx/ui/accessibilitychecklevel.ui"_ustr, + false, + reinterpret_cast<sal_uInt64>(SfxViewShell::Current()))) , m_xContainer(m_xBuilder->weld_box(u"accessibilityCheckLevelBox"_ustr)) { m_xExpanders[0] = m_xBuilder->weld_expander(u"expand_document"_ustr); diff --git a/vcl/jsdialog/enabled.cxx b/vcl/jsdialog/enabled.cxx index 036f1a963e58..065ec9896f35 100644 --- a/vcl/jsdialog/enabled.cxx +++ b/vcl/jsdialog/enabled.cxx @@ -311,8 +311,6 @@ constexpr auto OtherDialogList { u"formula/ui/structpage.ui" }, // svx { u"svx/ui/acceptrejectchangesdialog.ui" }, - { u"svx/ui/accessibilitycheckdialog.ui" }, - { u"svx/ui/accessibilitycheckentry.ui" }, { u"svx/ui/compressgraphicdialog.ui" }, { u"svx/ui/findreplacedialog.ui" }, { u"svx/ui/fontworkgallerydialog.ui" }, @@ -426,6 +424,7 @@ constexpr auto SidebarList { u"sfx/ui/panel.ui" }, { u"sfx/ui/templatepanel.ui" }, // svx + { u"svx/ui/accessibilitycheckentry.ui" }, { u"svx/ui/accessibilitychecklevel.ui" }, { u"svx/ui/defaultshapespanel.ui" }, { u"svx/ui/inspectortextpanel.ui" }, diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx index 64820408184f..9d1aabad460a 100644 --- a/vcl/jsdialog/jsdialogbuilder.cxx +++ b/vcl/jsdialog/jsdialogbuilder.cxx @@ -189,18 +189,16 @@ void JSInstanceBuilder::initializeSidebarSender(sal_uInt64 nLOKWindowId, m_aParentDialog = pRoot->GetParentWithLOKNotifier(); - bool bIsSidebarPanel = (rUIFile == u"sfx/ui/panel.ui"); bool bIsNavigatorPanel = jsdialog::isBuilderEnabledForNavigator(rUIFile); // builder for Panel, PanelLayout, and DockingWindow // get SidebarDockingWindow, or SwNavigatorWin as m_aContentWindow + // A11YCheckLevel : 12 levels up from pRoot // PanelLayout : 9 levels up from pRoot // Panel : 7 levels up from pRoot // DockingWindow: 3 levels up from pRoot - unsigned nLevelsUp = 9; - if (bIsSidebarPanel) - nLevelsUp = 7; - else if (bIsNavigatorPanel) + unsigned nLevelsUp = 100; // limit + if (bIsNavigatorPanel) nLevelsUp = 3; if (nLevelsUp > 0) @@ -212,6 +210,11 @@ void JSInstanceBuilder::initializeSidebarSender(sal_uInt64 nLOKWindowId, m_aContentWindow = pRoot; for (unsigned i = 0; i < nLevelsUp && m_aContentWindow; i++) { + if (!bIsNavigatorPanel && m_aContentWindow->get_id() == "Deck") + nLevelsUp = i + 3; + + // Useful to check if any panel doesn't appear + // SAL _ DEBUG ("SIDEBAR CONTENT LOOK UP FROM: " << m_aContentWindow->get_id()); m_aContentWindow = m_aContentWindow->GetParent(); } }