summaryrefslogtreecommitdiff
path: root/sc/source/ui/StatisticsDialogs/MovingAverageDialog.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/ui/StatisticsDialogs/MovingAverageDialog.cxx')
-rw-r--r--sc/source/ui/StatisticsDialogs/MovingAverageDialog.cxx8
1 files changed, 5 insertions, 3 deletions
diff --git a/sc/source/ui/StatisticsDialogs/MovingAverageDialog.cxx b/sc/source/ui/StatisticsDialogs/MovingAverageDialog.cxx
index 4f4d5960e199..4d59e28336c7 100644
--- a/sc/source/ui/StatisticsDialogs/MovingAverageDialog.cxx
+++ b/sc/source/ui/StatisticsDialogs/MovingAverageDialog.cxx
@@ -75,6 +75,7 @@ ScRange ScMovingAverageDialog::ApplyOutput(ScDocShell* pDocShell)
output.nextRow();
DataCellIterator aDataCellIterator = pIterator->iterateCells();
+ std::vector<OUString> aFormulas;
for (; aDataCellIterator.hasNext(); aDataCellIterator.next())
{
@@ -98,14 +99,15 @@ ScRange ScMovingAverageDialog::ApplyOutput(ScDocShell* pDocShell)
{
aTemplate.setTemplate("=AVERAGE(%RANGE%)");
aTemplate.applyRange("%RANGE%", ScRange(aIntervalStart, aIntervalEnd));
- output.writeFormula(aTemplate.getTemplate());
+ aFormulas.push_back(aTemplate.getTemplate());
}
else
{
- output.writeFormula("=#N/A");
+ aFormulas.push_back("=#N/A");
}
- output.nextRow();
}
+
+ output.writeFormulas(aFormulas);
output.nextColumn();
}
return ScRange(output.mMinimumAddress, output.mMaximumAddress);