From: Juergen Spitzmueller Date: Sun, 30 Dec 2018 17:27:28 +0000 (+0100) Subject: When checking inset activity status, also check containing insets X-Git-Tag: lyx-2.4.0dev-acb2ca7b~2772 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=5cfd25697;p=features.git When checking inset activity status, also check containing insets which could be deteled --- diff --git a/src/insets/InsetLabel.cpp b/src/insets/InsetLabel.cpp index f6538f4c45..c3bf43f117 100644 --- a/src/insets/InsetLabel.cpp +++ b/src/insets/InsetLabel.cpp @@ -148,7 +148,17 @@ void InsetLabel::updateBuffer(ParIterator const & par, UpdateType utype) // Check if this one is deleted (ct) Paragraph const & para = par.paragraph(); - bool const active = !para.isDeleted(par.pos()); + bool active = !para.isDeleted(par.pos()); + // If not, check whether we are in a deleted inset + if (active) { + for (size_type sl = 0 ; sl < par.depth() ; ++sl) { + Paragraph const & outer_par = par[sl].paragraph(); + if (outer_par.isDeleted(par[sl].pos())) { + active = false; + break; + } + } + } if (buffer().activeLabel(label) && active) { // Problem: We already have an active InsetLabel with the same name!