diff --git a/src/Floating.cpp b/src/Floating.cpp index 19fbf5f49b..a610c73b29 100644 --- a/src/Floating.cpp +++ b/src/Floating.cpp @@ -98,6 +98,10 @@ string Floating::docbookTag(bool hasTitle) const // TODO: no good translation for now! Figures are the closest match, as they can contain text. // Solvable as soon as https://github.com/docbook/docbook/issues/157 has a definitive answer. return "figure"; + } else { + // If nothing matches, return something that will not be valid. + LYXERR0("Unrecognised float type: " + floattype_); + return "float"; } } diff --git a/src/output_docbook.cpp b/src/output_docbook.cpp index 087d5a9f67..28d2e1e457 100644 --- a/src/output_docbook.cpp +++ b/src/output_docbook.cpp @@ -427,6 +427,16 @@ void makeBibliography( } +bool isNotOnlySpace(docstring const & str) +{ + for (auto const & c: str) { + if (c != ' ' && c != '\t' && c != '\n' && c != '\v' && c != '\f' && c != '\r') + return true; + } + return false; +} + + void makeParagraph( Text const & text, Buffer const & buf, @@ -518,8 +528,8 @@ void makeParagraph( auto nextpar = par; ++nextpar; auto pars = par->simpleDocBookOnePar(buf, runparams, text.outerFont(distance(begin, par)), 0, nextpar == end, special_case); - for (auto & parXML : pars) { - if (!std::all_of(parXML.begin(), parXML.end(), ::isspace)) { + for (docstring const & parXML : pars) { + if (isNotOnlySpace(parXML)) { if (open_par) openParTag(xs, &*par, prevpar);