]> git.lyx.org Git - features.git/commitdiff
Fixed some bugs for tabulars & xforms-0.89, in vspace.C and lyxstring.
authorJürgen Vigna <jug@sad.it>
Tue, 19 Oct 1999 14:27:46 +0000 (14:27 +0000)
committerJürgen Vigna <jug@sad.it>
Tue, 19 Oct 1999 14:27:46 +0000 (14:27 +0000)
Have a look at Changelog for more details.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@209 a592a061-630c-0410-9148-cb99ea01b6c8

ChangeLog
src/TableLayout.C
src/support/lyxstring.C
src/vspace.C

index 9a310ba409fa8ad49ed80429e0fca3bebbae964a..607dd84585ce9b9f2a91ff447e69124f7432d4d8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+1999-10-19  Juergen Vigna  <jug@sad.it>
+
+       * src/support/lyxstring.C (lyxstring): we permit to have a null
+       pointer as assignment value and just don't assign it.
+
+       * src/vspace.C (nextToken): corrected this function substituting
+       find_first(_not)_of with find_last_of.
+
+       * src/TableLayout.C (UpdateLayoutTable) (TableOptionsCB)
+               (TableOptCloseCB) (TableSpeCloseCB):
+       inserted fl_set_focus call for problem with fl_hide_form() in
+       xforms-0.89.
+
 1999-10-19  Jean-Marc Lasgouttes  <Jean-Marc.Lasgouttes@inria.fr>
 
        * src/lyx_cb.C (LayoutsCB): fix bug where int was added to a
index 927680c891ba10e8aa5a7eb93946c41c0e81cae9..b944fe6c3ac6c538357f41d685da469a81857267 100644 (file)
@@ -213,8 +213,13 @@ bool UpdateLayoutTable(int flag)
            fl_set_object_lcol(fd_form_table_options->radio_lt_newpage,
                               FL_INACTIVE);
         }
-        fl_set_button(fd_form_table_options->radio_rotate_table,table->RotateTable());
+        fl_set_button(fd_form_table_options->radio_rotate_table,
+                     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) {
+       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);
     }
     return update;
@@ -428,21 +433,27 @@ void TableOptionsCB(FL_OBJECT *ob, long)
             current_view->currentBuffer()->text->TableFeatures(num);
         current_view->currentBuffer()->update(1);
     }
-    if (num == LyXTable::DELETE_TABLE)
+    if (num == LyXTable::DELETE_TABLE) {
+       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);
-    else
+    else
         UpdateLayoutTable(true);
     return;
 }
 
 void TableOptCloseCB(FL_OBJECT *, long)
 {
+    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);
     return;
 }
 
 void TableSpeCloseCB(FL_OBJECT *, long)
 {
+    fl_set_focus_object(fd_form_table_options->form_table_options,
+                       fd_form_table_options->button_table_delete);
     fl_hide_form(fd_form_table_extra->form_table_extra);
     return;
 }
index e652321194e304b7882fdc04324e7e913e81c75b..7d7c614ed05cac2c090dc1491e3d92e2ffc663b6 100644 (file)
@@ -337,7 +337,7 @@ lyxstring::lyxstring(value_type const * s, size_type n)
 {
        Assert(s); // we don't allow null pointers
        static Srep empty_rep(0, "");
-       if (*s && n) { // s is not empty string and n > 0
+       if (s && *s && n) { // s is not empty string and n > 0
                rep = new Srep(min(strlen(s), n), s);
        } else {
                ++empty_rep.ref;
@@ -348,9 +348,10 @@ lyxstring::lyxstring(value_type const * s, size_type n)
 
 lyxstring::lyxstring(value_type const * s)
 {
-       Assert(s); // we don't allow null pointers
+       // yes we allow them just don't initalize them
+       // Assert(s); // we don't allow null pointers
        static Srep empty_rep(0, "");
-       if (*s) { // s is not empty string
+       if (s && *s) { // s is not empty string
                rep = new Srep(strlen(s), s);
        } else {
                ++empty_rep.ref;
index 956ea8c5715e367279648b57d8457dd8b91a6ddb..57e8cfc127dbc84e25eb11810b0b0079c2109e91 100644 (file)
@@ -92,8 +92,9 @@ static char nextToken (string & data)
                string::size_type i;
 
                // I really mean assignment ("=") below, not equality!
-               if ((i = data.find_first_not_of("0123456789.")) != string::npos) {
+               if ((i = data.find_last_of("0123456789.")) != string::npos) {
                        if (number_index > 3) return 'E';  // Error
+                       ++i;
                         string buffer = data.substr(0, i);
                        if (sscanf (buffer.c_str(),
                                    "%f", &number[number_index]) == 1) {
@@ -102,9 +103,10 @@ static char nextToken (string & data)
                                return 'n';
                        } else 
                                return 'E';  // Error
-               } else if (( i = data
-                            .find_first_of("abcdefghijklmnopqrstuvwxyz")) != string::npos) {
+               } else if ((i=data.find_last_of("abcdefghijklmnopqrstuvwxyz"))
+                          != string::npos) {
                        if (unit_index > 3) return 'E';  // Error
+                       ++i;
                        string buffer = data.substr(0, i);
                        unit[unit_index] = unitFromString (buffer);
                        if (unit[unit_index] != LyXLength::UNIT_NONE) {