mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 10:00:33 +00:00
Do not crash is release mode if we stumble across an unrealized font.
This commit is contained in:
parent
8884c4044d
commit
c560e6b3a6
@ -95,11 +95,24 @@ static GuiFontInfo * fontinfo_[NUM_FAMILIES][NUM_SERIES][NUM_SHAPE][NUM_SIZE];
|
|||||||
// if not cached, create it.
|
// if not cached, create it.
|
||||||
GuiFontInfo & fontinfo(FontInfo const & f)
|
GuiFontInfo & fontinfo(FontInfo const & f)
|
||||||
{
|
{
|
||||||
// LASSERT: Is there anything we might do here besides crash?
|
bool const fontIsRealized =
|
||||||
LBUFERR(f.family() < NUM_FAMILIES);
|
(f.family() < NUM_FAMILIES) &&
|
||||||
LBUFERR(f.series() < NUM_SERIES);
|
(f.series() < NUM_SERIES) &&
|
||||||
LBUFERR(f.realShape() < NUM_SHAPE);
|
(f.realShape() < NUM_SHAPE) &&
|
||||||
LBUFERR(f.size() < NUM_SIZE);
|
(f.size() < NUM_SIZE);
|
||||||
|
if (!fontIsRealized) {
|
||||||
|
// We can reset the font to something sensible in release mode.
|
||||||
|
LATTEST(false);
|
||||||
|
LYXERR0("Unrealized font!");
|
||||||
|
// We could be fancier here, if we wanted, and just fix things where
|
||||||
|
// there is a problem. But it doesn't seem worth it, since we should
|
||||||
|
// not be here in the first place.
|
||||||
|
GuiFontInfo * & fi =
|
||||||
|
fontinfo_[sane_font.family()][sane_font.series()][sane_font.realShape()][sane_font.size()];
|
||||||
|
if (!fi)
|
||||||
|
fi = new GuiFontInfo(f);
|
||||||
|
return *fi;
|
||||||
|
}
|
||||||
// fi is a reference to the pointer type (GuiFontInfo *) in the
|
// fi is a reference to the pointer type (GuiFontInfo *) in the
|
||||||
// fontinfo_ table.
|
// fontinfo_ table.
|
||||||
GuiFontInfo * & fi =
|
GuiFontInfo * & fi =
|
||||||
|
@ -104,7 +104,11 @@ void InsetArgument::updateBuffer(ParIterator const & it, UpdateType utype)
|
|||||||
name_ = convert<string>(ours);
|
name_ = convert<string>(ours);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Layout::LaTeXArgMap::const_iterator const lait = args.find(name_);
|
|
||||||
|
// FIXME It does not look to me as if this needs to be redone
|
||||||
|
// over and over again. All the arguments are coming from the
|
||||||
|
// layout. If that changes....
|
||||||
|
Layout::LaTeXArgMap::const_iterator const lait = args.find(name_);
|
||||||
if (lait != args.end()) {
|
if (lait != args.end()) {
|
||||||
docstring label = translateIfPossible((*lait).second.labelstring);
|
docstring label = translateIfPossible((*lait).second.labelstring);
|
||||||
docstring striplabel;
|
docstring striplabel;
|
||||||
|
Loading…
Reference in New Issue
Block a user