-#ifdef USE_OLD_DOCUMENT_LAYOUT
- if (fd_form_document->form_document->visible) {
- UpdateLayoutDocument();
- }
- if (fd_form_quotes->form_quotes->visible) {
- UpdateLayoutQuotes();
- }
- if (fd_form_paper->form_paper->visible) {
- UpdateLayoutPaper();
- }
-#endif
- if (fd_form_preamble->form_preamble->visible) {
- UpdateLayoutPreamble();
- }
- if (fd_form_paragraph->form_paragraph->visible) {
- UpdateLayoutParagraph();
- }
- if (fd_form_paragraph_extra->form_paragraph_extra->visible) {
- UpdateParagraphExtra();
- }
-#ifndef NEW_TABULAR
- if (fd_form_table_options->form_table_options->visible) {
- UpdateLayoutTable(1); // just like a right mouse click
- }
-#endif
- if (fd_form_bullet) {
- if (fd_form_bullet->form_bullet->visible) {
- updateBulletForm();
- }
- }
- if (fd_latex_log->LaTeXLog->visible) {
- LatexLogUpdate(0,0);
- }
- if (current_view->buffer()->isReadonly()) {
- // a little crude perhaps but it works. ARRae
- if (fd_form_character->form_character->visible) {
- fl_hide_form(fd_form_character->form_character);
- }
-#ifndef NEW_TABULAR
- if (fd_form_table->form_table->visible) {
- fl_hide_form(fd_form_table->form_table);
- }
-#endif
-#ifndef ALWAYS_CLOSE_MATH_PANELS
- // The math popups should be closed only if we switch
- // to a readonly buffer
- if (fd_panel) {
- if (fd_panel->panel->visible) {
- fl_hide_form(fd_panel->panel);
- }
- }
- if (fd_delim) {
- if (fd_delim->delim->visible) {
- fl_hide_form(fd_delim->delim);
- }
- }
- if (fd_deco) {
- if (fd_deco->deco->visible) {
- fl_hide_form(fd_deco->deco);
- }
- }
- if (fd_space) {
- if (fd_space->space->visible) {
- fl_hide_form(fd_space->space);
- }
- }
- if (fd_matrix) {
- if (fd_matrix->matrix->visible) {
- fl_hide_form(fd_matrix->matrix);
- }
- }
-#endif
- }
-
- // We have either changed buffers or changed the readonly status
- // so the safest thing to do is hide all inset popups that
- // are editting insets from the previous buffer or aren't
- // allowed in readonly docs.
-#ifdef ALWAYS_CLOSE_MATH_PANELS
- if (fd_panel) {
- if (fd_panel->panel->visible) {
- fl_hide_form(fd_panel->panel);
- }
- }
- if (fd_delim) {
- if (fd_delim->delim->visible) {
- fl_hide_form(fd_delim->delim);
- }
- }
- if (fd_deco) {
- if (fd_deco->deco->visible) {
- fl_hide_form(fd_deco->deco);
- }
- }
- if (fd_space) {
- if (fd_space->space->visible) {
- fl_hide_form(fd_space->space);
- }
- }
- if (fd_matrix) {
- if (fd_matrix->matrix->visible) {
- fl_hide_form(fd_matrix->matrix);
- }
- }
-#endif
- if (bibitem_form) {
- if (bibitem_form->bibitem_form->visible) {
- fl_hide_form(bibitem_form->bibitem_form);
- }
- }
- if (form) {
- if (form->include->visible) {
- fl_hide_form(form->include);
- }
- }