diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.com> | 2014-04-19 20:15:35 +0200 |
---|---|---|
committer | Tomaž Vajngerl <tomaz.vajngerl@collabora.com> | 2014-04-24 22:51:11 +0200 |
commit | 3ce1b10ba72331b5bd7af601dec404e0d920769c (patch) | |
tree | c1c31f71480822869293786626f5a9c2a629febe /sc | |
parent | 8b84408ebddb481cd31aea663cf17ed5819b58cc (diff) |
sc: Add F-Test to Statistics
Change-Id: I31281e863d82a211d7cca897f3e65a0ecfcb5f6b
Diffstat (limited to 'sc')
-rw-r--r-- | sc/Library_sc.mk | 1 | ||||
-rw-r--r-- | sc/inc/sc.hrc | 1 | ||||
-rw-r--r-- | sc/sdi/cellsh.sdi | 1 | ||||
-rw-r--r-- | sc/sdi/scalc.sdi | 23 | ||||
-rw-r--r-- | sc/source/ui/StatisticsDialogs/FTestDialog.cxx | 203 | ||||
-rw-r--r-- | sc/source/ui/StatisticsDialogs/StatisticsDialogs.hrc | 43 | ||||
-rw-r--r-- | sc/source/ui/StatisticsDialogs/StatisticsDialogs.src | 35 | ||||
-rw-r--r-- | sc/source/ui/app/scdll.cxx | 1 | ||||
-rw-r--r-- | sc/source/ui/inc/FTestDialog.hxx | 35 | ||||
-rw-r--r-- | sc/source/ui/inc/reffact.hxx | 7 | ||||
-rw-r--r-- | sc/source/ui/view/cellsh1.cxx | 10 | ||||
-rw-r--r-- | sc/source/ui/view/tabvwsh.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/tabvwshc.cxx | 7 | ||||
-rw-r--r-- | sc/uiconfig/scalc/menubar/menubar.xml | 1 |
14 files changed, 352 insertions, 18 deletions
diff --git a/sc/Library_sc.mk b/sc/Library_sc.mk index 3063b56a052c..eb4ace5f0432 100644 --- a/sc/Library_sc.mk +++ b/sc/Library_sc.mk @@ -496,6 +496,7 @@ $(eval $(call gb_Library_add_exception_objects,sc,\ sc/source/ui/StatisticsDialogs/CovarianceDialog \ sc/source/ui/StatisticsDialogs/DescriptiveStatisticsDialog \ sc/source/ui/StatisticsDialogs/ExponentialSmoothingDialog \ + sc/source/ui/StatisticsDialogs/FTestDialog \ sc/source/ui/StatisticsDialogs/MatrixComparisonGenerator \ sc/source/ui/StatisticsDialogs/MovingAverageDialog \ sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog \ diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc index 507255bdb384..757931f7914f 100644 --- a/sc/inc/sc.hrc +++ b/sc/inc/sc.hrc @@ -269,6 +269,7 @@ #define SID_EXPONENTIAL_SMOOTHING_DIALOG (SC_MESSAGE_START + 76) #define SID_MOVING_AVERAGE_DIALOG (SC_MESSAGE_START + 77) #define SID_TTEST_DIALOG (SC_MESSAGE_START + 78) +#define SID_FTEST_DIALOG (SC_MESSAGE_START + 79) // functions diff --git a/sc/sdi/cellsh.sdi b/sc/sdi/cellsh.sdi index 65ff8994e8e8..b77b4f88cca8 100644 --- a/sc/sdi/cellsh.sdi +++ b/sc/sdi/cellsh.sdi @@ -159,6 +159,7 @@ interface CellSelection SID_EXPONENTIAL_SMOOTHING_DIALOG [ ExecMethod = ExecuteEdit; StateMethod = GetBlockState; ] SID_MOVING_AVERAGE_DIALOG [ ExecMethod = ExecuteEdit; StateMethod = GetBlockState; ] SID_TTEST_DIALOG [ ExecMethod = ExecuteEdit; StateMethod = GetBlockState; ] + SID_FTEST_DIALOG [ ExecMethod = ExecuteEdit; StateMethod = GetBlockState; ] SID_MARKDATAAREA [ ExecMethod = ExecuteMove; StateMethod = GetStateCursor; ] SID_MARKARRAYFORMULA [ ExecMethod = ExecuteMove; StateMethod = GetStateCursor; ] SID_SETINPUTMODE [ ExecMethod = ExecuteMove; StateMethod = GetStateCursor; ] diff --git a/sc/sdi/scalc.sdi b/sc/sdi/scalc.sdi index fac4558e9d40..d260cdae945b 100644 --- a/sc/sdi/scalc.sdi +++ b/sc/sdi/scalc.sdi @@ -3158,6 +3158,29 @@ SfxVoidItem TTestDialog SID_TTEST_DIALOG GroupId = GID_OPTIONS; ] +SfxVoidItem FTestDialog SID_FTEST_DIALOG +() +[ + /* flags: */ + AutoUpdate = FALSE, + Cachable = Cachable, + FastCall = FALSE, + HasCoreId = FALSE, + HasDialog = TRUE, + ReadOnlyDoc = TRUE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + Synchron; + + /* config: */ + AccelConfig = TRUE, + MenuConfig = TRUE, + StatusBarConfig = FALSE, + ToolBoxConfig = TRUE, + GroupId = GID_OPTIONS; +] SfxVoidItem SolverDialog SID_OPENDLG_OPTSOLVER () diff --git a/sc/source/ui/StatisticsDialogs/FTestDialog.cxx b/sc/source/ui/StatisticsDialogs/FTestDialog.cxx new file mode 100644 index 000000000000..c573f718fd8d --- /dev/null +++ b/sc/source/ui/StatisticsDialogs/FTestDialog.cxx @@ -0,0 +1,203 @@ +/* -*- 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 <boost/random.hpp> +#include <boost/scoped_ptr.hpp> + +#include "formulacell.hxx" +#include "rangelst.hxx" +#include "scitems.hxx" +#include "docsh.hxx" +#include "document.hxx" +#include "uiitems.hxx" +#include "reffact.hxx" +#include "strload.hxx" +#include "random.hxx" +#include "docfunc.hxx" +#include "StatisticsDialogs.hrc" +#include "TableFillingAndNavigationTools.hxx" + +#include "FTestDialog.hxx" + +namespace +{ + +static const OUString strWildcardVariable1Range("%VAR1_RANGE%"); +static const OUString strWildcardVariable2Range("%VAR2_RANGE%"); + +} + +ScFTestDialog::ScFTestDialog( + SfxBindings* pSfxBindings, SfxChildWindow* pChildWindow, + Window* pParent, ScViewData* pViewData ) : + ScStatisticsTwoVariableDialog( + pSfxBindings, pChildWindow, pParent, pViewData, + "TTestDialog", "modules/scalc/ui/ttestdialog.ui" ) +{} + +ScFTestDialog::~ScFTestDialog() +{} + +bool ScFTestDialog::Close() +{ + return DoClose( ScFTestDialogWrapper::GetChildWindowId() ); +} + +sal_Int16 ScFTestDialog::GetUndoNameId() +{ + return STR_FTEST_UNDO_NAME; +} + +ScRange ScFTestDialog::ApplyOutput(ScDocShell* pDocShell) +{ + AddressWalkerWriter aOutput(mOutputAddress, pDocShell, mDocument, + formula::FormulaGrammar::mergeToGrammar(formula::FormulaGrammar::GRAM_ENGLISH, mAddressDetails.eConv)); + FormulaTemplate aTemplate(mDocument, mAddressDetails); + + boost::scoped_ptr<DataRangeIterator> pVariable1Iterator; + if (mGroupedBy == BY_COLUMN) + pVariable1Iterator.reset(new DataRangeByColumnIterator(mVariable1Range)); + else + pVariable1Iterator.reset(new DataRangeByRowIterator(mVariable1Range)); + + boost::scoped_ptr<DataRangeIterator> pVariable2Iterator; + if (mGroupedBy == BY_COLUMN) + pVariable2Iterator.reset(new DataRangeByColumnIterator(mVariable2Range)); + else + pVariable2Iterator.reset(new DataRangeByRowIterator(mVariable2Range)); + + aTemplate.autoReplaceRange(strWildcardVariable1Range, pVariable1Iterator->get()); + aTemplate.autoReplaceRange(strWildcardVariable2Range, pVariable2Iterator->get()); + + aOutput.writeBoldString(SC_STRLOAD(RID_STATISTICS_DLGS, STR_FTEST_UNDO_NAME)); + aOutput.resetColumn(); + aOutput.nextRow(); + + aOutput.writeString("Alpha"); + aOutput.nextColumn(); + aOutput.writeValue(0.05); + aTemplate.autoReplaceAddress("%ALPHA%", aOutput.current()); + aOutput.resetColumn(); + aOutput.nextRow(); + + aOutput.nextColumn(); + aOutput.writeBoldString("Variable 1"); + aOutput.nextColumn(); + aOutput.writeBoldString("Variable 2"); + aOutput.resetColumn(); + aOutput.nextRow(); + + aOutput.writeString(SC_STRLOAD(RID_STATISTICS_DLGS, STRID_CALC_MEAN)); + aOutput.nextColumn(); + aTemplate.setTemplate("=AVERAGE(%VAR1_RANGE%)"); + aOutput.writeFormula(aTemplate.getTemplate()); + aOutput.nextColumn(); + aTemplate.setTemplate("=AVERAGE(%VAR2_RANGE%)"); + aOutput.writeFormula(aTemplate.getTemplate()); + aOutput.resetColumn(); + aOutput.nextRow(); + + aOutput.writeString(SC_STRLOAD(RID_STATISTICS_DLGS, STRID_CALC_VARIANCE)); + aOutput.nextColumn(); + aTemplate.setTemplate("=VAR(%VAR1_RANGE%)"); + aOutput.writeFormula(aTemplate.getTemplate()); + aTemplate.autoReplaceAddress("%VAR1_VARIANCE%", aOutput.current()); + aOutput.nextColumn(); + aTemplate.setTemplate("=VAR(%VAR2_RANGE%)"); + aOutput.writeFormula(aTemplate.getTemplate()); + aTemplate.autoReplaceAddress("%VAR2_VARIANCE%", aOutput.current()); + aOutput.resetColumn(); + aOutput.nextRow(); + + aOutput.writeString(SC_STRLOAD(RID_STATISTICS_DLGS, STR_FTEST_OBSERVATIONS_LABEL)); + aOutput.nextColumn(); + aTemplate.setTemplate("=COUNT(%VAR1_RANGE%)"); + aOutput.writeFormula(aTemplate.getTemplate()); + aTemplate.autoReplaceAddress("%VAR1_OBSERVATIONS%", aOutput.current()); + aOutput.nextColumn(); + aTemplate.setTemplate("=COUNT(%VAR2_RANGE%)"); + aOutput.writeFormula(aTemplate.getTemplate()); + aTemplate.autoReplaceAddress("%VAR2_OBSERVATIONS%", aOutput.current()); + aOutput.resetColumn(); + aOutput.nextRow(); + + aOutput.writeString(SC_STRLOAD(RID_STATISTICS_DLGS, STR_ANOVA_LABEL_DF)); + aOutput.nextColumn(); + aTemplate.setTemplate("=%VAR1_OBSERVATIONS% - 1"); + aOutput.writeFormula(aTemplate.getTemplate()); + aTemplate.autoReplaceAddress("%VAR1_DEGREE_OF_FREEDOM%", aOutput.current()); + aOutput.nextColumn(); + aTemplate.setTemplate("=%VAR2_OBSERVATIONS% - 1"); + aOutput.writeFormula(aTemplate.getTemplate()); + aTemplate.autoReplaceAddress("%VAR2_DEGREE_OF_FREEDOM%", aOutput.current()); + aOutput.resetColumn(); + aOutput.nextRow(); + + aOutput.writeString(SC_STRLOAD(RID_STATISTICS_DLGS, STR_ANOVA_LABEL_F)); + aOutput.nextColumn(); + aTemplate.setTemplate("=%VAR1_VARIANCE% / %VAR2_VARIANCE%"); + aOutput.writeFormula(aTemplate.getTemplate()); + aTemplate.autoReplaceAddress("%F_VALUE%", aOutput.current()); + aOutput.resetColumn(); + aOutput.nextRow(); + + aOutput.writeString(SC_STRLOAD(RID_STATISTICS_DLGS, STR_FTEST_P_RIGHT_TAIL)); + aOutput.nextColumn(); + aTemplate.setTemplate("=FDIST(%F_VALUE%; %VAR1_DEGREE_OF_FREEDOM%; %VAR2_DEGREE_OF_FREEDOM%)"); + aOutput.writeFormula(aTemplate.getTemplate()); + aTemplate.autoReplaceAddress("%P_RIGHT_TAIL_VALUE%", aOutput.current()); + aOutput.resetColumn(); + aOutput.nextRow(); + + + aOutput.writeString(SC_STRLOAD(RID_STATISTICS_DLGS, STR_FTEST_F_CRITICAL_RIGHT_TAIL)); + aOutput.nextColumn(); + aTemplate.setTemplate("=FINV(%ALPHA%; %VAR1_DEGREE_OF_FREEDOM%; %VAR2_DEGREE_OF_FREEDOM%)"); + aOutput.writeFormula(aTemplate.getTemplate()); + aOutput.resetColumn(); + aOutput.nextRow(); + + aOutput.writeString(SC_STRLOAD(RID_STATISTICS_DLGS, STR_FTEST_P_LEFT_TAIL)); + aOutput.nextColumn(); + aTemplate.setTemplate("=1 - %P_RIGHT_TAIL_VALUE%"); + aOutput.writeFormula(aTemplate.getTemplate()); + aTemplate.autoReplaceAddress("%P_LEFT_TAIL_VALUE%", aOutput.current()); + aOutput.resetColumn(); + aOutput.nextRow(); + + aOutput.writeString(SC_STRLOAD(RID_STATISTICS_DLGS, STR_FTEST_F_CRITICAL_LEFT_TAIL)); + aOutput.nextColumn(); + aTemplate.setTemplate("=FINV(1-%ALPHA%; %VAR1_DEGREE_OF_FREEDOM%; %VAR2_DEGREE_OF_FREEDOM%)"); + aOutput.writeFormula(aTemplate.getTemplate()); + aOutput.resetColumn(); + aOutput.nextRow(); + + aOutput.writeString(SC_STRLOAD(RID_STATISTICS_DLGS, STR_FTEST_P_TWO_TAIL)); + aOutput.nextColumn(); + aTemplate.setTemplate("=2*MIN(%P_RIGHT_TAIL_VALUE%; %P_LEFT_TAIL_VALUE%)"); + aOutput.writeFormula(aTemplate.getTemplate()); + aOutput.resetColumn(); + aOutput.nextRow(); + + aOutput.writeString(SC_STRLOAD(RID_STATISTICS_DLGS, STR_FTEST_F_CRITICAL_TWO_TAIL)); + aOutput.nextColumn(); + aTemplate.setTemplate("=FINV(1-(%ALPHA%/2); %VAR1_DEGREE_OF_FREEDOM%; %VAR2_DEGREE_OF_FREEDOM%)"); + aOutput.writeFormula(aTemplate.getTemplate()); + aOutput.nextColumn(); + aTemplate.setTemplate("=FINV(%ALPHA%/2; %VAR1_DEGREE_OF_FREEDOM%; %VAR2_DEGREE_OF_FREEDOM%)"); + aOutput.writeFormula(aTemplate.getTemplate()); + + return ScRange(aOutput.mMinimumAddress, aOutput.mMaximumAddress); +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/StatisticsDialogs/StatisticsDialogs.hrc b/sc/source/ui/StatisticsDialogs/StatisticsDialogs.hrc index e697a8cf46d0..df0162af7f32 100644 --- a/sc/source/ui/StatisticsDialogs/StatisticsDialogs.hrc +++ b/sc/source/ui/StatisticsDialogs/StatisticsDialogs.hrc @@ -54,25 +54,34 @@ #define STR_EXPONENTIAL_SMOOTHING_UNDO_NAME 38 #define STR_MOVING_AVERAGE_UNDO_NAME 39 #define STR_TTEST_UNDO_NAME 40 +#define STR_FTEST_UNDO_NAME 41 -#define STR_COLUMN_LABEL_TEMPLATE 41 -#define STR_ROW_LABEL_TEMPLATE 42 +#define STR_COLUMN_LABEL_TEMPLATE 60 +#define STR_ROW_LABEL_TEMPLATE 61 -#define STR_ANOVA_SINGLE_FACTOR_LABEL 43 -#define STR_ANOVA_LABEL_GROUPS 44 -#define STR_ANOVA_LABEL_BETWEEN_GROUPS 45 -#define STR_ANOVA_LABEL_WITHIN_GROUPS 46 -#define STR_ANOVA_LABEL_SOURCE_OF_VARIATION 47 -#define STR_ANOVA_LABEL_SS 48 -#define STR_ANOVA_LABEL_DF 49 -#define STR_ANOVA_LABEL_MS 50 -#define STR_ANOVA_LABEL_F 51 -#define STR_ANOVA_LABEL_P_VALUE 52 -#define STR_ANOVA_LABEL_F_CRITICAL 53 -#define STR_ANOVA_LABEL_TOTAL 54 +#define STR_ANOVA_SINGLE_FACTOR_LABEL 62 +#define STR_ANOVA_LABEL_GROUPS 63 +#define STR_ANOVA_LABEL_BETWEEN_GROUPS 64 +#define STR_ANOVA_LABEL_WITHIN_GROUPS 65 +#define STR_ANOVA_LABEL_SOURCE_OF_VARIATION 66 +#define STR_ANOVA_LABEL_SS 67 +#define STR_ANOVA_LABEL_DF 68 +#define STR_ANOVA_LABEL_MS 69 +#define STR_ANOVA_LABEL_F 70 +#define STR_ANOVA_LABEL_P_VALUE 71 +#define STR_ANOVA_LABEL_F_CRITICAL 72 +#define STR_ANOVA_LABEL_TOTAL 73 -#define STR_CORRELATION_LABEL 55 -#define STR_COVARIANCE_LABEL 56 -#define STR_LABEL_ALPHA 57 +#define STR_CORRELATION_LABEL 80 +#define STR_COVARIANCE_LABEL 81 +#define STR_LABEL_ALPHA 82 + +#define STR_FTEST_OBSERVATIONS_LABEL 90 +#define STR_FTEST_P_RIGHT_TAIL 91 +#define STR_FTEST_F_CRITICAL_RIGHT_TAIL 92 +#define STR_FTEST_P_LEFT_TAIL 93 +#define STR_FTEST_F_CRITICAL_LEFT_TAIL 94 +#define STR_FTEST_P_TWO_TAIL 95 +#define STR_FTEST_F_CRITICAL_TWO_TAIL 96 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/StatisticsDialogs/StatisticsDialogs.src b/sc/source/ui/StatisticsDialogs/StatisticsDialogs.src index 1ab64d5dd88d..df73d6cae2fb 100644 --- a/sc/source/ui/StatisticsDialogs/StatisticsDialogs.src +++ b/sc/source/ui/StatisticsDialogs/StatisticsDialogs.src @@ -268,6 +268,11 @@ Resource RID_STATISTICS_DLGS Text [ en-US ] = "t-test"; }; + String STR_FTEST_UNDO_NAME + { + Text [ en-US ] = "F-test"; + }; + /* Common */ String STR_COLUMN_LABEL_TEMPLATE { @@ -281,6 +286,36 @@ Resource RID_STATISTICS_DLGS { Text [ en-US ] = "Alpha"; }; + + /*F Test */ + String STR_FTEST_OBSERVATIONS_LABEL + { + Text [ en-US ] = "Observations"; + }; + String STR_FTEST_P_RIGHT_TAIL + { + Text [ en-US ] = "P (F<=f) right-tail"; + }; + String STR_FTEST_F_CRITICAL_RIGHT_TAIL + { + Text [ en-US ] = "F Critical right-tail"; + }; + String STR_FTEST_P_LEFT_TAIL + { + Text [ en-US ] = "P (F<=f) left-tail"; + }; + String STR_FTEST_F_CRITICAL_LEFT_TAIL + { + Text [ en-US ] = "F Critical left-tail"; + }; + String STR_FTEST_P_TWO_TAIL + { + Text [ en-US ] = "P two-tail"; + }; + String STR_FTEST_F_CRITICAL_TWO_TAIL + { + Text [ en-US ] = "F Critical two-tail"; + }; }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/app/scdll.cxx b/sc/source/ui/app/scdll.cxx index 6d97e2f2863e..6c10603af426 100644 --- a/sc/source/ui/app/scdll.cxx +++ b/sc/source/ui/app/scdll.cxx @@ -270,6 +270,7 @@ void ScDLL::Init() ScExponentialSmoothingDialogWrapper ::RegisterChildWindow(false, pMod); ScMovingAverageDialogWrapper ::RegisterChildWindow(false, pMod); ScTTestDialogWrapper ::RegisterChildWindow(false, pMod); + ScFTestDialogWrapper ::RegisterChildWindow(false, pMod); // First docking Window for Calc ScFunctionChildWindow ::RegisterChildWindow(false, pMod); diff --git a/sc/source/ui/inc/FTestDialog.hxx b/sc/source/ui/inc/FTestDialog.hxx new file mode 100644 index 000000000000..04b91b12435e --- /dev/null +++ b/sc/source/ui/inc/FTestDialog.hxx @@ -0,0 +1,35 @@ +/* -*- 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 F_TEST_DIALOG_HXX +#define F_TEST_DIALOG_HXX + +#include "StatisticsTwoVariableDialog.hxx" + +class ScFTestDialog : public ScStatisticsTwoVariableDialog +{ +public: + ScFTestDialog( + SfxBindings* pB, SfxChildWindow* pCW, + Window* pParent, ScViewData* pViewData ); + + virtual ~ScFTestDialog(); + + virtual bool Close() SAL_OVERRIDE; + +protected: + virtual sal_Int16 GetUndoNameId() SAL_OVERRIDE; + virtual ScRange ApplyOutput(ScDocShell* pDocShell) SAL_OVERRIDE; +}; + +#endif + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/reffact.hxx b/sc/source/ui/inc/reffact.hxx index e8e264a6d492..2625a7b20358 100644 --- a/sc/source/ui/inc/reffact.hxx +++ b/sc/source/ui/inc/reffact.hxx @@ -114,6 +114,13 @@ private: ScTTestDialogWrapper() SAL_DELETED_FUNCTION; }; +class ScFTestDialogWrapper : + public ChildWindowWrapper<SID_FTEST_DIALOG> +{ +private: + ScFTestDialogWrapper() SAL_DELETED_FUNCTION; +}; + class ScAcceptChgDlgWrapper: public SfxChildWindow { public: diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx index c485a99e1d89..858d1abb30e9 100644 --- a/sc/source/ui/view/cellsh1.cxx +++ b/sc/source/ui/view/cellsh1.cxx @@ -984,6 +984,16 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) } break; + case SID_FTEST_DIALOG: + { + sal_uInt16 nId = ScFTestDialogWrapper::GetChildWindowId(); + SfxViewFrame* pViewFrm = pTabViewShell->GetViewFrame(); + SfxChildWindow* pWnd = pViewFrm->GetChildWindow( nId ); + + pScMod->SetRefDialog( nId, pWnd ? false : sal_True ); + + } + break; // disposal (Outlines) diff --git a/sc/source/ui/view/tabvwsh.cxx b/sc/source/ui/view/tabvwsh.cxx index 3a048d0525c5..7dc93c808bde 100644 --- a/sc/source/ui/view/tabvwsh.cxx +++ b/sc/source/ui/view/tabvwsh.cxx @@ -95,7 +95,7 @@ void ScTabViewShell::InitInterface_Impl() GetStaticInterface()->RegisterChildWindow(ScExponentialSmoothingDialogWrapper::GetChildWindowId()); GetStaticInterface()->RegisterChildWindow(ScMovingAverageDialogWrapper::GetChildWindowId()); GetStaticInterface()->RegisterChildWindow(ScTTestDialogWrapper::GetChildWindowId()); - + GetStaticInterface()->RegisterChildWindow(ScFTestDialogWrapper::GetChildWindowId()); } SFX_IMPL_NAMED_VIEWFACTORY( ScTabViewShell, "Default" ) diff --git a/sc/source/ui/view/tabvwshc.cxx b/sc/source/ui/view/tabvwshc.cxx index 758db9b68850..9d858a658b68 100644 --- a/sc/source/ui/view/tabvwshc.cxx +++ b/sc/source/ui/view/tabvwshc.cxx @@ -67,6 +67,7 @@ #include "ExponentialSmoothingDialog.hxx" #include "MovingAverageDialog.hxx" #include "TTestDialog.hxx" +#include "FTestDialog.hxx" #include "PivotLayoutDialog.hxx" @@ -374,6 +375,12 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog( } break; + case SID_FTEST_DIALOG: + { + pResult = new ScFTestDialog( pB, pCW, pParent, GetViewData() ); + } + break; + case SID_OPENDLG_OPTSOLVER: { ScViewData* pViewData = GetViewData(); diff --git a/sc/uiconfig/scalc/menubar/menubar.xml b/sc/uiconfig/scalc/menubar/menubar.xml index 9e3bd353288b..d2234bf4e81f 100644 --- a/sc/uiconfig/scalc/menubar/menubar.xml +++ b/sc/uiconfig/scalc/menubar/menubar.xml @@ -492,6 +492,7 @@ <menu:menuitem menu:id=".uno:ExponentialSmoothingDialog"/> <menu:menuitem menu:id=".uno:MovingAverageDialog"/> <menu:menuitem menu:id=".uno:TTestDialog"/> + <menu:menuitem menu:id=".uno:FTestDialog"/> </menu:menupopup> </menu:menu> </menu:menupopup> |