diff options
author | Kohei Yoshida <kyoshida@novell.com> | 2010-10-22 16:30:48 +0200 |
---|---|---|
committer | Kohei Yoshida <kyoshida@novell.com> | 2010-10-23 17:10:22 +0200 |
commit | dcc9d619df1b2b8f77b25930206bdaf747ca6ab7 (patch) | |
tree | a14e74f72146292242283ffe5dd98368b2b4221a | |
parent | 7aa1f521decd012fbb025bd3905e945074c44bd2 (diff) |
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)
-rw-r--r-- | sc/source/ui/formdlg/formula.cxx | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sc/source/ui/formdlg/formula.cxx b/sc/source/ui/formdlg/formula.cxx index 96fd78e9d..f2953843c 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; |