diff --git a/ChangeLog b/ChangeLog index 9a310ba409..607dd84585 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +1999-10-19 Juergen Vigna + + * 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 * src/lyx_cb.C (LayoutsCB): fix bug where int was added to a diff --git a/src/TableLayout.C b/src/TableLayout.C index 927680c891..b944fe6c3a 100644 --- a/src/TableLayout.C +++ b/src/TableLayout.C @@ -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; } diff --git a/src/support/lyxstring.C b/src/support/lyxstring.C index e652321194..7d7c614ed0 100644 --- a/src/support/lyxstring.C +++ b/src/support/lyxstring.C @@ -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; diff --git a/src/vspace.C b/src/vspace.C index 956ea8c571..57e8cfc127 100644 --- a/src/vspace.C +++ b/src/vspace.C @@ -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) {