From: John Levon Date: Tue, 3 Jun 2003 23:39:38 +0000 (+0000) Subject: the same fix qt got to tabulalr close was needed in xforms too X-Git-Tag: 1.6.10~16695 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=5cf0161210ec4b3f5f9cfe3813f008b9ce0bab43;p=features.git the same fix qt got to tabulalr close was needed in xforms too git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7098 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/frontends/xforms/ChangeLog b/src/frontends/xforms/ChangeLog index d256e10204..a8c03a4ac5 100644 --- a/src/frontends/xforms/ChangeLog +++ b/src/frontends/xforms/ChangeLog @@ -1,3 +1,8 @@ +2003-06-04 John Levon + + * FormTabular.C: fix a crash on applying changes + at close + 2003-06-03 John Levon * lyx_gui.C: add sync_events() diff --git a/src/frontends/xforms/FormTabular.C b/src/frontends/xforms/FormTabular.C index 78d62c29e2..62c036d7ef 100644 --- a/src/frontends/xforms/FormTabular.C +++ b/src/frontends/xforms/FormTabular.C @@ -493,33 +493,37 @@ ButtonPolicy::SMInput FormTabular::input(FL_OBJECT * ob, long) // yet. don't let this continue to exist ... if (ob == dialog_->button_close) { closing_ = true; - string str1 = + string w1 = getLengthFromWidgets(column_options_->input_column_width, column_options_->choice_value_column_width); - string str2; + string w2; LyXLength llen = tabular.GetColumnPWidth(cell); if (!llen.zero()) - str2 = llen.asString(); - if (str1 != str2) - input(column_options_->input_column_width, 0); - str1 = getLengthFromWidgets(cell_options_->input_mcolumn_width, + w2 = llen.asString(); + + string mw1 = getLengthFromWidgets(cell_options_->input_mcolumn_width, cell_options_->choice_value_mcolumn_width); llen = tabular.GetMColumnPWidth(cell); + string mw2; if (llen.zero()) - str2 = ""; + mw2 = ""; else - str2 = llen.asString(); - if (str1 != str2) + mw2 = llen.asString(); + + string al1 = getString(column_options_->input_special_alignment); + string al2 = tabular.GetAlignSpecial(cell, LyXTabular::SET_SPECIAL_COLUMN); + string mal1 = getString(cell_options_->input_special_multialign); + string mal2 = tabular.GetAlignSpecial(cell, LyXTabular::SET_SPECIAL_MULTI); + + // we must do these all at the end + if (w1 != w2) + input(column_options_->input_column_width, 0); + if (mw1 != mw2) input(cell_options_->input_mcolumn_width, 0); - str1 = getString(column_options_->input_special_alignment); - str2 = tabular.GetAlignSpecial(cell, LyXTabular::SET_SPECIAL_COLUMN); - if (str1 != str2) + if (al1 != al2) input(column_options_->input_special_alignment, 0); - str1 = getString(cell_options_->input_special_multialign); - str2 = tabular.GetAlignSpecial(cell, LyXTabular::SET_SPECIAL_MULTI); - if (str1 != str2) + if (mal1 != mal2) input(cell_options_->input_special_multialign, 0); - closing_ = false; dialog().OKButton(); return ButtonPolicy::SMI_VALID;