]> git.lyx.org Git - lyx.git/commitdiff
Fix assertion: icon in insetinfo without a font
authorVincent van Ravesteijn <vfr@lyx.org>
Sun, 19 May 2013 10:28:11 +0000 (12:28 +0200)
committerVincent van Ravesteijn <vfr@lyx.org>
Sun, 19 May 2013 10:48:34 +0000 (12:48 +0200)
InsetInfos of the type ICON have a graphics Inset in their paragraph.
These insets were inserted without a font. This lead to an assertion in
Paragraph::fontSpan because the fontlist_ of the paragraph is empty.

src/insets/InsetInfo.cpp

index 2b9b231903e00ab5910493aaa20c5578c0062b24..d914d949389c4bf95e32f22f4fa1f1bae3f8725e 100644 (file)
@@ -381,7 +381,7 @@ void InsetInfo::updateInfo()
                        // do not insert > for the top level menu item
                        if (it != beg)
                                par.insertInset(par.size(), new InsetSpecialChar(InsetSpecialChar::MENU_SEPARATOR),
-                                               Change(Change::UNCHANGED));
+                                               f, Change(Change::UNCHANGED));
                        //FIXME: add proper underlines here. This
                        // involves rewriting searchMenu used above to
                        // return a vector of menus. If we do not do
@@ -412,7 +412,8 @@ void InsetInfo::updateInfo()
                igp.filename = file;
                inset->setParams(igp);
                clear();
-               paragraphs().front().insertInset(0, inset, 
+               Font const f(inherit_font, buffer().params().language);
+               paragraphs().front().insertInset(0, inset, f,
                                                 Change(Change::UNCHANGED));
                break;
        }