From: Richard Heck Date: Sun, 31 Oct 2010 18:56:32 +0000 (+0000) Subject: Revert r35933. There are insets not based upon InsetCommand, such as X-Git-Tag: 2.0.0~2155 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=79811671e9d18a472668cf359d9e6471a297a20c;p=features.git Revert r35933. There are insets not based upon InsetCommand, such as 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 --- diff --git a/src/frontends/qt4/GuiLabel.cpp b/src/frontends/qt4/GuiLabel.cpp index 570de61a4f..d888ae07d8 100644 --- a/src/frontends/qt4/GuiLabel.cpp +++ b/src/frontends/qt4/GuiLabel.cpp @@ -46,12 +46,6 @@ void GuiLabel::paramsToDialog(Inset const * inset) { InsetLabel const * label = static_cast(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()) diff --git a/src/frontends/qt4/GuiLabel.h b/src/frontends/qt4/GuiLabel.h index bf0454f378..d616cbf1f5 100644 --- a/src/frontends/qt4/GuiLabel.h +++ b/src/frontends/qt4/GuiLabel.h @@ -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 &); //@} }; diff --git a/src/frontends/qt4/GuiPrintNomencl.h b/src/frontends/qt4/GuiPrintNomencl.h index d4c0f88126..8005f1d506 100644 --- a/src/frontends/qt4/GuiPrintNomencl.h +++ b/src/frontends/qt4/GuiPrintNomencl.h @@ -17,6 +17,9 @@ #include "ui_PrintNomenclUi.h" namespace lyx { + +class InsetCommandParams; + namespace frontend { class GuiPrintNomencl : public InsetParamsWidget, public Ui::PrintNomenclUi diff --git a/src/frontends/qt4/InsetParamsWidget.cpp b/src/frontends/qt4/InsetParamsWidget.cpp index 51c3be3ab3..5eae61c9ca 100644 --- a/src/frontends/qt4/InsetParamsWidget.cpp +++ b/src/frontends/qt4/InsetParamsWidget.cpp @@ -13,8 +13,6 @@ #include "InsetParamsWidget.h" -#include "insets/InsetCommand.h" - #include "qt_helpers.h" #include @@ -60,16 +58,6 @@ bool InsetParamsWidget::checkWidgets() const return valid; } - -bool InsetParamsWidget::initialiseParams(std::string const & data) -{ - InsetCommandParams p(insetCode()); - if (!InsetCommand::string2params(data, p)) - return false; - paramsToDialog(p); - return true; -} - } // namespace frontend } // namespace lyx