sw/source/ui/index/swuiidxmrk.cxx | 3 ++- sw/source/uibase/ribbar/workctrl.cxx | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-)
New commits: commit d1bb851b37cd41fb122c03986389439fd47492c5 Author: Michael Stahl <[email protected]> AuthorDate: Mon Oct 9 20:21:34 2023 +0200 Commit: Michael Stahl <[email protected]> CommitDate: Tue Oct 10 10:51:57 2023 +0200 sw: SwTbxAutoTextCtrl should sort groups by title Change-Id: I2134492fd681393da6f4fc29aec95117145e8e97 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157735 Tested-by: Jenkins Reviewed-by: Michael Stahl <[email protected]> (cherry picked from commit 07e46bb789915b8046b192b2bd6389e9ef5cb5ce) diff --git a/sw/source/uibase/ribbar/workctrl.cxx b/sw/source/uibase/ribbar/workctrl.cxx index f62059f661e5..d7260fdfe1d2 100644 --- a/sw/source/uibase/ribbar/workctrl.cxx +++ b/sw/source/uibase/ribbar/workctrl.cxx @@ -97,15 +97,18 @@ VclPtr<SfxPopupWindow> SwTbxAutoTextCtrl::CreatePopupWindow() ScopedVclPtrInstance<PopupMenu> pPopup; SwGlossaryList* pGlossaryList = ::GetGlossaryList(); const size_t nGroupCount = pGlossaryList->GetGroupCount(); + o3tl::sorted_vector<OUString> titles; for(size_t i = 1; i <= nGroupCount; ++i) { OUString sTitle = pGlossaryList->GetGroupTitle(i - 1); const sal_uInt16 nBlockCount = pGlossaryList->GetBlockCount(i -1); + auto const [it, _] = titles.insert(sTitle); + size_t const menuIndex(::std::distance(titles.begin(), it)); if(nBlockCount) { sal_uInt16 nIndex = static_cast<sal_uInt16>(100*i); // but insert without extension - pPopup->InsertItem( i, sTitle); + pPopup->InsertItem(i, sTitle, MenuItemBits::NONE, {}, menuIndex); VclPtrInstance<PopupMenu> pSub; pSub->SetSelectHdl(aLnk); pPopup->SetPopupMenu(i, pSub); commit c107793bdca1da86fc4a6081dbcc4f64455580b4 Author: Caolán McNamara <[email protected]> AuthorDate: Mon Nov 2 19:27:04 2020 +0000 Commit: Michael Stahl <[email protected]> CommitDate: Mon Oct 9 17:59:40 2023 +0200 Resolves: rhbz#1893846 if last close had insert, index dialog open when starting a new writer document Change-Id: I83131c01aa53208a321abade48d48a6f7965d0ff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105201 Tested-by: Jenkins Reviewed-by: Caolán McNamara <[email protected]> (cherry picked from commit 32f81b3a974737def611db36812225570e5d42be) diff --git a/sw/source/ui/index/swuiidxmrk.cxx b/sw/source/ui/index/swuiidxmrk.cxx index 33a0eab8cd69..5eca069b963b 100644 --- a/sw/source/ui/index/swuiidxmrk.cxx +++ b/sw/source/ui/index/swuiidxmrk.cxx @@ -955,7 +955,8 @@ SwIndexMarkFloatDlg::SwIndexMarkFloatDlg(SfxBindings* _pBindings, "modules/swriter/ui/indexentry.ui", "IndexEntryDialog") , m_aContent(m_xDialog, *m_xBuilder, bNew, *::GetActiveWrtShell()) { - m_aContent.ReInitDlg(*::GetActiveWrtShell()); + if (SwWrtShell* pSh = ::GetActiveWrtShell()) + m_aContent.ReInitDlg(*pSh); Initialize(pInfo); }
