]> git.lyx.org Git - lyx.git/blobdiff - src/TableLayout.C
small changes to ButtonController usage
[lyx.git] / src / TableLayout.C
index 810b281358a25b943585dd52b28b26a5079546c2..06f3f138fc89c281ade81a961079183c8698a47e 100644 (file)
 #include "layout.h"
 #include "insets/lyxinset.h"
 
-
 // Prototypes
 extern FD_form_table_options * fd_form_table_options;
 extern FD_form_table_extra * fd_form_table_extra;
 extern BufferView * current_view;
 
-extern bool UpdateLayoutTabular(int);
-extern void TabularOptionsCB(FL_OBJECT * ob, long l);
-extern void SetPWidthTabularCB(FL_OBJECT * ob, long l);
-
-
+#ifndef NEW_TABULAR
 static int Confirmed = false;
 static int ActCell;
 
@@ -39,17 +34,17 @@ static int ActCell;
 // in 1.1 anyway)
 static int extra_col_cursor_x; // need no y's, one-line input fields
 static int extra_multicol_cursor_x;
+#endif
 // Joacim
 
-#define IS_TABULAR  (current_view->the_locking_inset && \
-                    current_view->the_locking_inset->GetFirstLockingInsetOfType(Inset::TABULAR_CODE))
 
 bool UpdateLayoutTable(int flag)
 {
     bool update = true;
     if (!current_view->available())
         update = false;
-    
+
+#ifndef NEW_TABULAR
     if (update && current_view->text->cursor.par()->table) {
         char buf[12];
         string pwidth, special;
@@ -219,7 +214,9 @@ bool UpdateLayoutTable(int flag)
                      table->RotateTable());
        fl_set_focus_object(fd_form_table_options->form_table_options,
                            fd_form_table_options->button_table_delete);
-    } else if (fd_form_table_options->form_table_options->visible) {
+    } else
+#endif
+           if (fd_form_table_options->form_table_options->visible) {
        fl_set_focus_object(fd_form_table_options->form_table_options,
                            fd_form_table_options->button_table_delete);
         fl_hide_form(fd_form_table_options->form_table_options);
@@ -262,13 +259,9 @@ void MenuLayoutTable(int flag)
 }
 
 
-void TableOptionsCB(FL_OBJECT * ob, long l)
+void TableOptionsCB(FL_OBJECT * ob, long)
 {
-    if (IS_TABULAR) {
-       TabularOptionsCB(ob, l);
-       return;
-    }
-
+#ifndef NEW_TABULAR
     LyXTable * table = 0;
     int s, num = 0;
     string special, str;
@@ -450,6 +443,7 @@ void TableOptionsCB(FL_OBJECT * ob, long l)
     } else
         UpdateLayoutTable(true);
     return;
+#endif
 }
 
 
@@ -469,13 +463,9 @@ void TableSpeCloseCB(FL_OBJECT *, long)
     return;
 }
 
-void SetPWidthCB(FL_OBJECT * ob, long l)
+void SetPWidthCB(FL_OBJECT * ob, long)
 {
-    if (IS_TABULAR) {
-       SetPWidthTabularCB(ob, l);
-       return;
-    }
-
+#ifndef NEW_TABULAR
     fl_set_object_label(fd_form_table_options->text_warning, "");
     Confirmed = false;
     if (ob == fd_form_table_options->input_column_width) {
@@ -497,4 +487,5 @@ void SetPWidthCB(FL_OBJECT * ob, long l)
         }
         MenuLayoutTable(0); // update for alignment
     }
+#endif
 }