[LyX/master] Fixup 00c39208: initialise ParagraphMetrics::id_ in default constructor

Jean-Marc Lasgouttes lasgouttes at lyx.org
Wed Mar 15 21:34:50 UTC 2023


commit 175bcc6efce6644105c73eb93c0d532d5bb1e517
Author: Jean-Marc Lasgouttes <lasgouttes at lyx.org>
Date:   Wed Mar 15 23:36:41 2023 +0100

    Fixup 00c39208: initialise ParagraphMetrics::id_ in default constructor
    
    This was missing. Spotted by coverity.
---
 src/ParagraphMetrics.h |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/ParagraphMetrics.h b/src/ParagraphMetrics.h
index e0d9ce0..0d186f1 100644
--- a/src/ParagraphMetrics.h
+++ b/src/ParagraphMetrics.h
@@ -29,7 +29,7 @@ class Paragraph;
 class ParagraphMetrics {
 public:
 	/// Default constructor (only here for STL containers).
-	ParagraphMetrics() : position_(0), par_(0) {}
+	ParagraphMetrics() {}
 	/// The only useful constructor.
 	explicit ParagraphMetrics(Paragraph const & par);
 
@@ -77,15 +77,15 @@ public:
 
 private:
 	///
-	int position_;
+	int position_ = 0;
 	///
-	int id_;
+	int id_ = -1;
 	///
 	mutable RowList rows_;
 	/// cached dimensions of paragraph
 	Dimension dim_;
 	///
-	Paragraph const * par_;
+	Paragraph const * par_ = nullptr;
 };
 
 } // namespace lyx


More information about the lyx-cvs mailing list