From 361995459068a5e53b597f1195f7f29522714ec4 Mon Sep 17 00:00:00 2001 From: Vincent van Ravesteijn Date: Sun, 28 Apr 2013 21:47:37 +0200 Subject: [PATCH] Fix assertion for InsetInfos of icon types InsetInfo inserted insets in its text without specifying a font. This caused the fonlist to be incomplete and firing the assertion. --- src/Paragraph.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp index 6fc44a0d75..be955097dc 100644 --- a/src/Paragraph.cpp +++ b/src/Paragraph.cpp @@ -767,7 +767,7 @@ void Paragraph::Private::insertChar(pos_type pos, char_type c, bool Paragraph::insertInset(pos_type pos, Inset * inset, - Change const & change) + Font const & font, Change const & change) { LASSERT(inset, return false); LASSERT(pos >= 0 && pos <= size(), return false); @@ -785,6 +785,8 @@ bool Paragraph::insertInset(pos_type pos, Inset * inset, // Some insets require run of spell checker requestSpellCheck(pos); + + setFont(pos, font); return true; } @@ -1783,12 +1785,10 @@ void Paragraph::insertChar(pos_type pos, char_type c, bool Paragraph::insertInset(pos_type pos, Inset * inset, - Font const & font, Change const & change) + Change const & change) { - bool const success = insertInset(pos, inset, change); - // Set the font/language of the inset... - setFont(pos, font); - return success; + Font no_font; + return insertInset(pos, inset, no_font, change); } -- 2.39.2