summaryrefslogtreecommitdiff
path: root/sc/source/ui/app/inputwin.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/ui/app/inputwin.cxx')
-rw-r--r--sc/source/ui/app/inputwin.cxx14
1 files changed, 10 insertions, 4 deletions
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index 6a93fc130e02..c03799aa6ffe 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -1662,6 +1662,10 @@ void ScPosWnd::DoEnter()
ScTabViewShell* pViewSh = ScTabViewShell::GetActiveViewShell();
if ( pViewSh )
{
+ ScViewData* pViewData = pViewSh->GetViewData();
+ ScDocShell* pDocShell = pViewData->GetDocShell();
+ ScDocument* pDoc = pDocShell->GetDocument();
+
ScNameInputType eType = lcl_GetInputType( aText );
if ( eType == SC_NAME_INPUT_BAD_NAME || eType == SC_NAME_INPUT_BAD_SELECTION )
{
@@ -1670,9 +1674,6 @@ void ScPosWnd::DoEnter()
}
else if ( eType == SC_NAME_INPUT_DEFINE )
{
- ScViewData* pViewData = pViewSh->GetViewData();
- ScDocShell* pDocShell = pViewData->GetDocShell();
- ScDocument* pDoc = pDocShell->GetDocument();
ScRangeName* pNames = pDoc->GetRangeName();
ScRange aSelection;
if ( pNames && !pNames->findByName(aText) &&
@@ -1695,7 +1696,12 @@ void ScPosWnd::DoEnter()
}
else
{
- // for all selection types, excecute the SID_CURRENTCELL slot
+ // for all selection types, excecute the SID_CURRENTCELL slot.
+ // Note that SID_CURRENTCELL always expects address to be
+ // in Calc A1 format. Convert the text.
+ ScRange aRange;
+ aRange.ParseAny(aText, pDoc, pDoc->GetAddressConvention());
+ aRange.Format(aText, SCR_ABS_3D, pDoc, ::formula::FormulaGrammar::CONV_OOO);
SfxStringItem aPosItem( SID_CURRENTCELL, aText );
SfxBoolItem aUnmarkItem( FN_PARAM_1, sal_True ); // remove existing selection