sc/source/ui/app/inputwin.cxx |   37 +++----------------------------------
 1 file changed, 3 insertions(+), 34 deletions(-)

New commits:
commit b0496a314b1acee28e22c1029b696cbbc1983853
Author:     Matt K <matt...@gmail.com>
AuthorDate: Thu Jul 13 18:12:16 2023 -0500
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Fri Oct 13 15:30:38 2023 +0200

    tdf#150262 Split Autosum button: refactor to deduplicate
    
    This change refactors the recent checkin that split the
    autosum button into a default clickable button.  We just
    use the existing function "AutoSum" in place of the copied
    code.
    
    Change-Id: I9a0e6fce047165c927746f0f87df4de905d2f8ee
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155058
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>

diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index 2bb29146da07..ed3fe521d94b 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -368,40 +368,9 @@ void ScInputWindow::Select()
     }
     else if (curItemId == SID_INPUT_SUM)
     {
-        ScTabViewShell* pViewSh = 
dynamic_cast<ScTabViewShell*>(SfxViewShell::Current());
-        if (pViewSh)
-        {
-            bool bSubTotal = false;
-            bool bRangeFinder = false;
-            const OUString aFormula = pViewSh->DoAutoSum(bRangeFinder, 
bSubTotal, ocSum);
-            if (!aFormula.isEmpty())
-            {
-                SetFuncString(aFormula);
-                if (bRangeFinder && pScMod->IsEditMode())
-                {
-                    ScInputHandler* pHdl = pScMod->GetInputHdl(pViewSh);
-                    if (pHdl)
-                    {
-                        pHdl->InitRangeFinder(aFormula);
-
-                        //! SetSelection at the InputHandler?
-                        //! Set bSelIsRef?
-                        const sal_Int32 nOpen = aFormula.indexOf('(');
-                        const sal_Int32 nLen = aFormula.getLength();
-                        if (nOpen != -1 && nLen > nOpen)
-                        {
-                            ESelection aSel(0, nOpen + (bSubTotal ? 3 : 1), 0, 
nLen - 1);
-                            EditView* pTableView = pHdl->GetTableView();
-                            if (pTableView)
-                                pTableView->SetSelection(aSel);
-                            EditView* pTopView = pHdl->GetTopView();
-                            if (pTopView)
-                                pTopView->SetSelection(aSel);
-                        }
-                    }
-                }
-            }
-        }
+        bool bRangeFinder = false;
+        bool bSubTotal = false;
+        AutoSum(bRangeFinder, bSubTotal, ocSum);
     }
     else if (curItemId == SID_INPUT_EQUAL)
     {

Reply via email to