]> git.lyx.org Git - features.git/commitdiff
Use convert instead of a stream to read LFUN_REPEAT count
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 28 Mar 2017 09:02:21 +0000 (11:02 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 28 Mar 2017 09:04:39 +0000 (11:04 +0200)
At least coverity should find it safer.

src/frontends/qt4/GuiApplication.cpp

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