summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-05-01 15:46:06 +0100
committerCaolán McNamara <caolanm@redhat.com>2019-05-07 13:08:13 +0200
commitfeecbabd01870ed83a04baa6cb13d7a8af832ac3 (patch)
treeb3eac2bed9c5936287a04badea90a508be57f623 /sc
parentd25fef637897bdf9e680700451e9207ac6aa7cbe (diff)
weld FormulaDialog
drop xFocusWin hack, I don't see what gain it gives Change-Id: I31952b5440797e6209ed1de6b546f1e4c0238d08 Reviewed-on: https://gerrit.libreoffice.org/71675 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/formdlg/formula.cxx17
-rw-r--r--sc/source/ui/inc/formula.hxx9
-rw-r--r--sc/source/ui/view/reffact.cxx4
-rw-r--r--sc/source/ui/view/tabvwshc.cxx14
4 files changed, 17 insertions, 27 deletions
diff --git a/sc/source/ui/formdlg/formula.cxx b/sc/source/ui/formdlg/formula.cxx
index 4dd504d7d809..780bd1d65985 100644
--- a/sc/source/ui/formdlg/formula.cxx
+++ b/sc/source/ui/formdlg/formula.cxx
@@ -56,12 +56,12 @@ using namespace com::sun::star;
// init/ shared functions for dialog
-ScFormulaDlg::ScFormulaDlg( SfxBindings* pB, SfxChildWindow* pCW,
- vcl::Window* pParent, const ScViewData* pViewData, const formula::IFunctionManager* _pFunctionMgr )
- : formula::FormulaDlg( pB, pCW, pParent, _pFunctionMgr,this)
+ScFormulaDlg::ScFormulaDlg(SfxBindings* pB, SfxChildWindow* pCW,
+ weld::Window* pParent, const ScViewData* pViewData, const formula::IFunctionManager* _pFunctionMgr)
+ : formula::FormulaDlg(pB, pCW, pParent, _pFunctionMgr, this)
, m_aHelper(this,pB)
{
- m_aHelper.SetWindow(this);
+ m_aHelper.SetDialog(m_xDialog.get());
ScModule* pScMod = SC_MOD();
pScMod->InputEnterHandler();
ScTabViewShell* pScViewShell = nullptr;
@@ -235,11 +235,6 @@ void ScFormulaDlg::fill()
ScFormulaDlg::~ScFormulaDlg()
{
- disposeOnce();
-}
-
-void ScFormulaDlg::dispose()
-{
ScModule* pScMod = SC_MOD();
ScFormEditData* pData = pScMod->GetFormEditData();
m_aHelper.dispose();
@@ -250,7 +245,6 @@ void ScFormulaDlg::dispose()
pScMod->SetRefInputHdl(nullptr);
StoreFormEditData(pData);
}
- formula::FormulaDlg::dispose();
}
bool ScFormulaDlg::IsInputHdl(const ScInputHandler* pHdl)
@@ -291,10 +285,9 @@ ScInputHandler* ScFormulaDlg::GetNextInputHandler(const ScDocShell* pDocShell, S
return pHdl;
}
-bool ScFormulaDlg::Close()
+void ScFormulaDlg::Close()
{
DoEnter();
- return true;
}
// functions for right side
diff --git a/sc/source/ui/inc/formula.hxx b/sc/source/ui/inc/formula.hxx
index 97737e7c4af9..1940b4bf5865 100644
--- a/sc/source/ui/inc/formula.hxx
+++ b/sc/source/ui/inc/formula.hxx
@@ -44,10 +44,9 @@ class ScFormulaDlg final : public formula::FormulaDlg,
mutable std::shared_ptr<ScCompiler> m_xCompiler;
public:
- ScFormulaDlg( SfxBindings* pB, SfxChildWindow* pCW,
- vcl::Window* pParent, const ScViewData* pViewData, const formula::IFunctionManager* _pFunctionMgr);
- virtual ~ScFormulaDlg() override;
- virtual void dispose() override;
+ ScFormulaDlg( SfxBindings* pB, SfxChildWindow* pCW,
+ weld::Window* pParent, const ScViewData* pViewData, const formula::IFunctionManager* _pFunctionMgr);
+ virtual ~ScFormulaDlg() override;
// IFormulaEditorHelper
virtual void notifyChange() override;
@@ -75,7 +74,7 @@ public:
virtual css::uno::Reference< css::sheet::XFormulaOpCodeMapper> getFormulaOpCodeMapper() const override;
virtual css::table::CellAddress getReferencePosition() const override;
- virtual bool Close() override;
+ virtual void Close() override;
// sc::IAnyRefDialog
virtual void ShowReference(const OUString& _sRef) override;
diff --git a/sc/source/ui/view/reffact.cxx b/sc/source/ui/view/reffact.cxx
index 9887ba56364b..492dc7c0e697 100644
--- a/sc/source/ui/view/reffact.cxx
+++ b/sc/source/ui/view/reffact.cxx
@@ -45,7 +45,7 @@ SFX_IMPL_MODELESSDIALOGCONTOLLER_WITHID(ScDbNameDlgWrapper, SID_DEFINE_DBNAME )
SFX_IMPL_MODELESSDIALOGCONTOLLER_WITHID(ScConsolidateDlgWrapper, SID_OPENDLG_CONSOLIDATE)
SFX_IMPL_MODELESSDIALOGCONTOLLER_WITHID(ScPrintAreasDlgWrapper, SID_OPENDLG_EDIT_PRINTAREA )
SFX_IMPL_MODELESSDIALOGCONTOLLER_WITHID(ScColRowNameRangesDlgWrapper, SID_DEFINE_COLROWNAMERANGES )
-SFX_IMPL_MODELESSDIALOG_WITHID(ScFormulaDlgWrapper, SID_OPENDLG_FUNCTION )
+SFX_IMPL_MODELESSDIALOGCONTOLLER_WITHID(ScFormulaDlgWrapper, SID_OPENDLG_FUNCTION)
SFX_IMPL_MODELESSDIALOGCONTOLLER_WITHID(ScAcceptChgDlgWrapper, FID_CHG_ACCEPT)
SFX_IMPL_MODELESSDIALOGCONTOLLER_WITHID(ScHighlightChgDlgWrapper, FID_CHG_SHOW )
SFX_IMPL_MODELESSDIALOGCONTOLLER_WITHID(ScSimpleRefDlgWrapper, WID_SIMPLE_REF )
@@ -137,7 +137,7 @@ IMPL_CONTROLLER_CHILD_CTOR( ScConsolidateDlgWrapper, SID_OPENDLG_CONSOLIDATE )
IMPL_CONTROLLER_CHILD_CTOR( ScPrintAreasDlgWrapper, SID_OPENDLG_EDIT_PRINTAREA )
-IMPL_CHILD_CTOR( ScFormulaDlgWrapper, SID_OPENDLG_FUNCTION )
+IMPL_CONTROLLER_CHILD_CTOR( ScFormulaDlgWrapper, SID_OPENDLG_FUNCTION )
// ScSimpleRefDlgWrapper
diff --git a/sc/source/ui/view/tabvwshc.cxx b/sc/source/ui/view/tabvwshc.cxx
index a5a04d91b63b..3ff4ff52d4e4 100644
--- a/sc/source/ui/view/tabvwshc.cxx
+++ b/sc/source/ui/view/tabvwshc.cxx
@@ -142,14 +142,6 @@ VclPtr<SfxModelessDialog> ScTabViewShell::CreateRefDialog(
switch( nSlotId )
{
- case SID_OPENDLG_FUNCTION:
- {
- // dialog checks, what is in the cell
-
- pResult = VclPtr<ScFormulaDlg>::Create( pB, pCW, pParent, &GetViewData(),ScGlobal::GetStarCalcFunctionMgr() );
- }
- break;
-
case WID_CONDFRMT_REF:
{
bool bFound = false;
@@ -475,6 +467,12 @@ std::unique_ptr<SfxModelessDialogController> ScTabViewShell::CreateRefDialogCont
break;
}
+ case SID_OPENDLG_FUNCTION:
+ {
+ // dialog checks, what is in the cell
+ xResult.reset(new ScFormulaDlg(pB, pCW, pParent, &GetViewData(),ScGlobal::GetStarCalcFunctionMgr()));
+ break;
+ }
}
if (xResult)