Kaydet (Commit) aaa689d9 authored tarafından Tomaž Vajngerl's avatar Tomaž Vajngerl

Add GroupedBy: Columns/Rows to Correlation and Covariance.

Change-Id: I7bb3b7151abda8e977cbdbec2d0c356f049d5af2
üst dbd3da10
...@@ -8,150 +8,61 @@ ...@@ -8,150 +8,61 @@
* *
*/ */
#include <sfx2/dispatch.hxx>
#include <svl/zforlist.hxx>
#include <svl/undo.hxx>
#include "formulacell.hxx"
#include "rangelst.hxx"
#include "scitems.hxx"
#include "docsh.hxx" #include "docsh.hxx"
#include "document.hxx"
#include "uiitems.hxx"
#include "reffact.hxx" #include "reffact.hxx"
#include "strload.hxx"
#include "random.hxx"
#include "docfunc.hxx"
#include "StatisticsDialogs.hrc"
#include "CorrelationDialog.hxx" #include "CorrelationDialog.hxx"
namespace namespace
{ {
static const OUString strCorrelationLabel("Correlations");
static const OUString lclWildcardColumn1("%COLUMN1%"); static const OUString strCorrelationTemplate("=CORREL(%VAR1%; %VAR2%)");
static const OUString lclWildcardColumn2("%COLUMN2%");
static const OUString lclCorrelTemplate("=CORREL(%COLUMN1%, %COLUMN2%)");
static const OUString lclWildcardNumber("%NUMBER%");
static const OUString lclColumnLabelTemplate("Column %NUMBER%");
} }
ScCorrelationDialog::ScCorrelationDialog( ScCorrelationDialog::ScCorrelationDialog(
SfxBindings* pSfxBindings, SfxChildWindow* pChildWindow, SfxBindings* pSfxBindings, SfxChildWindow* pChildWindow,
Window* pParent, ScViewData* pViewData ) : Window* pParent, ScViewData* pViewData ) :
ScStatisticsInputOutputDialog( ScMatrixComparisonGenerator(
pSfxBindings, pChildWindow, pParent, pViewData, pSfxBindings, pChildWindow, pParent, pViewData,
"DescriptiveStatisticsDialog", "modules/scalc/ui/descriptivestatisticsdialog.ui" ) "CorrelationDialog", "modules/scalc/ui/correlationdialog.ui" )
{} {
get(mpGroupByColumnsRadio, "groupedby-columns-radio");
get(mpGroupByRowsRadio, "groupedby-rows-radio");
mpGroupByColumnsRadio->SetToggleHdl( LINK( this, ScCorrelationDialog, GroupByChanged ) );
mpGroupByRowsRadio->SetToggleHdl( LINK( this, ScCorrelationDialog, GroupByChanged ) );
ScCorrelationDialog::~ScCorrelationDialog() mpGroupByColumnsRadio->Check(true);
{} }
sal_Bool ScCorrelationDialog::Close() sal_Bool ScCorrelationDialog::Close()
{ {
return DoClose( ScCorrelationDialogWrapper::GetChildWindowId() ); return DoClose( ScCorrelationDialogWrapper::GetChildWindowId() );
} }
void ScCorrelationDialog::CalculateInputAndWriteToOutput( ) const OUString& ScCorrelationDialog::getLabel()
{ {
OUString aUndo( SC_STRLOAD( RID_STATISTICS_DLGS, STR_CORRELATION_UNDO_NAME)); return strCorrelationLabel;
ScDocShell* pDocShell = mViewData->GetDocShell();
svl::IUndoManager* pUndoManager = pDocShell->GetUndoManager();
pUndoManager->EnterListAction( aUndo, aUndo );
ScAddress aStart = mInputRange.aStart;
ScAddress aEnd = mInputRange.aEnd;
SCTAB outTab = mOutputAddress.Tab();
SCCOL outCol = mOutputAddress.Col();
SCROW outRow = mOutputAddress.Row();
ScAddress aAddress;
SCCOL aMaxCol = 0;
SCROW aMaxRow = 0;
for (SCTAB inTab = aStart.Tab(); inTab <= aEnd.Tab(); inTab++)
{
ScRangeList aRangeList = MakeColumnRangeList(inTab, aStart, aEnd);
// column labels
aAddress = ScAddress(outCol, outRow, outTab);
pDocShell->GetDocFunc().SetStringCell(aAddress, OUString("Correlations"), true);
outCol++;
aMaxCol = outCol > aMaxCol ? outCol : aMaxCol;
// write labels to columns
for (size_t i = 0; i < aRangeList.size(); i++)
{
aAddress = ScAddress(outCol, outRow, outTab);
OUString aColumnLabel = lclColumnLabelTemplate.replaceAll(lclWildcardNumber, OUString::number(i + 1));
pDocShell->GetDocFunc().SetStringCell(aAddress, aColumnLabel, true);
outCol++;
aMaxCol = outCol > aMaxCol ? outCol : aMaxCol;
}
// write labels to rows
outCol = mOutputAddress.Col();
outRow++;
for (size_t i = 0; i < aRangeList.size(); i++)
{
aAddress = ScAddress(outCol, outRow, outTab);
OUString aColumnLabel = lclColumnLabelTemplate.replaceAll(lclWildcardNumber, OUString::number(i + 1));
pDocShell->GetDocFunc().SetStringCell(aAddress, aColumnLabel, true);
outRow++;
aMaxRow = outRow > aMaxRow ? outRow : aMaxRow;
}
// write correlation formulas
aAddress = ScAddress(
mOutputAddress.Col() + 1,
mOutputAddress.Row() + 1,
inTab);
WriteCorrelationFormulas(aAddress, aRangeList);
outTab++;
}
ScAddress aLastAddress = ScAddress(
mOutputAddress.Col() + aMaxCol,
mOutputAddress.Row() + aMaxRow,
outTab);
ScRange aOutputRange(mOutputAddress, aLastAddress);
pUndoManager->LeaveListAction();
pDocShell->PostPaint(aOutputRange, PAINT_GRID);
} }
void ScCorrelationDialog::WriteCorrelationFormulas(ScAddress aOutputAddress, ScRangeList aRangeList) const OUString& ScCorrelationDialog::getTemplate()
{ {
ScDocShell* pDocShell = mViewData->GetDocShell(); return strCorrelationTemplate;
ScAddress aAddress; }
SCTAB outTab = aOutputAddress.Tab();
SCCOL outCol = aOutputAddress.Col();
OUString aFormulaString; ScMatrixComparisonGenerator::GroupedBy ScCorrelationDialog::getGroupedBy()
{
return mGroupedBy;
}
for (size_t i = 0; i < aRangeList.size(); i++) IMPL_LINK_NOARG(ScCorrelationDialog, GroupByChanged)
{ {
SCROW outRow = aOutputAddress.Row(); if (mpGroupByColumnsRadio->IsChecked())
for (size_t j = 0; j < aRangeList.size(); j++) mGroupedBy = BY_COLUMN;
{ else if (mpGroupByRowsRadio->IsChecked())
if (j >= i) mGroupedBy = BY_ROW;
{
OUString aColumnString1(aRangeList[i]->Format(SCR_ABS, mDocument, mAddressDetails));
OUString aColumnString2(aRangeList[j]->Format(SCR_ABS, mDocument, mAddressDetails));
aAddress = ScAddress(outCol, outRow, outTab); return 0;
aFormulaString = lclCorrelTemplate.replaceAll(lclWildcardColumn1, aColumnString1);
aFormulaString = aFormulaString.replaceAll(lclWildcardColumn2, aColumnString2);
pDocShell->GetDocFunc().SetFormulaCell(aAddress, new ScFormulaCell(mDocument, aAddress, aFormulaString), true);
}
outRow++;
}
outCol++;
}
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -8,149 +8,61 @@ ...@@ -8,149 +8,61 @@
* *
*/ */
#include <sfx2/dispatch.hxx>
#include <svl/zforlist.hxx>
#include <svl/undo.hxx>
#include "formulacell.hxx"
#include "rangelst.hxx"
#include "scitems.hxx"
#include "docsh.hxx" #include "docsh.hxx"
#include "document.hxx"
#include "uiitems.hxx"
#include "reffact.hxx" #include "reffact.hxx"
#include "strload.hxx"
#include "random.hxx"
#include "docfunc.hxx"
#include "StatisticsDialogs.hrc"
#include "CovarianceDialog.hxx" #include "CovarianceDialog.hxx"
namespace namespace
{ {
static const OUString strCovarianceLabel("Covariances");
static const OUString lclWildcardRow1("%ROW1%"); static const OUString strCovarianceTemplate("=COVAR(%VAR1%; %VAR2%)");
static const OUString lclWildcardRow2("%ROW2%");
static const OUString lclCovarTemplate("=COVAR(%ROW1%, %ROW2%)");
static const OUString lclWildcardNumber("%NUMBER%");
static const OUString lclRowLabelTemplate("Row %NUMBER%");
} }
ScCovarianceDialog::ScCovarianceDialog( ScCovarianceDialog::ScCovarianceDialog(
SfxBindings* pSfxBindings, SfxChildWindow* pChildWindow, SfxBindings* pSfxBindings, SfxChildWindow* pChildWindow,
Window* pParent, ScViewData* pViewData ) : Window* pParent, ScViewData* pViewData ) :
ScStatisticsInputOutputDialog( ScMatrixComparisonGenerator(
pSfxBindings, pChildWindow, pParent, pViewData, pSfxBindings, pChildWindow, pParent, pViewData,
"DescriptiveStatisticsDialog", "modules/scalc/ui/descriptivestatisticsdialog.ui" ) "CovarianceDialog", "modules/scalc/ui/covariancedialog.ui" )
{} {
get(mpGroupByColumnsRadio, "groupedby-columns-radio");
get(mpGroupByRowsRadio, "groupedby-rows-radio");
mpGroupByColumnsRadio->SetToggleHdl( LINK( this, ScCovarianceDialog, GroupByChanged ) );
mpGroupByRowsRadio->SetToggleHdl( LINK( this, ScCovarianceDialog, GroupByChanged ) );
ScCovarianceDialog::~ScCovarianceDialog() mpGroupByColumnsRadio->Check(true);
{} }
sal_Bool ScCovarianceDialog::Close() sal_Bool ScCovarianceDialog::Close()
{ {
return DoClose( ScCovarianceDialogWrapper::GetChildWindowId() ); return DoClose( ScCovarianceDialogWrapper::GetChildWindowId() );
} }
void ScCovarianceDialog::CalculateInputAndWriteToOutput( ) const OUString& ScCovarianceDialog::getLabel()
{ {
OUString aUndo( SC_STRLOAD( RID_STATISTICS_DLGS, STR_COVARIANCE_UNDO_NAME)); return strCovarianceLabel;
ScDocShell* pDocShell = mViewData->GetDocShell();
svl::IUndoManager* pUndoManager = pDocShell->GetUndoManager();
pUndoManager->EnterListAction( aUndo, aUndo );
ScAddress aStart = mInputRange.aStart;
ScAddress aEnd = mInputRange.aEnd;
SCTAB outTab = mOutputAddress.Tab();
SCCOL outCol = mOutputAddress.Col();
SCROW outRow = mOutputAddress.Row();
ScAddress aAddress;
SCCOL aMaxCol = 0;
SCROW aMaxRow = 0;
for (SCTAB inTab = aStart.Tab(); inTab <= aEnd.Tab(); inTab++)
{
ScRangeList aRangeList = MakeRowRangeList(inTab, aStart, aEnd);
// row labels
aAddress = ScAddress(outCol, outRow, outTab);
pDocShell->GetDocFunc().SetStringCell(aAddress, OUString("Covariances"), true);
outCol++;
aMaxCol = outCol > aMaxCol ? outCol : aMaxCol;
// write labels to columns
for (size_t i = 0; i < aRangeList.size(); i++)
{
aAddress = ScAddress(outCol, outRow, outTab);
OUString aRowLabel = lclRowLabelTemplate.replaceAll(lclWildcardNumber, OUString::number(i + 1));
pDocShell->GetDocFunc().SetStringCell(aAddress, aRowLabel, true);
outCol++;
aMaxCol = outCol > aMaxCol ? outCol : aMaxCol;
}
// write labels to rows
outCol = mOutputAddress.Col();
outRow++;
for (size_t i = 0; i < aRangeList.size(); i++)
{
aAddress = ScAddress(outCol, outRow, outTab);
OUString aRowLabel = lclRowLabelTemplate.replaceAll(lclWildcardNumber, OUString::number(i + 1));
pDocShell->GetDocFunc().SetStringCell(aAddress, aRowLabel, true);
outRow++;
aMaxRow = outRow > aMaxRow ? outRow : aMaxRow;
}
// write correlation formulas
aAddress = ScAddress(
mOutputAddress.Col() + 1,
mOutputAddress.Row() + 1,
inTab);
WriteCovarianceFormulas(aAddress, aRangeList);
outTab++;
}
ScAddress aLastAddress = ScAddress(
mOutputAddress.Col() + aMaxCol,
mOutputAddress.Row() + aMaxRow,
outTab);
ScRange aOutputRange(mOutputAddress, aLastAddress);
pUndoManager->LeaveListAction();
pDocShell->PostPaint(aOutputRange, PAINT_GRID);
} }
void ScCovarianceDialog::WriteCovarianceFormulas(ScAddress aOutputAddress, ScRangeList aRangeList) const OUString& ScCovarianceDialog::getTemplate()
{ {
ScDocShell* pDocShell = mViewData->GetDocShell(); return strCovarianceTemplate;
ScAddress aAddress; }
SCTAB outTab = aOutputAddress.Tab();
SCCOL outCol = aOutputAddress.Col();
OUString aFormulaString; ScMatrixComparisonGenerator::GroupedBy ScCovarianceDialog::getGroupedBy()
{
return mGroupedBy;
}
for (size_t i = 0; i < aRangeList.size(); i++) IMPL_LINK_NOARG(ScCovarianceDialog, GroupByChanged)
{ {
SCROW outRow = aOutputAddress.Row(); if (mpGroupByColumnsRadio->IsChecked())
for (size_t j = 0; j < aRangeList.size(); j++) mGroupedBy = BY_COLUMN;
{ else if (mpGroupByRowsRadio->IsChecked())
if (j >= i) mGroupedBy = BY_ROW;
{
OUString aRowString1(aRangeList[i]->Format(SCR_ABS, mDocument, mAddressDetails));
OUString aRowString2(aRangeList[j]->Format(SCR_ABS, mDocument, mAddressDetails));
aAddress = ScAddress(outCol, outRow, outTab); return 0;
aFormulaString = lclCovarTemplate.replaceAll(lclWildcardRow1, aRowString1);
aFormulaString = aFormulaString.replaceAll(lclWildcardRow2, aRowString2);
pDocShell->GetDocFunc().SetFormulaCell(aAddress, new ScFormulaCell(mDocument, aAddress, aFormulaString), true);
}
outRow++;
}
outCol++;
}
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
*/
#include <sfx2/dispatch.hxx>
#include <svl/zforlist.hxx>
#include <svl/undo.hxx>
#include "formulacell.hxx"
#include "rangelst.hxx"
#include "scitems.hxx"
#include "docsh.hxx"
#include "document.hxx"
#include "uiitems.hxx"
#include "reffact.hxx"
#include "scresid.hxx"
#include "random.hxx"
#include "docfunc.hxx"
#include "globstr.hrc"
#include "sc.hrc"
#include "MatrixComparisonGenerator.hxx"
namespace
{
static const OUString strWildcard1("%VAR1%");
static const OUString strWildcard2("%VAR2%");
static const OUString strWildcardNumber("%NUMBER%");
static const OUString strColumnLabelTemplate("Column %NUMBER%");
static const OUString strRowLabelTemplate("Row %NUMBER%");
}
ScMatrixComparisonGenerator::ScMatrixComparisonGenerator(
SfxBindings* pSfxBindings, SfxChildWindow* pChildWindow,
Window* pParent, ScViewData* pViewData, const OString& rID,
const OUString& rUiXmlDescription ) :
ScStatisticsInputOutputDialog(pSfxBindings, pChildWindow, pParent, pViewData, rID, rUiXmlDescription)
{}
ScMatrixComparisonGenerator::~ScMatrixComparisonGenerator()
{}
void ScMatrixComparisonGenerator::CalculateInputAndWriteToOutput( )
{
OUString aUndo(SC_STRLOAD( RID_STATISTICS_DLGS, STR_CORRELATION_UNDO_NAME));
ScDocShell* pDocShell = mViewData->GetDocShell();
svl::IUndoManager* pUndoManager = pDocShell->GetUndoManager();
pUndoManager->EnterListAction( aUndo, aUndo );
ScAddress aStart = mInputRange.aStart;
ScAddress aEnd = mInputRange.aEnd;
SCTAB outTab = mOutputAddress.Tab();
SCCOL outCol = mOutputAddress.Col();
SCROW outRow = mOutputAddress.Row();
ScAddress aAddress;
SCCOL aMaxCol = 0;
SCROW aMaxRow = 0;
SCTAB inTab = aStart.Tab();
ScRangeList aRangeList;
if (getGroupedBy() == BY_COLUMN)
aRangeList = MakeColumnRangeList(inTab, aStart, aEnd);
else
aRangeList = MakeRowRangeList(inTab, aStart, aEnd);
// labels
aAddress = ScAddress(outCol, outRow, outTab);
pDocShell->GetDocFunc().SetStringCell(aAddress, getLabel(), true);
outCol++;
aMaxCol = outCol > aMaxCol ? outCol : aMaxCol;
// write labels to columns
for (size_t i = 0; i < aRangeList.size(); i++)
{
aAddress = ScAddress(outCol, outRow, outTab);
OUString aLabel;
if (getGroupedBy() == BY_COLUMN)
aLabel = strColumnLabelTemplate.replaceAll(strWildcardNumber, OUString::number(i + 1));
else
aLabel = strRowLabelTemplate.replaceAll(strWildcardNumber, OUString::number(i + 1));
pDocShell->GetDocFunc().SetStringCell(aAddress, aLabel, true);
outCol++;
aMaxCol = outCol > aMaxCol ? outCol : aMaxCol;
}
// write labels to rows
outCol = mOutputAddress.Col();
outRow++;
for (size_t i = 0; i < aRangeList.size(); i++)
{
aAddress = ScAddress(outCol, outRow, outTab);
OUString aLabel;
if (getGroupedBy() == BY_COLUMN)
aLabel = strColumnLabelTemplate.replaceAll(strWildcardNumber, OUString::number(i + 1));
else
aLabel = strRowLabelTemplate.replaceAll(strWildcardNumber, OUString::number(i + 1));
pDocShell->GetDocFunc().SetStringCell(aAddress, aLabel, true);
outRow++;
aMaxRow = outRow > aMaxRow ? outRow : aMaxRow;
}
// write correlation formulas
aAddress = ScAddress(
mOutputAddress.Col() + 1,
mOutputAddress.Row() + 1,
inTab);
if (getGroupedBy() == BY_COLUMN)
writeCorrelationFormulasByColumn(aAddress, aRangeList);
else
writeCorrelationFormulasByRow(aAddress, aRangeList);
ScAddress aLastAddress = ScAddress(
mOutputAddress.Col() + aMaxCol,
mOutputAddress.Row() + aMaxRow,
outTab);
ScRange aOutputRange(mOutputAddress, aLastAddress);
pUndoManager->LeaveListAction();
pDocShell->PostPaint(aOutputRange, PAINT_GRID);
}
void ScMatrixComparisonGenerator::writeCorrelationFormulasByColumn(ScAddress aOutputAddress, ScRangeList aRangeList)
{
ScDocShell* pDocShell = mViewData->GetDocShell();
ScAddress aAddress;
SCTAB outTab = aOutputAddress.Tab();
SCCOL outCol = aOutputAddress.Col();
OUString aFormulaString;
const OUString& aTemplate = getTemplate();
for (size_t i = 0; i < aRangeList.size(); i++)
{
SCROW outRow = aOutputAddress.Row();
for (size_t j = 0; j < aRangeList.size(); j++)
{
if (j >= i)
{
OUString aString1(aRangeList[i]->Format(SCR_ABS, mDocument, mAddressDetails));
OUString aString2(aRangeList[j]->Format(SCR_ABS, mDocument, mAddressDetails));
aAddress = ScAddress(outCol, outRow, outTab);
aFormulaString = aTemplate.replaceAll(strWildcard1, aString1);
aFormulaString = aFormulaString.replaceAll(strWildcard2, aString2);
pDocShell->GetDocFunc().SetFormulaCell(aAddress, new ScFormulaCell(mDocument, aAddress, aFormulaString), true);
}
outRow++;
}
outCol++;
}
}
void ScMatrixComparisonGenerator::writeCorrelationFormulasByRow(ScAddress aOutputAddress, ScRangeList aRangeList)
{
ScDocShell* pDocShell = mViewData->GetDocShell();
ScAddress aAddress;
SCTAB outTab = aOutputAddress.Tab();
SCCOL outCol = aOutputAddress.Col();
OUString aFormulaString;
const OUString& aTemplate = getTemplate();
for (size_t i = 0; i < aRangeList.size(); i++)
{
SCROW outRow = aOutputAddress.Row();
for (size_t j = 0; j < aRangeList.size(); j++)
{
if (j >= i)
{
OUString aString1(aRangeList[i]->Format(SCR_ABS, mDocument, mAddressDetails));
OUString aString2(aRangeList[j]->Format(SCR_ABS, mDocument, mAddressDetails));
aAddress = ScAddress(outCol, outRow, outTab);
aFormulaString = aTemplate.replaceAll(strWildcard1, aString1);
aFormulaString = aFormulaString.replaceAll(strWildcard2, aString2);
pDocShell->GetDocFunc().SetFormulaCell(aAddress, new ScFormulaCell(mDocument, aAddress, aFormulaString), true);
}
outRow++;
}
outCol++;
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -11,32 +11,31 @@ ...@@ -11,32 +11,31 @@
#ifndef CORRELATION_DIALOG_HXX #ifndef CORRELATION_DIALOG_HXX
#define CORRELATION_DIALOG_HXX #define CORRELATION_DIALOG_HXX
#include "global.hxx" #include "MatrixComparisonGenerator.hxx"
#include "address.hxx"
#include "anyrefdg.hxx"
#include <vcl/fixed.hxx> class ScCorrelationDialog : public ScMatrixComparisonGenerator
#include <vcl/group.hxx> {
#include <vcl/lstbox.hxx> private:
RadioButton* mpGroupByColumnsRadio;
RadioButton* mpGroupByRowsRadio;
GroupedBy mGroupedBy;
#include "StatisticsInputOutputDialog.hxx" DECL_LINK( GroupByChanged, void* );
class ScCorrelationDialog : public ScStatisticsInputOutputDialog
{
public: public:
ScCorrelationDialog( ScCorrelationDialog(
SfxBindings* pB, SfxChildWindow* pCW, SfxBindings* pSfxBindings, SfxChildWindow* pChildWindow,
Window* pParent, ScViewData* pViewData ); Window* pParent, ScViewData* pViewData);
virtual ~ScCorrelationDialog();
virtual sal_Bool Close(); virtual sal_Bool Close();
protected: protected:
virtual void CalculateInputAndWriteToOutput(); virtual const OUString& getLabel();
void WriteCorrelationFormulas(ScAddress aOutputAddress, ScRangeList aRangeList); virtual const OUString& getTemplate();
virtual GroupedBy getGroupedBy();
}; };
#endif #endif
......
...@@ -11,30 +11,28 @@ ...@@ -11,30 +11,28 @@
#ifndef COVARIANCE_DIALOG_HXX #ifndef COVARIANCE_DIALOG_HXX
#define COVARIANCE_DIALOG_HXX #define COVARIANCE_DIALOG_HXX
#include "global.hxx" #include "MatrixComparisonGenerator.hxx"
#include "address.hxx"
#include "anyrefdg.hxx"
#include <vcl/fixed.hxx> class ScCovarianceDialog : public ScMatrixComparisonGenerator
#include <vcl/group.hxx> {
#include <vcl/lstbox.hxx> private:
RadioButton* mpGroupByColumnsRadio;
RadioButton* mpGroupByRowsRadio;
GroupedBy mGroupedBy;
#include "StatisticsInputOutputDialog.hxx" DECL_LINK( GroupByChanged, void* );
class ScCovarianceDialog : public ScStatisticsInputOutputDialog
{
public: public:
ScCovarianceDialog( ScCovarianceDialog(
SfxBindings* pB, SfxChildWindow* pCW, SfxBindings* pSfxBindings, SfxChildWindow* pChildWindow,
Window* pParent, ScViewData* pViewData ); Window* pParent, ScViewData* pViewData);
virtual ~ScCovarianceDialog();
virtual sal_Bool Close(); virtual sal_Bool Close();
protected: protected:
virtual void CalculateInputAndWriteToOutput(); virtual const OUString& getLabel();
void WriteCovarianceFormulas(ScAddress aOutputAddress, ScRangeList aRangeList); virtual const OUString& getTemplate();
virtual GroupedBy getGroupedBy();
}; };
#endif #endif
......
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
*/
#ifndef MATRIX_COMPARISON_GENERATOR_HXX
#define MATRIX_COMPARISON_GENERATOR_HXX
#include "global.hxx"
#include "address.hxx"
#include "anyrefdg.hxx"
#include <vcl/fixed.hxx>
#include <vcl/group.hxx>
#include <vcl/lstbox.hxx>
#include "StatisticsInputOutputDialog.hxx"
class ScMatrixComparisonGenerator : public ScStatisticsInputOutputDialog
{
public:
ScMatrixComparisonGenerator(
SfxBindings* pSfxBindings, SfxChildWindow* pChildWindow,
Window* pParent, ScViewData* pViewData,
const OString& rID, const OUString& rUiXmlDescription );
virtual ~ScMatrixComparisonGenerator();
enum GroupedBy {
BY_COLUMN,
BY_ROW
};
protected:
virtual void CalculateInputAndWriteToOutput();
virtual const OUString& getLabel() = 0;
virtual const OUString& getTemplate() = 0;
virtual GroupedBy getGroupedBy() = 0;
void writeCorrelationFormulasByColumn(ScAddress aOutputAddress, ScRangeList aRangeList);
void writeCorrelationFormulasByRow(ScAddress aOutputAddress, ScRangeList aRangeList);
};
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment