commit b296941d90ef1b09bb8c64d9f312e1fedf2c9720 Author: Juergen Spitzmueller <sp...@lyx.org> Date: Sun Mar 6 09:48:39 2022 +0100
Revert "Don't asssert on (too) deeply nested items" This reverts commit 44d1756783262ae0af39991e18ec9bcb847fb439. --- src/BufferParams.cpp | 32 ++++++++------------------------ 1 files changed, 8 insertions(+), 24 deletions(-) diff --git a/src/BufferParams.cpp b/src/BufferParams.cpp index b1846be..95aa913 100644 --- a/src/BufferParams.cpp +++ b/src/BufferParams.cpp @@ -633,45 +633,29 @@ bool BufferParams::spellignored(WordLangTuple const & wl) const Bullet & BufferParams::temp_bullet(lyx::size_type const 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); + LASSERT(index < 4, return pimpl_->temp_bullets[0]); + return pimpl_->temp_bullets[index]; } Bullet const & BufferParams::temp_bullet(lyx::size_type const index) const { - 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; + LASSERT(index < 4, return pimpl_->temp_bullets[0]); + return pimpl_->temp_bullets[index]; } Bullet & BufferParams::user_defined_bullet(lyx::size_type const 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); + LASSERT(index < 4, return pimpl_->temp_bullets[0]); + return pimpl_->user_defined_bullets[index]; } Bullet const & BufferParams::user_defined_bullet(lyx::size_type const index) const { - 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; + LASSERT(index < 4, return pimpl_->temp_bullets[0]); + return pimpl_->user_defined_bullets[index]; } -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs