formula/source/ui/dlg/formula.cxx |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

New commits:
commit 4048ddc65a36fe0b8940019ded4fd1d58f907bcc
Author:     Julien Nabet <serval2...@yahoo.fr>
AuthorDate: Tue Apr 21 18:06:52 2020 +0200
Commit:     Eike Rathke <er...@redhat.com>
CommitDate: Wed Apr 22 18:43:56 2020 +0200

    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 <er...@redhat.com>

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;
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to