]> git.lyx.org Git - features.git/commitdiff
Output debug message when creating bad length
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 14 Mar 2017 14:20:09 +0000 (15:20 +0100)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 14 Mar 2017 14:20:09 +0000 (15:20 +0100)
Coverity is right to say that we should check the return value.

src/Length.cpp

index 62b7c842f8f8bf509a06406cb27af5c9023d2466..3aa610f659eeaf3c4b5f070fe2e0012631eaa6ee 100644 (file)
@@ -21,6 +21,7 @@
 
 #include "frontends/FontMetrics.h"
 
+#include "support/debug.h"
 #include "support/docstream.h"
 #include "support/lstrings.h"
 #include "support/lyxlib.h"
@@ -362,9 +363,8 @@ GlueLength::GlueLength(Length const & len, Length const & plus,
 
 GlueLength::GlueLength(string const & data)
 {
-       // false positive from coverity
-       // coverity[CHECKED_RETURN]
-       isValidGlueLength(data, this);
+       if (!isValidGlueLength(data, this))
+               LYXERR0("Invalid glue length " + data);
 }