[Libreoffice-commits] .: sc/source

Kohei Yoshida kohei at kemper.freedesktop.org
Sat Oct 23 08:10:57 PDT 2010


 sc/source/ui/formdlg/formula.cxx |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

New commits:
commit dcc9d619df1b2b8f77b25930206bdaf747ca6ab7
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Fri Oct 22 16:30:48 2010 +0200

    Fix incorrect display of references from the formula input wizard.
    
    When launching the reference input dialog from the formula input
    wizard, it would not display the sheet name & it always displayed
    the reference as range.  This change fixes it. (fdo#30904)

diff --git a/sc/source/ui/formdlg/formula.cxx b/sc/source/ui/formdlg/formula.cxx
index 96fd78e..f295384 100644
--- a/sc/source/ui/formdlg/formula.cxx
+++ b/sc/source/ui/formdlg/formula.cxx
@@ -453,10 +453,19 @@ void ScFormulaDlg::SetReference( const ScRange& rRef, ScDocument* pRefDoc )
         }
         else
         {
+            // We can't use ScRange::Format here because in R1C1 mode we need
+            // to display the reference position relative to the cursor
+            // position.
             ScTokenArray aArray;
             ScComplexRefData aRefData;
             aRefData.InitRangeRel(rRef, aCursorPos);
-            aArray.AddDoubleReference(aRefData);
+            bool bSingle = aRefData.Ref1 == aRefData.Ref2;
+            if (aCursorPos.Tab() != rRef.aStart.Tab())
+                aRefData.Ref1.SetFlag3D(true);
+            if (bSingle)
+                aArray.AddSingleReference(aRefData.Ref1);
+            else
+                aArray.AddDoubleReference(aRefData);
             ScCompiler aComp(pDoc, aCursorPos, aArray);
             aComp.SetGrammar(pDoc->GetGrammar());
             ::rtl::OUStringBuffer aBuf;


More information about the Libreoffice-commits mailing list