[Libreoffice-commits] .: Branch 'libreoffice-3-4' - sc/source

Kohei Yoshida kohei at kemper.freedesktop.org
Fri Apr 22 09:00:21 PDT 2011


 sc/source/ui/app/inputwin.cxx |   14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

New commits:
commit 81ad179721d39a99ff958663cd29220f64723ac3
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Fri Apr 22 11:57:36 2011 -0400

    Fixed address input box to work in R1C1 mode.
    
    Previously, typing a valid address in the address input box while
    in R1C1 mode caused an invalid range error.  This commit fixes it.

diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index ce7d9a2..4e88c19 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


More information about the Libreoffice-commits mailing list