diff options
author | Caolán McNamara <caolanm@redhat.com> | 2023-03-23 11:25:10 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2023-03-23 14:11:57 +0000 |
commit | b2beab144096c1f4f33ce0d9cacedbb80cc83594 (patch) | |
tree | 8548431509c7be5d4581931a82c1558b5d456df8 /svx | |
parent | 0cdd0a6603626d7da9c331771c77b8a719f0592a (diff) |
tdf#154322 select the first entry of the current page by default
rather than default to nothing selected, if we switch pages and then
back to page 1 this will be selected anyway, so start off that way
Change-Id: Ia684a5e44b12c984df3920f18b34c99693a2702c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149426
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/form/datanavi.cxx | 13 | ||||
-rw-r--r-- | svx/source/inc/datanavi.hxx | 1 |
2 files changed, 14 insertions, 0 deletions
diff --git a/svx/source/form/datanavi.cxx b/svx/source/form/datanavi.cxx index 5d3242e84683..635e55cdf2ab 100644 --- a/svx/source/form/datanavi.cxx +++ b/svx/source/form/datanavi.cxx @@ -189,6 +189,15 @@ namespace svxform m_xItemList->clear(); } + void XFormsPage::SelectFirstEntry() + { + if (m_xItemList->get_iter_first(*m_xScratchIter)) + { + m_xItemList->select(*m_xScratchIter); + ItemSelectHdl(*m_xItemList); + } + } + XFormsPage::XFormsPage(weld::Container* pPage, DataNavigatorWindow* _pNaviWin, DataGroupType _eGroup) : BuilderPage(pPage, nullptr, "svx/ui/xformspage.ui", "XFormsPage") , m_pParent(pPage) @@ -1316,6 +1325,10 @@ namespace svxform // load xforms models of the current document LoadModels(); + + // tdf#154322 select the first entry of the current page by default + if (XFormsPage* pPage = GetPage(sPageId)) + pPage->SelectFirstEntry(); } DataNavigatorWindow::~DataNavigatorWindow() diff --git a/svx/source/inc/datanavi.hxx b/svx/source/inc/datanavi.hxx index b165b9a94531..fe26bd27b407 100644 --- a/svx/source/inc/datanavi.hxx +++ b/svx/source/inc/datanavi.hxx @@ -237,6 +237,7 @@ namespace svxform bool DoMenuAction(std::string_view rMenuID); void EnableMenuItems(); + void SelectFirstEntry(); const OUString& GetInstanceName() const { return m_sInstanceName; } const OUString& GetInstanceURL() const { return m_sInstanceURL; } |