[LyX/master] LengthValidator: initialize properly positive_
Jean-Marc Lasgouttes
lasgouttes at lyx.org
Fri Jan 29 17:28:38 UTC 2021
commit dca5646163853d4c202211e6612f6fd8d38db417
Author: Jean-Marc Lasgouttes <lasgouttes at lyx.org>
Date: Fri Jan 29 18:17:16 2021 +0100
LengthValidator: initialize properly positive_
Spotted by coverity.
---
src/frontends/qt/Validator.cpp | 3 +--
src/frontends/qt/Validator.h | 16 ++++++++--------
2 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/src/frontends/qt/Validator.cpp b/src/frontends/qt/Validator.cpp
index 83dcb0c..c938f0e 100644
--- a/src/frontends/qt/Validator.cpp
+++ b/src/frontends/qt/Validator.cpp
@@ -34,8 +34,7 @@ namespace lyx {
namespace frontend {
LengthValidator::LengthValidator(QWidget * parent)
- : QValidator(parent),
- no_bottom_(true), glue_length_(false), unsigned_(false)
+ : QValidator(parent)
{}
diff --git a/src/frontends/qt/Validator.h b/src/frontends/qt/Validator.h
index c023f61..681541f 100644
--- a/src/frontends/qt/Validator.h
+++ b/src/frontends/qt/Validator.h
@@ -61,18 +61,18 @@ public:
//@{
void setBottom(Length const &);
void setBottom(GlueLength const &);
- Length bottom() const { return bottom_; }
+ Length bottom() const { return bottom_; }
void setUnsigned(bool const u) { unsigned_ = u; }
- void setPositive(bool const u) { positive_ = u; }
+ void setPositive(bool const u) { positive_ = u; }
//@}
private:
- Length bottom_;
- GlueLength glue_bottom_;
- bool no_bottom_;
- bool glue_length_;
- bool unsigned_;
- bool positive_;
+ Length bottom_;
+ GlueLength glue_bottom_;
+ bool no_bottom_ = true;
+ bool glue_length_ = false;
+ bool unsigned_ = false;
+ bool positive_ = false;
};
More information about the lyx-cvs
mailing list