]> git.lyx.org Git - features.git/commitdiff
Revert r35933. There are insets not based upon InsetCommand, such as
authorRichard Heck <rgheck@comcast.net>
Sun, 31 Oct 2010 18:56:32 +0000 (18:56 +0000)
committerRichard Heck <rgheck@comcast.net>
Sun, 31 Oct 2010 18:56:32 +0000 (18:56 +0000)
VSpace, that use InsetParamsWidget, so we cannot have code that requires
InsetCommandParams there.

Stephen Witt reported a similar crash with the info dialog.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35952 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiLabel.cpp
src/frontends/qt4/GuiLabel.h
src/frontends/qt4/GuiPrintNomencl.h
src/frontends/qt4/InsetParamsWidget.cpp

index 570de61a4f1150de47852465fac5fcfea05d0ee3..d888ae07d82d833175fa6f0daafdd9ccc7d179c6 100644 (file)
@@ -46,12 +46,6 @@ void GuiLabel::paramsToDialog(Inset const * inset)
 {
        InsetLabel const * label = static_cast<InsetLabel const *>(inset);
        InsetCommandParams const & params = label->params();
-       paramsToDialog(params);
-}
-
-
-void GuiLabel::paramsToDialog(InsetCommandParams const & params)
-{
        keywordED->setText(toqstr(params["name"]));
 }
 
@@ -64,6 +58,16 @@ docstring GuiLabel::dialogToParams() const
 }
 
 
+bool GuiLabel::initialiseParams(std::string const & data)
+{
+       InsetCommandParams p(insetCode());
+       if (!InsetCommand::string2params(data, p))
+               return false;
+       keywordED->setText(toqstr(p["name"]));
+       return true;
+}
+
+
 bool GuiLabel::checkWidgets() const
 {
        if (!InsetParamsWidget::checkWidgets())
index bf0454f378cbb57540d8ea58f0e563f5fc55c6d9..d616cbf1f5c5228f3a47026e3d70061f21209e31 100644 (file)
@@ -33,9 +33,9 @@ private:
        InsetCode insetCode() const { return LABEL_CODE; }
        FuncCode creationCode() const { return LFUN_INSET_INSERT; }
        void paramsToDialog(Inset const *);
-       void paramsToDialog(InsetCommandParams const & params);
        docstring dialogToParams() const;
        bool checkWidgets() const;
+       bool initialiseParams(std::string const &);
        //@}
 };
 
index d4c0f8812692b2f3301cbdd58eede2e701a9677d..8005f1d506476f141374dd6369d6d04b06897c3f 100644 (file)
@@ -17,6 +17,9 @@
 #include "ui_PrintNomenclUi.h"
 
 namespace lyx {
+
+class InsetCommandParams;
+
 namespace frontend {
 
 class GuiPrintNomencl : public InsetParamsWidget, public Ui::PrintNomenclUi
index 51c3be3ab31f4dbd1968e6e9568e8fe0f06a3948..5eae61c9ca4227a0dc1d9e9c28e1e4c00fec1fac 100644 (file)
@@ -13,8 +13,6 @@
 \r
 #include "InsetParamsWidget.h"\r
 \r
-#include "insets/InsetCommand.h"\r
-\r
 #include "qt_helpers.h"\r
 \r
 #include <QLineEdit>\r
@@ -60,16 +58,6 @@ bool InsetParamsWidget::checkWidgets() const
        return valid;\r
 }\r
 \r
-\r
-bool InsetParamsWidget::initialiseParams(std::string const & data)\r
-{\r
-       InsetCommandParams p(insetCode());\r
-       if (!InsetCommand::string2params(data, p))\r
-               return false;\r
-       paramsToDialog(p);\r
-       return true;\r
-}\r
-\r
 } // namespace frontend\r
 } // namespace lyx\r
 \r