commit 1c2628b5de383724daa8a203ad3878044a5eb304
Author: Juergen Spitzmueller <[email protected]>
Date:   Sun Mar 6 17:27:28 2022 +0100

    Do not try to access user_defined_bullet with nesting > 3
    
    We only have 4 nesting labels available.
    
    In the workarea, display a fallback label with deeper nesting.
---
 src/Buffer.cpp     |    5 ++++-
 src/RowPainter.cpp |    2 +-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/Buffer.cpp b/src/Buffer.cpp
index 54272a7..5295a4b 100644
--- a/src/Buffer.cpp
+++ b/src/Buffer.cpp
@@ -5158,7 +5158,10 @@ void Buffer::Impl::setLabel(ParIterator & it, UpdateType 
utype) const
        switch(layout.labeltype) {
        case LABEL_ITEMIZE: {
                par.params().labelString(
-                       bp.user_defined_bullet(par.itemdepth).getLabel());
+                       (par.itemdepth < 4)
+                                       ? 
bp.user_defined_bullet(par.itemdepth).getLabel()
+                                         // Display fallback for too deeply 
nested items
+                                       : bformat(from_ascii("[?%1$d]"), 
int(par.itemdepth + 1)));
                break;
        }
 
diff --git a/src/RowPainter.cpp b/src/RowPainter.cpp
index 84848ec..4f5593e 100644
--- a/src/RowPainter.cpp
+++ b/src/RowPainter.cpp
@@ -434,7 +434,7 @@ void RowPainter::paintLabel() const
        FontInfo lfont = font;
 
        // bullet?
-       if (layout.labeltype == LABEL_ITEMIZE) {
+       if (layout.labeltype == LABEL_ITEMIZE && par_.itemdepth < 4) {
                // get label font size from document properties
                
lfont.setSize(pi_.base.bv->buffer().params().user_defined_bullet(par_.itemdepth).getFontSize());
                // realize to avoid assertion
-- 
lyx-cvs mailing list
[email protected]
http://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to