diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2020-04-21 18:06:52 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2020-04-22 20:50:25 +0200 |
commit | 175143c819d6043bc3e986c90ec137c462da1eb0 (patch) | |
tree | 7a0cbd46a516285d4b118927fa755f7958726d09 /formula | |
parent | d4550d1ebed19d1e767113a5c5d98bc718bce57c (diff) |
tdf#131169: Retrieve right category in function wizard
m_xFuncPage->GetCategory() takes into account "Last Used" + "All" so 13 categories (0 -> 12)
whereas m_pFuncDesc->getCategory()->getNumber() doesn't take into account the 2 first (so only 0->10)
So it's not +1 but +2
Change-Id: I4d37575a3b6615c76bfa173402191a8661714e95
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92652
Tested-by: Jenkins
Reviewed-by: Eike Rathke <erack@redhat.com>
(cherry picked from commit 4048ddc65a36fe0b8940019ded4fd1d58f907bcc)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92541
Diffstat (limited to 'formula')
-rw-r--r-- | formula/source/ui/dlg/formula.cxx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/formula/source/ui/dlg/formula.cxx b/formula/source/ui/dlg/formula.cxx index 5f9a94f42699..3fb389f45401 100644 --- a/formula/source/ui/dlg/formula.cxx +++ b/formula/source/ui/dlg/formula.cxx @@ -826,8 +826,10 @@ void FormulaDlg_Impl::FillListboxes() if ( m_pFuncDesc && m_pFuncDesc->getCategory() ) { // We'll never have more than int32 max categories so this is safe ... - if ( m_xFuncPage->GetCategory() != static_cast<sal_Int32>(m_pFuncDesc->getCategory()->getNumber() + 1) ) - m_xFuncPage->SetCategory(m_pFuncDesc->getCategory()->getNumber() + 1); + // m_xFuncPage->GetCategory() takes into account "Last Used" + "All" so 13 categories (0 -> 12) + // whereas m_pFuncDesc->getCategory()->getNumber() doesn't take into account the 2 first (so only 0->10) + if ( m_xFuncPage->GetCategory() != static_cast<sal_Int32>(m_pFuncDesc->getCategory()->getNumber() + 2) ) + m_xFuncPage->SetCategory(m_pFuncDesc->getCategory()->getNumber() + 2); sal_Int32 nPos = m_xFuncPage->GetFuncPos(m_pFuncDesc); @@ -1389,7 +1391,6 @@ void FormulaDlg_Impl::FormulaCursor() nStartPos = 1; m_xMEdit->select_region(nStartPos, nEndPos); } - if (nStartPos != aString.getLength()) { sal_Int32 nPos = nStartPos; |