commit 879cf7aa443bf0bfd8579ddf2eee1e838564fd01
Author: Thibaut Cuvelier <[email protected]>
Date: Mon May 12 01:27:59 2025 +0200
XMLStream: easy creation of an EndTag from a StartTag.
Otherwise, the syntax is a bit clumsy, you think you are accessing private
fields (which are not private, because tags are structs) and you might forget
to copy the tag type (which would yield unexpected XML results).
---
src/xml.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/xml.h b/src/xml.h
index 346e42d78c..b7133f69fa 100644
--- a/src/xml.h
+++ b/src/xml.h
@@ -219,6 +219,9 @@ struct EndTag
///
explicit EndTag(docstring const & tag, std::string const & tagtype =
"none")
: tag_(tag), tagtype_(tagtype) {}
+ /// Create an EndTag corresponding to the given StartTag.
+ explicit EndTag(StartTag const & start_tag)
+ : tag_(start_tag.tag_), tagtype_(start_tag.tagtype_) {}
///
virtual ~EndTag() = default;
/// </tag_>
--
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs