diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2020-04-21 18:06:52 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2020-04-22 18:43:56 +0200 |
commit | 4048ddc65a36fe0b8940019ded4fd1d58f907bcc (patch) | |
tree | f90a95eab439b538866ccbf69566654f8840fdd4 /formula/source/ui | |
parent | a9ea920dfbb7e065ef3f5b5f204732ee2ece47db (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>
Diffstat (limited to 'formula/source/ui')
-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 d84e4caea559..824df1bfe4c0 100644 --- a/formula/source/ui/dlg/formula.cxx +++ b/formula/source/ui/dlg/formula.cxx @@ -819,8 +819,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); @@ -1382,7 +1384,6 @@ void FormulaDlg_Impl::FormulaCursor() nStartPos = 1; m_xMEdit->select_region(nStartPos, nEndPos); } - if (nStartPos != aString.getLength()) { sal_Int32 nPos = nStartPos; |