]> git.lyx.org Git - features.git/blobdiff - src/output_docbook.cpp
Consider single-cell insets when pasting multiple cells (#11906)
[features.git] / src / output_docbook.cpp
index f15c70a4ba6a38fb2f71ed667a97152b0b059cc8..a8ac4eaa3ef469e56376e8b0997528c9adb5ea70 100644 (file)
@@ -946,16 +946,17 @@ void docbookParagraphs(Text const &text,
                                docstring id = docstring();
                                for (pos_type i = 0; i < par->size(); ++i) {
                                        Inset const *inset = par->getInset(i);
-                                       if (inset && dynamic_cast<InsetLabel const *>(inset)) {
-                                               // Generate the attributes for the section if need be.
-                                               auto label = dynamic_cast<InsetLabel const *>(inset);
-                                               id += "xml:id=\"" + xml::cleanID(label->screenLabel()) + "\"";
+                                       if (inset) {
+                                               if (auto label = dynamic_cast<InsetLabel const *>(inset)) {
+                                                       // Generate the attributes for the section if need be.
+                                                       id += "xml:id=\"" + xml::cleanID(label->screenLabel()) + "\"";
 
-                                               // Don't output the ID as a DocBook <anchor>.
-                                               ourparams.docbook_anchors_to_ignore.emplace(label->screenLabel());
+                                                       // Don't output the ID as a DocBook <anchor>.
+                                                       ourparams.docbook_anchors_to_ignore.emplace(label->screenLabel());
 
-                                               // Cannot have multiple IDs per tag.
-                                               break;
+                                                       // Cannot have multiple IDs per tag.
+                                                       break;
+                                               }
                                        }
                                }