summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2012-03-21 16:14:45 +0100
committerStephan Bergmann <sbergman@redhat.com>2012-03-21 16:18:00 +0100
commit706ac4779de1870cf0d922f1cc3f6d4470392403 (patch)
tree0feff94a2ed664f696e5e892f057219b259160e4
parent0994cb60411b0efc71a8d6ef182e158761a85b6b (diff)
Make sure one base class does not use another one after destruction
The original code lead to invoking a pure virtual function in Calc when doing Ctrl-F2, ESC.
-rw-r--r--sc/source/ui/inc/formula.hxx9
1 files changed, 6 insertions, 3 deletions
diff --git a/sc/source/ui/inc/formula.hxx b/sc/source/ui/inc/formula.hxx
index 07b86ff136c9..f8969c591224 100644
--- a/sc/source/ui/inc/formula.hxx
+++ b/sc/source/ui/inc/formula.hxx
@@ -56,9 +56,12 @@ class SvLBoxEntry;
typedef ScTabViewShell* PtrTabViewShell;
//============================================================================
-class ScFormulaDlg : public formula::FormulaDlg,
- public IAnyRefDialog,
- public formula::IFormulaEditorHelper
+// Order of base classes is important, as pointer to IFormulaEditorHelper base
+// is passed into constructor of FormulaDlg base, which expects the former to
+// outlive itself:
+class ScFormulaDlg : public formula::IFormulaEditorHelper,
+ public formula::FormulaDlg,
+ public IAnyRefDialog
{
ScFormulaReferenceHelper m_aHelper;
ScFormulaCell* pCell;