]> git.lyx.org Git - features.git/commitdiff
Avoid an assertion.
authorEnrico Forestieri <forenr@lyx.org>
Wed, 28 May 2014 18:50:45 +0000 (20:50 +0200)
committerEnrico Forestieri <forenr@lyx.org>
Wed, 28 May 2014 18:50:45 +0000 (20:50 +0200)
Do not assert if an inset separator is the only item of a List
environment. Although it is a weird thing to do, both GUI and
latex output can deal with it.

src/TextMetrics.cpp

index e8053cb36fe2262673eeea29af916dd41108d251..1b434a503c75a9951abf42542af3080c57adff28 100644 (file)
@@ -695,13 +695,13 @@ int TextMetrics::labelFill(pit_type const pit, Row const & row) const
        Paragraph const & par = text_->getPar(pit);
 
        pos_type last = par.beginOfBody();
-       LBUFERR(last > 0);
+       LBUFERR(last > 0 || par.isEnvSeparator(0));
 
        // -1 because a label ends with a space that is in the label
        --last;
 
        // a separator at this end does not count
-       if (par.isLineSeparator(last))
+       if (last >= 0 && par.isLineSeparator(last))
                --last;
 
        int w = 0;