]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_symbols.C
Hopefully fix the problem with stateText() in lyxfont.C
[lyx.git] / src / mathed / math_symbols.C
index 77f47449fe925a255b10188c9d109ceb702ab5a0..0fe7451ce7abab29e6970bf0894bb125c1c031ab 100644 (file)
@@ -9,7 +9,7 @@
  *
  *  Dependencies: Xlib, XForms, Lyx
  *
- *  Copyright: (c) 1995, 1996, Alejandro Aguilar Sierra 
+ *  Copyright: 1995, 1996, Alejandro Aguilar Sierra 
  *
  *   You are free to use and modify it under the terms of
  *   the GNU General Public Licence version 2 or later.
@@ -23,7 +23,6 @@
 #endif
 
 #include <algorithm>
-using std::max;
 
 #include "lyx_main.h"
 #include "buffer.h"
@@ -33,14 +32,17 @@ using std::max;
 #include "LyXView.h"
 #include "support/lstrings.h"
 #include "debug.h"
+#include "lyxfunc.h"
 
 #include "formula.h"
 
 #include "math_panel.h"                 
 #include "math_parser.h"
 
-//extern void Update(signed char);
-//extern int UnlockInset(UpdatableInset *);
+using std::max;
+using std::endl;
+using std::ostream;
+
 extern short greek_kb_flag;
 
 extern BufferView * current_view;
@@ -157,10 +159,10 @@ BitmapMenu::BitmapMenu(int n,  FL_OBJECT * bt, BitmapMenu * prevx): nb(n)
 
 BitmapMenu::~BitmapMenu()
 {
if (next) delete next;
- if (form->visible) Hide();
- fl_free_form(form);  
- delete[] bitmap;
      delete next;
      if (form->visible) Hide();
      fl_free_form(form);  
      delete[] bitmap;
 }
 
 
@@ -271,7 +273,7 @@ extern "C" int C_peek_event(FL_FORM *form, void *ptr) {
 
 extern "C" void math_cb(FL_OBJECT* ob, long data)
 {
-   BitmapMenu* menu = (BitmapMenu*)ob->u_vdata;
+   BitmapMenu * menu = static_cast<BitmapMenu*>(ob->u_vdata);
    int i = menu->GetIndex(ob);   
    char const *s = 0;
 
@@ -303,7 +305,7 @@ extern "C" void math_cb(FL_OBJECT* ob, long data)
    }
   
    if (s)  {
-      if (current_view->available() && lyxrc->display_shortcuts) {
+      if (current_view->available() && lyxrc.display_shortcuts) {
          current_view->owner()->getMiniBuffer()->Set("Inserting symbol ", s);
       }
       current_view->owner()->getLyXFunc()->Dispatch(LFUN_INSERT_MATH, s);
@@ -371,11 +373,11 @@ void math_insert_symbol(char const * s)
         current_view->beforeChange();
         current_view->insertInset(new_inset);
 //      Update(1);//BUG
-        new_inset->Edit(0, 0);
-        new_inset->InsertSymbol(s);
+        new_inset->Edit(current_view, 0, 0, 0);
+        new_inset->InsertSymbol(current_view, s);
       } else
        if (current_view->the_locking_inset->LyxCode() == Inset::MATH_CODE)
-               static_cast<InsetFormula*>(current_view->the_locking_inset)->InsertSymbol(s);
+               static_cast<InsetFormula*>(current_view->the_locking_inset)->InsertSymbol(current_view, s);
         else 
                lyxerr << "Math error: attempt to write on a wrong "
                        "class of inset." << endl;