]> git.lyx.org Git - lyx.git/blobdiff - src/lengthcommon.cpp
Add missing math delim decorations
[lyx.git] / src / lengthcommon.cpp
index a226a7e2e73bad977a8b64ff129bfb68582456cc..72f5bbf88faf4274800b11edd344152b9ae79e4b 100644 (file)
@@ -47,6 +47,7 @@ char const * const unit_name_gui[] = {
        N_("Column Width %"), N_("Page Width %"), N_("Line Width %"),
        N_("Text Height %"), N_("Page Height %"), "" };
 
+
 Length::UNIT unitFromString(string const & data)
 {
        int i = 0;
@@ -208,6 +209,7 @@ LaTeXLength table[] = {
 
 } // namespace anon
 
+
 const char * stringFromUnit(int unit)
 {
        if (unit < 0 || unit > num_units)
@@ -234,8 +236,11 @@ bool isValidGlueLength(string const & data, GlueLength * result)
        // forward approach leads to very long, tedious code that would be
        // much harder to understand and maintain. (AS)
 
-       if (data.empty())
+       if (data.empty()) {
+               if (result)
+                       *result = GlueLength();
                return true;
+       }
        string buffer = ltrim(data);
 
        // To make isValidGlueLength recognize negative values as
@@ -304,8 +309,11 @@ bool isValidLength(string const & data, Length * result)
        // The parser may seem overkill for lengths without
        // glue, but since we already have it, using it is
        // easier than writing something from scratch.
-       if (data.empty())
+       if (data.empty()) {
+               if (result)
+                       *result = Length();
                return true;
+       }
 
        string   buffer = data;
        int      pattern_index = 0;