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.
This commit is contained in:
Vincent van Ravesteijn 2013-04-28 21:47:37 +02:00
parent 88eae06611
commit 3619954590

View File

@ -767,7 +767,7 @@ void Paragraph::Private::insertChar(pos_type pos, char_type c,
bool Paragraph::insertInset(pos_type pos, Inset * inset, bool Paragraph::insertInset(pos_type pos, Inset * inset,
Change const & change) Font const & font, Change const & change)
{ {
LASSERT(inset, return false); LASSERT(inset, return false);
LASSERT(pos >= 0 && pos <= size(), 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 // Some insets require run of spell checker
requestSpellCheck(pos); requestSpellCheck(pos);
setFont(pos, font);
return true; return true;
} }
@ -1783,12 +1785,10 @@ void Paragraph::insertChar(pos_type pos, char_type c,
bool Paragraph::insertInset(pos_type pos, Inset * inset, bool Paragraph::insertInset(pos_type pos, Inset * inset,
Font const & font, Change const & change) Change const & change)
{ {
bool const success = insertInset(pos, inset, change); Font no_font;
// Set the font/language of the inset... return insertInset(pos, inset, no_font, change);
setFont(pos, font);
return success;
} }