X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Flengthcommon.cpp;h=72f5bbf88faf4274800b11edd344152b9ae79e4b;hb=d4ac337f0bd89c279b2133e2475a662a3ada641b;hp=217c22b6048c48e393d8ddfe8309c01ec49950d9;hpb=6b2232a29c682d8e62d1d2b963bb1a70bee4330b;p=lyx.git diff --git a/src/lengthcommon.cpp b/src/lengthcommon.cpp index 217c22b604..72f5bbf88f 100644 --- a/src/lengthcommon.cpp +++ b/src/lengthcommon.cpp @@ -236,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 @@ -306,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;