]> git.lyx.org Git - lyx.git/blobdiff - src/Paragraph.cpp
Fix bug 4232: Crash on bad counter name.
[lyx.git] / src / Paragraph.cpp
index 0a3f739e74c61655af95007a2bffde8ea4bc2890..67ca915d105eebeeeb1a10eb332c4049c89c539e 100644 (file)
@@ -28,6 +28,7 @@
 #include "Language.h"
 #include "LaTeXFeatures.h"
 #include "Color.h"
+#include "Layout.h"
 #include "Length.h"
 #include "Font.h"
 #include "LyXRC.h"
@@ -1657,7 +1658,9 @@ docstring Paragraph::expandLabel(LayoutPtr const & layout,
                size_t const j = fmt.find('@', i + 1);
                if (j != docstring::npos) {
                        docstring parent(fmt, i + 1, j - i - 1);
-                       docstring label = expandLabel(tclass[parent], bparams,
+                       docstring label = from_ascii("XXXX");
+                       if (tclass.hasLayout(parent))
+                               docstring label = expandLabel(tclass[parent], bparams,
                                                      process_appendix);
                        fmt = docstring(fmt, 0, i) + label 
                                + docstring(fmt, j + 1, docstring::npos);