From c4faeb75db7c2b04ed4a9bd3918c4cd2cbd55f29 Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Thu, 28 Oct 2010 16:28:57 +0000 Subject: [PATCH] Comments mostly. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35885 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/insets/InsetCommand.cpp | 10 +++++----- src/insets/InsetCommand.h | 5 +++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/insets/InsetCommand.cpp b/src/insets/InsetCommand.cpp index feed4dbe4b..9cebc11942 100644 --- a/src/insets/InsetCommand.cpp +++ b/src/insets/InsetCommand.cpp @@ -223,20 +223,20 @@ bool InsetCommand::showInsetDialog(BufferView * bv) const // FIXME This could take an InsetCode instead of a string -bool InsetCommand::string2params(string const & name, string const & in, +bool InsetCommand::string2params(string const & name, string const & data, InsetCommandParams & params) { params.clear(); - if (in.empty()) + if (data.empty()) return false; // This happens when inset-insert is called without argument except for the // inset type; ex: // "inset-insert toc" - if (in == name) + if (data == name) return true; - istringstream data(in); + istringstream dstream(data); Lexer lex; - lex.setStream(data); + lex.setStream(dstream); lex.setContext("InsetCommand::string2params"); lex >> name.c_str(); // check for name lex >> "CommandInset"; diff --git a/src/insets/InsetCommand.h b/src/insets/InsetCommand.h index 0007c5bd19..5c9a9d6190 100644 --- a/src/insets/InsetCommand.h +++ b/src/insets/InsetCommand.h @@ -47,8 +47,9 @@ public: InsetCommand const * asInsetCommand() const { return this; } - /// returns true if params are successfully read - static bool string2params(std::string const &, std::string const & name, + /// \return true if params are successfully read + static bool string2params(std::string const & name, + std::string const & data, InsetCommandParams &); /// static std::string params2string(std::string const & name, -- 2.39.2