]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/xforms/FormMathsDeco.C
fix crash with "save as"
[lyx.git] / src / frontends / xforms / FormMathsDeco.C
index ec0c43a6fe49e0d8f2057819f2a4e24f0fa320fd..56e9a8f0c61db8a3ec92f1f46b7cabf3f91521f9 100644 (file)
 #include "ControlMath.h"
 #include "FormMathsDeco.h"
 #include "forms/form_maths_deco.h"
+#include "xformsBC.h"
+
 #include "bmtable.h"
 #include FORMS_H_LOCATION
 
 #include "deco.xbm"
 
 
-FormMathsDeco::FormMathsDeco(LyXView & lv, Dialogs & d,
-                            FormMathsPanel const & p)
-       : FormMathsSub(lv, d, p, _("Maths Decorations & Accents"), false)
-{}
-
+typedef FormCB<ControlMathSub, FormDB<FD_maths_deco> > base_class;
 
-FL_FORM * FormMathsDeco::form() const
-{
-       if (dialog_.get())
-               return dialog_->form;
-       return 0;
-}
+FormMathsDeco::FormMathsDeco()
+       : base_class(_("Maths Decorations & Accents"), false)
+{}
 
 
 void FormMathsDeco::build()
@@ -61,19 +56,19 @@ void FormMathsDeco::build()
 void FormMathsDeco::apply()
 {
        if (deco_ < nr_latex_deco)
-               parent_.insertSymbol(latex_deco[deco_]);
+               controller().insertSymbol(latex_deco[deco_]);
 }
 
 
-bool FormMathsDeco::input(FL_OBJECT * ob, long)
+ButtonPolicy::SMInput FormMathsDeco::input(FL_OBJECT * ob, long)
 {
        deco_ = fl_get_bmtable(ob);
        if (deco_ < 0)
-               return false;
+               return ButtonPolicy::SMI_INVALID;
        //if (ob == dialog_->bmtable_deco1)
        //      deco_ += 0;
        if (ob == dialog_->bmtable_deco2)
                deco_ += 12;
        apply();
-       return true;
+       return ButtonPolicy::SMI_VALID;
 }