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
This commit is contained in:
Richard Heck 2010-10-31 18:56:32 +00:00
parent a59fec10ff
commit 79811671e9
4 changed files with 14 additions and 19 deletions

View File

@ -46,12 +46,6 @@ void GuiLabel::paramsToDialog(Inset const * inset)
{ {
InsetLabel const * label = static_cast<InsetLabel const *>(inset); InsetLabel const * label = static_cast<InsetLabel const *>(inset);
InsetCommandParams const & params = label->params(); InsetCommandParams const & params = label->params();
paramsToDialog(params);
}
void GuiLabel::paramsToDialog(InsetCommandParams const & params)
{
keywordED->setText(toqstr(params["name"])); 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 bool GuiLabel::checkWidgets() const
{ {
if (!InsetParamsWidget::checkWidgets()) if (!InsetParamsWidget::checkWidgets())

View File

@ -33,9 +33,9 @@ private:
InsetCode insetCode() const { return LABEL_CODE; } InsetCode insetCode() const { return LABEL_CODE; }
FuncCode creationCode() const { return LFUN_INSET_INSERT; } FuncCode creationCode() const { return LFUN_INSET_INSERT; }
void paramsToDialog(Inset const *); void paramsToDialog(Inset const *);
void paramsToDialog(InsetCommandParams const & params);
docstring dialogToParams() const; docstring dialogToParams() const;
bool checkWidgets() const; bool checkWidgets() const;
bool initialiseParams(std::string const &);
//@} //@}
}; };

View File

@ -17,6 +17,9 @@
#include "ui_PrintNomenclUi.h" #include "ui_PrintNomenclUi.h"
namespace lyx { namespace lyx {
class InsetCommandParams;
namespace frontend { namespace frontend {
class GuiPrintNomencl : public InsetParamsWidget, public Ui::PrintNomenclUi class GuiPrintNomencl : public InsetParamsWidget, public Ui::PrintNomenclUi

View File

@ -13,8 +13,6 @@
#include "InsetParamsWidget.h" #include "InsetParamsWidget.h"
#include "insets/InsetCommand.h"
#include "qt_helpers.h" #include "qt_helpers.h"
#include <QLineEdit> #include <QLineEdit>
@ -60,16 +58,6 @@ bool InsetParamsWidget::checkWidgets() const
return valid; 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 frontend
} // namespace lyx } // namespace lyx