From a34ce7ca85ddd41f3a6216a74d68719bcdfea3db Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Wed, 17 Jul 2013 09:14:39 -0400 Subject: [PATCH] Fix crash reported by Scott on the list. The test on latexname() was obviously wrong. We want to know if we are in the same layout, and that is not enough. --- src/output_xhtml.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/output_xhtml.cpp b/src/output_xhtml.cpp index 5130740fb7..281ffc2971 100644 --- a/src/output_xhtml.cpp +++ b/src/output_xhtml.cpp @@ -864,15 +864,19 @@ ParagraphList::const_iterator findEndOfEnvironment( // it can happen. We pretend that it's just at lowest depth. if (style.latextype == LATEX_COMMAND) return p; + // If depth is down, we're done if (p->params().depth() < depth) return p; + // If depth is up, we're not done if (p->params().depth() > depth) continue; - // Now we know we are at the same depth - if (style.latextype == LATEX_PARAGRAPH - || style.latexname() != bstyle.latexname()) + + // FIXME I am not sure about the first check. + // Surely we *could* have different layouts that count as + // LATEX_PARAGRAPH, right? + if (style.latextype == LATEX_PARAGRAPH || style != bstyle) return p; } return pend;