From a93ac274507fcd5bade2fe51826c7337152d793b Mon Sep 17 00:00:00 2001 From: Enrico Forestieri Date: Wed, 20 May 2015 15:49:15 +0200 Subject: [PATCH] Avoid compiler warning about overloaded virtual function. --- src/factory.cpp | 2 +- src/insets/InsetBibitem.cpp | 3 ++- src/insets/InsetCommand.cpp | 2 +- src/insets/InsetCommand.h | 2 +- src/insets/InsetCommandParams.cpp | 8 +++++++- src/insets/InsetCommandParams.h | 5 +++-- 6 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/factory.cpp b/src/factory.cpp index bf25fbd43e..b7320d0143 100644 --- a/src/factory.cpp +++ b/src/factory.cpp @@ -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: diff --git a/src/insets/InsetBibitem.cpp b/src/insets/InsetBibitem.cpp index a8dfd11f09..a0498994d1 100644 --- a/src/insets/InsetBibitem.cpp +++ b/src/insets/InsetBibitem.cpp @@ -195,7 +195,8 @@ void InsetBibitem::doDispatch(Cursor & cur, FuncRequest & cmd) void InsetBibitem::read(Lexer & lex) { - InsetCommand::read(lex, &buffer()); + InsetCommandParams * icp = const_cast(¶ms()); + icp->Read(lex, &buffer()); if (prefixIs(getParam("key"), key_prefix)) { int const key = convert(getParam("key").substr(key_prefix.length())); diff --git a/src/insets/InsetCommand.cpp b/src/insets/InsetCommand.cpp index 319ab8a60b..dadab6ab93 100644 --- a/src/insets/InsetCommand.cpp +++ b/src/insets/InsetCommand.cpp @@ -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; } diff --git a/src/insets/InsetCommand.h b/src/insets/InsetCommand.h index c3b5005d27..ae6fc3ec05 100644 --- a/src/insets/InsetCommand.h +++ b/src/insets/InsetCommand.h @@ -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); /// diff --git a/src/insets/InsetCommandParams.cpp b/src/insets/InsetCommandParams.cpp index e291053ac8..3a8e6427c5 100644 --- a/src/insets/InsetCommandParams.cpp +++ b/src/insets/InsetCommandParams.cpp @@ -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(); diff --git a/src/insets/InsetCommandParams.h b/src/insets/InsetCommandParams.h index c983c335a1..4107378487 100644 --- a/src/insets/InsetCommandParams.h +++ b/src/insets/InsetCommandParams.h @@ -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; ///