summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--formula/inc/formula/formula.hxx5
-rw-r--r--formula/source/ui/dlg/formula.cxx35
-rw-r--r--reportdesign/source/ui/dlg/Formula.cxx2
-rw-r--r--sc/source/ui/formdlg/formula.cxx1
4 files changed, 34 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
{
diff --git a/reportdesign/source/ui/dlg/Formula.cxx b/reportdesign/source/ui/dlg/Formula.cxx
index 5dae6718defe..c09e06b33354 100644
--- a/reportdesign/source/ui/dlg/Formula.cxx
+++ b/reportdesign/source/ui/dlg/Formula.cxx
@@ -105,6 +105,8 @@ FormulaDialog::~FormulaDialog()
boost::scoped_ptr<Window> aTemp2(m_pAddField);
m_pAddField = NULL;
}
+
+ StoreFormEditData( m_pFormulaData );
}
// --------------------------------------------------------------------------
diff --git a/sc/source/ui/formdlg/formula.cxx b/sc/source/ui/formdlg/formula.cxx
index 56925940441e..655616477626 100644
--- a/sc/source/ui/formdlg/formula.cxx
+++ b/sc/source/ui/formdlg/formula.cxx
@@ -272,6 +272,7 @@ ScFormulaDlg::~ScFormulaDlg()
{
//Referenz Inputhandler zuruecksetzen
pScMod->SetRefInputHdl(NULL);
+ StoreFormEditData(pData);
} // if (pData) // wird nicht ueber Close zerstoert;
delete pCell;