[LyX/master] DocBook: improve comments.

Thibaut Cuvelier tcuvelier at lyx.org
Sat Sep 19 18:18:55 UTC 2020


commit bdea21a87e7b54747ced9f913659e0e2fe6590c6
Author: Thibaut Cuvelier <tcuvelier at lyx.org>
Date:   Tue Aug 18 04:56:25 2020 +0200

    DocBook: improve comments.
---
 src/xml.h |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/xml.h b/src/xml.h
index 0948143..69d582d 100644
--- a/src/xml.h
+++ b/src/xml.h
@@ -39,7 +39,7 @@ struct CR;
 class XMLStream {
 public:
 	///
-	explicit XMLStream(odocstream & os): os_(os), escape_(ESCAPE_ALL), is_last_tag_cr_(false) {}
+	explicit XMLStream(odocstream & os): os_(os), escape_(ESCAPE_ALL), is_last_tag_cr_(true) {}
 	///
 	odocstream & os() { return os_; }
 	///
@@ -82,7 +82,7 @@ public:
 	enum EscapeSettings {
 		ESCAPE_NONE,
 		ESCAPE_AND, // meaning &
-		ESCAPE_ALL, // meaning <, >, &, at present
+		ESCAPE_ALL, // meaning <, >, &, at present, except things that are forbidden in comments
 		ESCAPE_COMMENTS // Anything that is forbidden within comments
 	};
 	/// Sets what we are going to escape on the NEXT write.
@@ -98,7 +98,9 @@ public:
 	bool isTagOpen(xml::EndTag const &, int maxdepth = -1) const;
 	///
 	bool isTagPending(xml::StartTag const &, int maxdepth = -1) const;
-	///
+	/// Is the last tag that was added to the stream a new line (CR)? This is mostly to known
+	/// whether a new line must be added. Therefore, consider that an empty stream just had a CR,
+	/// that simplifies the logic using this code.
 	bool isLastTagCR() const { return is_last_tag_cr_; };
 	///
 	void writeError(std::string const &) const;


More information about the lyx-cvs mailing list