Op 17-2-2011 0:09, [email protected] schreef:
Author: vfr
Date: Thu Feb 17 00:09:29 2011
New Revision: 37706
URL: http://www.lyx.org/trac/changeset/37706

Log:
Fix bug #7308: Table settings dialog broken.

Modified:
    lyx-devel/trunk/src/frontends/qt4/GuiTabular.cpp
    lyx-devel/trunk/src/insets/InsetTabular.cpp

Modified: lyx-devel/trunk/src/frontends/qt4/GuiTabular.cpp
==============================================================================
--- lyx-devel/trunk/src/frontends/qt4/GuiTabular.cpp    Thu Feb 17 00:06:43 
2011        (r37705)
+++ lyx-devel/trunk/src/frontends/qt4/GuiTabular.cpp    Thu Feb 17 00:09:29 
2011        (r37706)
@@ -408,7 +408,7 @@
  docstring GuiTabular::dialogToParams() const
  {
        // FIXME: We should use Tabular directly.
-       string param_str = "tabular";
+       string param_str = "tabular from-dialog";

        // table width
        string tabwidth = widgetsToLength(tabularWidthED, tabularWidthUnitLC);

Modified: lyx-devel/trunk/src/insets/InsetTabular.cpp
==============================================================================
--- lyx-devel/trunk/src/insets/InsetTabular.cpp Thu Feb 17 00:06:43 2011        
(r37705)
+++ lyx-devel/trunk/src/insets/InsetTabular.cpp Thu Feb 17 00:09:29 2011        
(r37706)
@@ -4278,8 +4278,16 @@
                if (&cur.inset() != this || cmd.getArg(0) != "tabular")
                        break;

-               string const s = cmd.getArg(1);
                // FIXME: We only check for the very first argument...
+               string const s = cmd.getArg(1);
+               // We always enable the lfun if it is coming from the dialog
+               // because the dialog makes sure all the settings are valid,
+               // even though the first argument might not be valid now.
+               if (s == "from-dialog") {
+                       status.setEnabled(true);
+                       return true;
+               }
+
                int action = Tabular::LAST_ACTION;
                int i = 0;
                for (; tabularFeature[i].action != Tabular::LAST_ACTION; ++i) {

You forgot to strip the "from-dialog" parameter from the argument in the handling of INSET_MODIFY in doDispatch. Now from-dialog is interpreted as tabular feature.

Vincent

Reply via email to