diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-05-30 14:47:49 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-05-30 15:00:26 -0400 |
commit | 0ab538885d818a7b3706df48a625e2523a8ebbdf (patch) | |
tree | c90b0c86e1667fb4b52a33d267e757978446f116 /sc/source/ui/StatisticsDialogs/DescriptiveStatisticsDialog.cxx | |
parent | f85d10fdf651d131ecb0c3622326b3b076205e80 (diff) |
fdo#79174: Use 3D address when the input and output are on different sheets.
Also some cleanup, mostly to avoid storing separate address convention object,
which is not really necessary.
Change-Id: Id3e104043f08b6786de2e91d69361557b83890f9
Diffstat (limited to 'sc/source/ui/StatisticsDialogs/DescriptiveStatisticsDialog.cxx')
-rw-r--r-- | sc/source/ui/StatisticsDialogs/DescriptiveStatisticsDialog.cxx | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sc/source/ui/StatisticsDialogs/DescriptiveStatisticsDialog.cxx b/sc/source/ui/StatisticsDialogs/DescriptiveStatisticsDialog.cxx index 3c56be5d48bc..0d98e79d9a1e 100644 --- a/sc/source/ui/StatisticsDialogs/DescriptiveStatisticsDialog.cxx +++ b/sc/source/ui/StatisticsDialogs/DescriptiveStatisticsDialog.cxx @@ -84,7 +84,7 @@ ScRange ScDescriptiveStatisticsDialog::ApplyOutput(ScDocShell* pDocShell) { AddressWalkerWriter aOutput(mOutputAddress, pDocShell, mDocument, formula::FormulaGrammar::mergeToGrammar( formula::FormulaGrammar::GRAM_ENGLISH, mAddressDetails.eConv)); - FormulaTemplate aTemplate(mDocument, mAddressDetails); + FormulaTemplate aTemplate(mDocument); boost::scoped_ptr<DataRangeIterator> pIterator; if (mGroupedBy == BY_COLUMN) @@ -94,6 +94,9 @@ ScRange ScDescriptiveStatisticsDialog::ApplyOutput(ScDocShell* pDocShell) aOutput.nextColumn(); + // Use explicit sheet name in case the input and output are on different sheets. + bool b3DAddress = mInputRange.aStart.Tab() != mOutputAddress.Tab(); + // Write column/row labels for( ; pIterator->hasNext(); pIterator->next() ) { @@ -128,7 +131,7 @@ ScRange ScDescriptiveStatisticsDialog::ApplyOutput(ScDocShell* pDocShell) for(sal_Int32 i = 0; lclCalcDefinitions[i].aFormula != NULL; i++) { aTemplate.setTemplate(lclCalcDefinitions[i].aFormula); - aTemplate.applyRange(strWildcardRange, pIterator->get()); + aTemplate.applyRange(strWildcardRange, pIterator->get(), b3DAddress); aOutput.writeFormula(aTemplate.getTemplate()); aOutput.nextRow(); } |