From: Richard Heck Date: Thu, 14 Aug 2008 15:44:36 +0000 (+0000) Subject: Do the last commit the right way. The previous one led to a crash because I wasn't X-Git-Tag: 1.6.10~3644 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=42c5781bceb74e9aa014d411fad6f5d8e1fa1385;p=lyx.git Do the last commit the right way. The previous one led to a crash because I wasn't returning a fully realized font. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26163 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/Text2.cpp b/src/Text2.cpp index 1254fbf99c..0386ae764f 100644 --- a/src/Text2.cpp +++ b/src/Text2.cpp @@ -74,6 +74,7 @@ bool Text::isMainText(Buffer const & buffer) const } +// Note that this is supposed to return a fully realized font. FontInfo Text::layoutFont(Buffer const & buffer, pit_type const pit) const { Layout const & layout = pars_[pit].layout(); @@ -84,9 +85,11 @@ FontInfo Text::layoutFont(Buffer const & buffer, pit_type const pit) const if (layout.font.family() == INHERIT_FAMILY) lf.setFamily(buffer.params().getFont().fontInfo().family()); InsetCollapsable const * icp = pars_[pit].inInset()->asInsetCollapsable(); - if (icp) - lf.update(icp->getLayout().font(), false); - return lf; + if (!icp) + return lf; + FontInfo icf = icp->getLayout().font(); + icf.realize(lf); + return icf; } FontInfo font = layout.font; @@ -98,6 +101,7 @@ FontInfo Text::layoutFont(Buffer const & buffer, pit_type const pit) const } +// Note that this is supposed to return a fully realized font. FontInfo Text::labelFont(Buffer const & buffer, Paragraph const & par) const { Layout const & layout = par.layout(); @@ -108,9 +112,11 @@ FontInfo Text::labelFont(Buffer const & buffer, Paragraph const & par) const if (layout.labelfont.family() == INHERIT_FAMILY) lf.setFamily(buffer.params().getFont().fontInfo().family()); InsetCollapsable const * icp = par.inInset()->asInsetCollapsable(); - if (icp) - lf.update(icp->getLayout().labelfont(), false); - return lf; + if (!icp) + return lf; + FontInfo icf = icp->getLayout().labelfont(); + icf.realize(lf); + return icf; } FontInfo font = layout.labelfont;