+
+ // Check if this one is active (i.e., neither deleted with change-tracking
+ // nor in an inset that does not produce output, such as notes or inactive branches)
+ Paragraph const & para = it.paragraph();
+ active_ = !para.isDeleted(it.pos()) && para.inInset().producesOutput();
+ // If not, check whether we are in a deleted/non-outputting inset
+ if (active_) {
+ for (size_type sl = 0 ; sl < it.depth() ; ++sl) {
+ Paragraph const & outer_par = it[sl].paragraph();
+ if (outer_par.isDeleted(it[sl].pos())
+ || !outer_par.inInset().producesOutput()) {
+ active_ = false;
+ break;
+ }
+ }
+ }
+