]> git.lyx.org Git - features.git/commitdiff
Use getArg to read math-extern arguments
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 5 Jun 2018 09:24:05 +0000 (11:24 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 5 Jun 2018 09:24:05 +0000 (11:24 +0200)
This avoids a use of istringstream that coverity dislikes.

src/mathed/InsetMathHull.cpp

index ff7595f33cfe5469fdbeb749c920a2db0afed42b..61d078abe0d77c51588cd64ff70e3080f5f1459a 100644 (file)
@@ -1722,13 +1722,11 @@ void InsetMathHull::check() const
 
 void InsetMathHull::doExtern(Cursor & cur, FuncRequest & func)
 {
-       docstring dlang;
-       docstring extra;
-       idocstringstream iss(func.argument());
-       iss >> dlang >> extra;
+       //FIXME: sort out whether we want std::string or docstring for those
+       string const lang = func.getArg(0);
+       docstring extra = from_utf8(func.getArg(1));
        if (extra.empty())
                extra = from_ascii("noextra");
-       string const lang = to_ascii(dlang);
 
        // replace selection with result of computation
        if (reduceSelectionToOneCell(cur)) {