]> git.lyx.org Git - features.git/commitdiff
Revert "Fix assertion for InsetInfos of icon types"
authorVincent van Ravesteijn <vfr@lyx.org>
Sat, 18 May 2013 15:06:15 +0000 (17:06 +0200)
committerVincent van Ravesteijn <vfr@lyx.org>
Sun, 19 May 2013 10:48:29 +0000 (12:48 +0200)
Using "Font no_font" in case no font was supplied was wrong. Instantiating a font object without specifying the language lead to a font object having the default_language that is hardcoded to "english". See Language::read().

This caused that there were spurious language changes in the LaTeX output
and made some document uncompilable.

This reverts commit 361995459068a5e53b597f1195f7f29522714ec4.

src/Paragraph.cpp

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