Avoid compiler warning about overloaded virtual function.

This commit is contained in:
Enrico Forestieri 2015-05-20 15:49:15 +02:00
parent 4bb8725c69
commit a93ac27450
6 changed files with 15 additions and 7 deletions

View File

@ -538,7 +538,7 @@ Inset * readInset(Lexer & lex, Buffer * buf)
//Worst case, we could put it in each case below. Better, we could
//pass the lexer to the constructor and let the params be built there.
InsetCommandParams inscmd(code);
inscmd.read(lex, buf);
inscmd.Read(lex, buf);
switch (code) {
case BIBITEM_CODE:

View File

@ -195,7 +195,8 @@ void InsetBibitem::doDispatch(Cursor & cur, FuncRequest & cmd)
void InsetBibitem::read(Lexer & lex)
{
InsetCommand::read(lex, &buffer());
InsetCommandParams * icp = const_cast<InsetCommandParams *>(&params());
icp->Read(lex, &buffer());
if (prefixIs(getParam("key"), key_prefix)) {
int const key = convert<int>(getParam("key").substr(key_prefix.length()));

View File

@ -244,7 +244,7 @@ bool InsetCommand::string2params(string const & data,
lex.setContext("InsetCommand::string2params");
lex >> name.c_str(); // check for name
lex >> "CommandInset";
params.read(lex, 0);
params.read(lex);
return true;
}

View File

@ -66,7 +66,7 @@ public:
///
void write(std::ostream & os) const { p_.write(os); }
///
void read(Lexer & lex, Buffer const * buf) { p_.read(lex, buf); }
void read(Lexer & lex) { p_.Read(lex, &buffer()); }
///
void doDispatch(Cursor & cur, FuncRequest & cmd);
///

View File

@ -275,7 +275,13 @@ void InsetCommandParams::setCmdName(string const & name)
}
void InsetCommandParams::read(Lexer & lex, Buffer const * buffer)
void InsetCommandParams::read(Lexer & lex)
{
Read(lex, 0);
}
void InsetCommandParams::Read(Lexer & lex, Buffer const * buffer)
{
lex.setContext("InsetCommandParams::read");
lex >> insetName(insetCode_).c_str();

View File

@ -113,9 +113,10 @@ public:
std::string insetType() const;
///
InsetCode code() const { return insetCode_; }
///
void read(Lexer &, Buffer const *);
/// Parse the command
void read(Lexer &);
///
void Read(Lexer &, Buffer const *);
///
void write(std::ostream &) const;
///