]> git.lyx.org Git - features.git/commitdiff
the same fix qt got to tabulalr close was needed in xforms too
authorJohn Levon <levon@movementarian.org>
Tue, 3 Jun 2003 23:39:38 +0000 (23:39 +0000)
committerJohn Levon <levon@movementarian.org>
Tue, 3 Jun 2003 23:39:38 +0000 (23:39 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7098 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/xforms/ChangeLog
src/frontends/xforms/FormTabular.C

index d256e10204c9e86203aac756463065a874772228..a8c03a4ac589a27393b596af46a68452efa1f049 100644 (file)
@@ -1,3 +1,8 @@
+2003-06-04  John Levon  <levon@movementarian.org>
+
+       * FormTabular.C: fix a crash on applying changes
+       at close
+
 2003-06-03  John Levon  <levon@movementarian.org>
 
        * lyx_gui.C: add sync_events()
index 78d62c29e226b88893b69a61562f074c1943283e..62c036d7ef27d8a25be9e77d9691b9d1ced26524 100644 (file)
@@ -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;