summaryrefslogtreecommitdiff
path: root/formula
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-03-21 20:58:48 +0100
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-03-22 00:24:27 +0100
commitac5455a6883b9a774a13d9a29267669fe4d5c38d (patch)
tree7d7309955cba7cd241407a285c41e8e351ccf24c /formula
parent1ab961d98a079d70654041219b14797cc6c62447 (diff)
prevent call to virtual method in destructor, fdo#47589
Diffstat (limited to 'formula')
-rw-r--r--formula/inc/formula/formula.hxx5
-rw-r--r--formula/source/ui/dlg/formula.cxx35
2 files changed, 31 insertions, 9 deletions
diff --git a/formula/inc/formula/formula.hxx b/formula/inc/formula/formula.hxx
index ac9023ddc665..55cc0bc0b0f2 100644
--- a/formula/inc/formula/formula.hxx
+++ b/formula/inc/formula/formula.hxx
@@ -56,6 +56,7 @@ class IFunctionManager;
class FormulaHelper;
class RefEdit;
class RefButton;
+class FormEditData;
//============================================================================
class FORMULA_DLLPUBLIC FormulaModalDialog : public ModalDialog
{
@@ -86,6 +87,8 @@ protected:
void Update();
sal_Bool CheckMatrix(String& aFormula /*IN/OUT*/);
void Update(const String& _sExp);
+
+ void StoreFormEditData(FormEditData* pData);
};
class FORMULA_DLLPUBLIC FormulaDlg:
@@ -141,6 +144,8 @@ protected:
RefEdit* GetActiveEdit();
void SetEdSelection();
+ void StoreFormEditData(FormEditData* pData);
+
const FormulaHelper& GetFormulaHelper() const;
};
diff --git a/formula/source/ui/dlg/formula.cxx b/formula/source/ui/dlg/formula.cxx
index 5b9987acb22a..70eccb37bc0a 100644
--- a/formula/source/ui/dlg/formula.cxx
+++ b/formula/source/ui/dlg/formula.cxx
@@ -114,6 +114,8 @@ namespace formula
void EditNextFunc( sal_Bool bForward, xub_StrLen nFStart=NOT_FOUND );
void EditThisFunc(xub_StrLen nFStart);
+ void StoreFormEditData(FormEditData* pEditData);
+
void UpdateArgInput( sal_uInt16 nOffset, sal_uInt16 nInput );
void Update();
void Update(const String& _sExp);
@@ -364,7 +366,18 @@ FormulaDlg_Impl::~FormulaDlg_Impl()
aTimer.Stop();
}// if(aTimer.IsActive())
bIsShutDown=sal_True;// Set it in order to PreNotify not to save GetFocus.
- FormEditData* pData = m_pHelper->getFormEditData();
+
+ aTabCtrl.RemovePage(TP_FUNCTION);
+ aTabCtrl.RemovePage(TP_STRUCT);
+
+ delete pStructPage;
+ delete pFuncPage;
+ delete pParaWin;
+ DeleteArgs();
+}
+
+void FormulaDlg_Impl::StoreFormEditData(FormEditData* pData)
+{
if (pData) // it won't be destroyed over Close;
{
pData->SetFStart((xub_StrLen)pMEdit->GetSelection().Min());
@@ -377,15 +390,8 @@ FormulaDlg_Impl::~FormulaDlg_Impl()
pData->SetUndoStr(pMEdit->GetText());
pData->SetMatrixFlag(aBtnMatrix.IsChecked());
}
-
- aTabCtrl.RemovePage(TP_FUNCTION);
- aTabCtrl.RemovePage(TP_STRUCT);
-
- delete pStructPage;
- delete pFuncPage;
- delete pParaWin;
- DeleteArgs();
}
+
// -----------------------------------------------------------------------------
void FormulaDlg_Impl::PreNotify( NotifyEvent& rNEvt )
{
@@ -1726,6 +1732,11 @@ long FormulaModalDialog::PreNotify( NotifyEvent& rNEvt )
return ModalDialog::PreNotify(rNEvt);
}
+void FormulaModalDialog::StoreFormEditData(FormEditData* pData)
+{
+ m_pImpl->StoreFormEditData(pData);
+}
+
// --------------------------------------------------------------------------
// Initialisation / General functions for Dialog
// --------------------------------------------------------------------------
@@ -1843,6 +1854,12 @@ void FormulaDlg::disableOk()
{
m_pImpl->aBtnEnd.Disable();
}
+
+void FormulaDlg::StoreFormEditData(FormEditData* pData)
+{
+ m_pImpl->StoreFormEditData(pData);
+}
+
// -----------------------------------------------------------------------------
const IFunctionDescription* FormulaDlg::getCurrentFunctionDescription() const
{