summaryrefslogtreecommitdiff
path: root/sc/source/ui/StatisticsDialogs/ExponentialSmoothingDialog.cxx
diff options
context:
space:
mode:
authorTomaž Vajngerl <quikee@gmail.com>2013-11-10 18:05:29 +0100
committerTomaž Vajngerl <quikee@gmail.com>2013-11-11 23:22:33 +0100
commit1b4c3fad813a2673f14f88fcb8876e1bef118c6e (patch)
tree8022e72424df1c0f1f30859bcc976f9d204ea861 /sc/source/ui/StatisticsDialogs/ExponentialSmoothingDialog.cxx
parenta025cd4b00a2f6408c5bfbb932d8cee35a62b66a (diff)
Simplification and better output of statistics dialogs.
Change-Id: Ia21bb07f7721a7697807f8ee98706bd3fc136653
Diffstat (limited to 'sc/source/ui/StatisticsDialogs/ExponentialSmoothingDialog.cxx')
-rw-r--r--sc/source/ui/StatisticsDialogs/ExponentialSmoothingDialog.cxx29
1 files changed, 21 insertions, 8 deletions
diff --git a/sc/source/ui/StatisticsDialogs/ExponentialSmoothingDialog.cxx b/sc/source/ui/StatisticsDialogs/ExponentialSmoothingDialog.cxx
index 34cfcf477e64..9e4cb9bf8978 100644
--- a/sc/source/ui/StatisticsDialogs/ExponentialSmoothingDialog.cxx
+++ b/sc/source/ui/StatisticsDialogs/ExponentialSmoothingDialog.cxx
@@ -45,19 +45,24 @@ sal_Bool ScExponentialSmoothingDialog::Close()
return DoClose( ScExponentialSmoothingDialogWrapper::GetChildWindowId() );
}
-void ScExponentialSmoothingDialog::CalculateInputAndWriteToOutput( )
+sal_Int16 ScExponentialSmoothingDialog::GetUndoNameId()
{
- OUString aUndo(SC_STRLOAD(RID_STATISTICS_DLGS, STR_EXPONENTIAL_SMOOTHING_UNDO_NAME));
- ScDocShell* pDocShell = mViewData->GetDocShell();
- svl::IUndoManager* pUndoManager = pDocShell->GetUndoManager();
- pUndoManager->EnterListAction( aUndo, aUndo );
+ return STR_EXPONENTIAL_SMOOTHING_UNDO_NAME;
+}
+ScRange ScExponentialSmoothingDialog::ApplyOutput(ScDocShell* pDocShell)
+{
AddressWalkerWriter output(mOutputAddress, pDocShell, mDocument);
FormulaTemplate aTemplate(mDocument, mAddressDetails);
// Smoothing factor
double aSmoothingFactor = mpSmoothingFactor->GetValue() / 100.0;
+ // Alpha
+ output.writeBoldString("Alpha");
+ output.nextRow();
+
+ // Alpha Value
ScAddress aSmoothingFactorAddress = output.current();
output.writeValue(aSmoothingFactor);
output.nextRow();
@@ -77,6 +82,16 @@ void ScExponentialSmoothingDialog::CalculateInputAndWriteToOutput( )
ScRange aCurrentRange = pIterator->get();
+ // Write column label
+ if (mGroupedBy == BY_COLUMN)
+ aTemplate.setTemplate("Column %NUMBER%");
+ else
+ aTemplate.setTemplate("Row %NUMBER%");
+ aTemplate.applyNumber("%NUMBER%", pIterator->index() + 1);
+ output.writeBoldString(aTemplate.getTemplate());
+ output.nextRow();
+
+ // Initial value
if (false)
{
aTemplate.setTemplate("=AVERAGE(%RANGE%)");
@@ -107,9 +122,7 @@ void ScExponentialSmoothingDialog::CalculateInputAndWriteToOutput( )
output.nextColumn();
}
- pUndoManager->LeaveListAction();
- ScRange aOutputRange(output.mMinimumAddress, output.mMaximumAddress);
- pDocShell->PostPaint( aOutputRange, PAINT_GRID );
+ return ScRange (output.mMinimumAddress, output.mMaximumAddress);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */