Use convert instead of a stream to read LFUN_REPEAT count

At least coverity should find it safer.
This commit is contained in:
Jean-Marc Lasgouttes 2017-03-28 11:02:21 +02:00
parent f58d7dfe7b
commit 5c03cb340c

View File

@ -1857,10 +1857,7 @@ void GuiApplication::dispatch(FuncRequest const & cmd, DispatchResult & dr)
// repeat command // repeat command
string countstr; string countstr;
string rest = split(argument, countstr, ' '); string rest = split(argument, countstr, ' ');
istringstream is(countstr); int const count = convert<int>(countstr);
int count = 0;
is >> count;
//lyxerr << "repeat: count: " << count << " cmd: " << rest << endl;
for (int i = 0; i < count; ++i) for (int i = 0; i < count; ++i)
dispatch(lyxaction.lookupFunc(rest)); dispatch(lyxaction.lookupFunc(rest));
break; break;