]> git.lyx.org Git - lyx.git/blobdiff - src/Font.cpp
Remove undisclosed imports (from xxx import *)
[lyx.git] / src / Font.cpp
index 8c73e91f37345e545136d6651b5646897be11e9a..748a8df92cf01e9e6ab4316f2185732c763bc539 100644 (file)
@@ -21,7 +21,6 @@
 #include "Encoding.h"
 #include "Language.h"
 #include "LaTeXFeatures.h"
-#include "Lexer.h"
 #include "LyXRC.h"
 #include "output_latex.h"
 #include "OutputParams.h"
@@ -31,6 +30,7 @@
 #include "support/convert.h"
 #include "support/debug.h"
 #include "support/gettext.h"
+#include "support/Lexer.h"
 #include "support/lstrings.h"
 
 #include <cstring>
@@ -505,8 +505,8 @@ int Font::latexWriteStartChanges(otexstream & os, BufferParams const & bparams,
                if (runparams.inulemcmd) {
                        // needed with nested uwave in xout
                        // see https://tex.stackexchange.com/a/263042
-                       os << "\\ULdepth=1000pt";
-                       count += 15;
+                       os << "\\ULdepth=\\maxdimen";
+                       count += 18;
                }
                if (needs_cprotection) {
                        os << "\\cprotect";
@@ -695,18 +695,26 @@ bool Font::fromString(string const & data, bool & toggle)
 
                if (token == "family") {
                        int const next = lex.getInteger();
+                       if (next == -1)
+                               return false;
                        bits_.setFamily(FontFamily(next));
 
                } else if (token == "series") {
                        int const next = lex.getInteger();
+                       if (next == -1)
+                               return false;
                        bits_.setSeries(FontSeries(next));
 
                } else if (token == "shape") {
                        int const next = lex.getInteger();
+                       if (next == -1)
+                               return false;
                        bits_.setShape(FontShape(next));
 
                } else if (token == "size") {
                        int const next = lex.getInteger();
+                       if (next == -1)
+                               return false;
                        bits_.setSize(FontSize(next));
                // FIXME: shall style be handled there? Probably not.
                } else if (token == "emph" || token == "underbar"
@@ -716,6 +724,8 @@ bool Font::fromString(string const & data, bool & toggle)
                        || token == "nospellcheck") {
 
                        int const next = lex.getInteger();
+                       if (next == -1)
+                               return false;
                        FontState const misc = FontState(next);
 
                        if (token == "emph")
@@ -739,6 +749,8 @@ bool Font::fromString(string const & data, bool & toggle)
 
                } else if (token == "color") {
                        int const next = lex.getInteger();
+                       if (next == -1)
+                               return false;
                        bits_.setColor(ColorCode(next));
 
                /**