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 | 31d0b6ded6f837a5dee77c048a4f1cb1eacba3c1 (patch) | |
tree | b4c70ae7375ae1abba9822bdbab8fbc71960b058 /sc/source/ui | |
parent | 974ae17d2c9fe1f3a248a218939e3d3b48a9fd77 (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)
Diffstat (limited to 'sc/source/ui')
-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 fec3f5885932..99b6b82acf89 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; |