]> git.lyx.org Git - lyx.git/blobdiff - src/lyxlayout.C
Fix loop when opening TOC widget in an empty document, basically by Richard Heck.
[lyx.git] / src / lyxlayout.C
index b81ea994251c7bcc7da7ffffd2770320830d31bd..b5f7223c6e48aaec86550fb5fdaff44f0f7ade29 100644 (file)
@@ -450,8 +450,10 @@ bool LyXLayout::read(LyXLex & lexrc, LyXTextClass const & tclass)
                        break;
 
                case LT_LABELSTRING:    // label string definition
-                       if (lexrc.next())
+                       if (lexrc.next()) {
                                labelstring_ = trim(lexrc.getDocString());
+                               labelstring_appendix_ = labelstring_;
+                       }
                        break;
 
                case LT_ENDLABELSTRING: // endlabel string definition
@@ -486,8 +488,6 @@ bool LyXLayout::read(LyXLex & lexrc, LyXTextClass const & tclass)
        }
        lexrc.popTable();
 
-       if (labelstring_appendix_.empty())
-               labelstring_appendix_ = labelstring_;
        return error;
 }