mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-08 18:19:42 +00:00
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
This commit is contained in:
parent
004b672399
commit
42c5781bce
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user