summaryrefslogtreecommitdiff
path: root/sc/source/ui/app
diff options
context:
space:
mode:
authorHenry Castro <hcastro@collabora.com>2016-10-24 22:15:45 -0400
committerHenry Castro <hcastro@collabora.com>2016-10-25 11:07:33 +0000
commit97f0fbe5830a5d2119fe9f5e8142fe45b255c2ac (patch)
tree6bb272281f2774ee1a6197cb0c9a3a492117cc82 /sc/source/ui/app
parent8a063e2f2a4081234aaf538751bb1bb3c68bd8f8 (diff)
tdf#103409: No selection outline displayed when SUM button is clicked
Change-Id: I8a1bb22bd0be9717a56a90732b17c4ed8f230bf3 Reviewed-on: https://gerrit.libreoffice.org/30254 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Henry Castro <hcastro@collabora.com>
Diffstat (limited to 'sc/source/ui/app')
-rw-r--r--sc/source/ui/app/inputwin.cxx27
1 files changed, 26 insertions, 1 deletions
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index e0d961bc98ec..352483105ffc 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -331,10 +331,35 @@ void ScInputWindow::Select()
ScTabViewShell* pViewSh = dynamic_cast<ScTabViewShell*>( SfxViewShell::Current() );
if ( pViewSh )
{
- const OUString aFormula = pViewSh->DoAutoSum();
+ bool bSubTotal = false;
+ bool bRangeFinder = false;
+ const OUString aFormula = pViewSh->DoAutoSum(bRangeFinder, bSubTotal);
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 );
+ }
+ }
+ }
}
}
}