mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
Don't asssert on (too) deeply nested items
Use a fallback label instead.
This commit is contained in:
parent
ed2e242b1e
commit
44d1756783
@ -633,29 +633,45 @@ bool BufferParams::spellignored(WordLangTuple const & wl) const
|
||||
|
||||
Bullet & BufferParams::temp_bullet(lyx::size_type const index)
|
||||
{
|
||||
LASSERT(index < 4, return pimpl_->temp_bullets[0]);
|
||||
return pimpl_->temp_bullets[index];
|
||||
if (index < 4)
|
||||
return pimpl_->temp_bullets[index];
|
||||
// Fallback bullet if we are too deeply nested
|
||||
docstring const fb = from_ascii("?") + convert<docstring>(index + 1);
|
||||
Bullet const & res = Bullet(fb);
|
||||
return const_cast<Bullet&>(res);
|
||||
}
|
||||
|
||||
|
||||
Bullet const & BufferParams::temp_bullet(lyx::size_type const index) const
|
||||
{
|
||||
LASSERT(index < 4, return pimpl_->temp_bullets[0]);
|
||||
return pimpl_->temp_bullets[index];
|
||||
if (index < 4)
|
||||
return pimpl_->temp_bullets[index];
|
||||
// Fallback bullet if we are too deeply nested
|
||||
docstring const fb = from_ascii("?") + convert<docstring>(index + 1);
|
||||
Bullet const & res = Bullet(fb);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
Bullet & BufferParams::user_defined_bullet(lyx::size_type const index)
|
||||
{
|
||||
LASSERT(index < 4, return pimpl_->temp_bullets[0]);
|
||||
return pimpl_->user_defined_bullets[index];
|
||||
if (index < 4)
|
||||
return pimpl_->user_defined_bullets[index];
|
||||
// Fallback bullet if we are too deeply nested
|
||||
docstring const fb = from_ascii("?") + convert<docstring>(index + 1);
|
||||
Bullet const & res = Bullet(fb);
|
||||
return const_cast<Bullet&>(res);
|
||||
}
|
||||
|
||||
|
||||
Bullet const & BufferParams::user_defined_bullet(lyx::size_type const index) const
|
||||
{
|
||||
LASSERT(index < 4, return pimpl_->temp_bullets[0]);
|
||||
return pimpl_->user_defined_bullets[index];
|
||||
if (index < 4)
|
||||
return pimpl_->user_defined_bullets[index];
|
||||
// Fallback bullet if we are too deeply nested
|
||||
docstring const fb = from_ascii("?") + convert<docstring>(index + 1);
|
||||
Bullet const & res = Bullet(fb);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user