]> git.lyx.org Git - lyx.git/commitdiff
Add missing intializations
authorGeorg Baum <baum@lyx.org>
Sat, 10 Oct 2015 19:04:28 +0000 (21:04 +0200)
committerGeorg Baum <baum@lyx.org>
Sat, 10 Oct 2015 19:04:28 +0000 (21:04 +0200)
These were found by cppcheck:
Member variable 'x' is not initialized in the constructor.
The crash #9788 would not have happened if this had been done earlier.

src/BufferView.cpp
src/Trans.cpp
src/Trans.h
src/frontends/qt4/GuiWorkArea.cpp
src/mathed/InsetMathDelim.cpp
src/mathed/InsetMathDots.cpp
src/mathed/InsetMathGrid.cpp
src/mathed/InsetMathUnknown.cpp
src/mathed/InsetMathXYArrow.cpp
src/support/gzstream.h
src/tex2lyx/table.cpp

index 097a465f7b2fdee50f67212ba9fb290574f9b3e0..b07eb2b37f71ed2ed695fedc1b914beeaf82a13f 100644 (file)
@@ -234,7 +234,9 @@ struct BufferView::Private
                mouse_position_cache_(),
                bookmark_edit_position_(-1), gui_(0),
                horiz_scroll_offset_(0)
-       {}
+       {
+               xsel_cache_.set = false;
+       }
 
        ///
        ScrollbarParameters scrollbarParameters_;
index 0e7d561c4e3bc891ba81f36767375123e07c7bbe..9249e8e8d4e00acb814e07c4b038ae309f672f06 100644 (file)
@@ -429,10 +429,9 @@ tex_accent getkeymod(string const & p)
 
 
 // TransFSMData
-TransFSMData::TransFSMData()
+TransFSMData::TransFSMData() : deadkey_(0), deadkey2_(0), init_state_(0),
+       deadkey_state_(0), combined_state_(0), currentState(0)
 {
-       deadkey_ = deadkey2_ = 0;
-       deadkey_info_.accent = deadkey2_info_.accent = TEX_NOACCENT;
 }
 
 
index 7bfea6b545d937c60104fe707e5748ae270734a7..4befc657402071db3f2755ba1f150efd5f0c835a 100644 (file)
@@ -90,6 +90,8 @@ extern TeXAccent get_accent(FuncCode action);
 
 ///
 struct Keyexc {
+       ///
+       Keyexc() : c('\0'), combined(false), accent(TEX_NOACCENT) {}
        /// character to make exception
        char_type c;
        /// exception data
@@ -106,6 +108,8 @@ typedef std::list<Keyexc> KmodException;
 ///
 class KmodInfo {
 public:
+       ///
+       KmodInfo() : accent(TEX_NOACCENT) {}
        ///
        docstring data;
        ///
index 11596d5a1a536ebb832a6bf80177560ce03e632c..2bd7c8e5b1825fcbede7f02b1a9b69819c70dd4c 100644 (file)
@@ -132,7 +132,9 @@ namespace frontend {
 
 class CursorWidget {
 public:
-       CursorWidget() {
+       CursorWidget() : rtl_(false), l_shape_(false), completable_(false),
+               show_(false), x_(0), cursor_width_(0)
+       {
                recomputeWidth();
        }
 
@@ -244,10 +246,11 @@ SyntheticMouseEvent::SyntheticMouseEvent()
 
 
 GuiWorkArea::Private::Private(GuiWorkArea * parent)
-: p(parent), screen_(0), buffer_view_(0), lyx_view_(0), cursor_visible_(false),
+: p(parent), screen_(0), buffer_view_(0), read_only_(false), lyx_view_(0),
+cursor_visible_(false), cursor_(0),
 need_resize_(false), schedule_redraw_(false), preedit_lines_(1),
 pixel_ratio_(1.0),
-completer_(new GuiCompleter(p, p))
+completer_(new GuiCompleter(p, p)), dialog_mode_(false)
 {
 }
 
index fb4f8f4d87c4a756f96e3d913ffac765b3338d11..3671606e9f001bdb49413b4aa4e6892797520585 100644 (file)
@@ -43,13 +43,13 @@ static docstring convertDelimToLatexName(docstring const & name)
 
 InsetMathDelim::InsetMathDelim(Buffer * buf, docstring const & l,
                docstring const & r)
-       : InsetMathNest(buf, 1), left_(l), right_(r)
+       : InsetMathNest(buf, 1), left_(l), right_(r), dw_(0)
 {}
 
 
 InsetMathDelim::InsetMathDelim(Buffer * buf, docstring const & l, docstring const & r,
        MathData const & ar)
-       : InsetMathNest(buf, 1), left_(l), right_(r)
+       : InsetMathNest(buf, 1), left_(l), right_(r), dw_(0)
 {
        cell(0) = ar;
 }
index 67ed8298980ff421d2c2ec9d7571d540047588da..b44d391512492ef9f5451381336a3ae36e4f2bd7 100644 (file)
@@ -25,7 +25,7 @@
 namespace lyx {
 
 InsetMathDots::InsetMathDots(latexkeys const * key)
-       : key_(key)
+       : dh_(0), key_(key)
 {}
 
 
index a9970f440efeb959b6b7a4e80d9516c9e4390e5c..781d921b1292738880d5fbb93b71084a6feb2568 100644 (file)
@@ -81,7 +81,7 @@ static void resetGrid(InsetMathGrid & grid)
 
 
 InsetMathGrid::CellInfo::CellInfo()
-       : multi_(CELL_NORMAL)
+       : multi_(CELL_NORMAL), glue_(0), begin_(0), end_(0)
 {}
 
 
@@ -90,7 +90,8 @@ InsetMathGrid::CellInfo::CellInfo()
 
 
 InsetMathGrid::RowInfo::RowInfo()
-       : lines_(0), skip_(0), allow_newpage_(true)
+       : descent_(0), ascent_(0), offset_(0), lines_(0), skip_(0),
+         allow_newpage_(true)
 {}
 
 
@@ -106,7 +107,7 @@ int InsetMathGrid::RowInfo::skipPixels(MetricsInfo const & mi) const
 
 
 InsetMathGrid::ColInfo::ColInfo()
-       : align_('c'), lines_(0), skip_(0)
+       : align_('c'), width_(0), offset_(0), lines_(0), skip_(0)
 {}
 
 
index 29dae2b971ee27f588f4be2a6a18b713448923e5..d7e2875521dea2f68f351d678841bda41a55723e 100644 (file)
@@ -23,7 +23,8 @@ namespace lyx {
 
 InsetMathUnknown::InsetMathUnknown(docstring const & nm,
        docstring const & selection, bool final, bool black)
-       : name_(nm), final_(final), black_(black), selection_(selection)
+       : name_(nm), final_(final), black_(black), kerning_(0),
+         selection_(selection)
 {}
 
 
index 0cb525c15a0e28b69842dff8dea6d42ec604b850..80aeb7276b5435d9a9119ef808992280b4be32dd 100644 (file)
@@ -22,7 +22,7 @@ namespace lyx {
 
 
 InsetMathXYArrow::InsetMathXYArrow()
-       : InsetMathNest(2)
+       : InsetMathNest(2), up_(false), target_(0)
 {}
 
 
index 858784dae94ea018a2e9dc2546924c439fc35712..d333dd424ee1c70b2a570d1e7e5c72c8584f9864 100644 (file)
@@ -57,7 +57,7 @@ private:
 
     int flush_buffer();
 public:
-    gzstreambuf() : opened(0) {
+    gzstreambuf() : opened(0), mode(0) {
         setp( buffer, buffer + (bufferSize-1));
         setg( buffer + 4,     // beginning of putback area
               buffer + 4,     // read position
index 6da3059a02bb8a079105040db3da5de31dd79d57..ad0331b5233a128be7ef5d8e32b7ef44ad57c563 100644 (file)
@@ -144,7 +144,7 @@ public:
 class ltType {
 public:
        // constructor
-       ltType() : topDL(false), bottomDL(false), empty(false) {}
+       ltType() : set(false), topDL(false), bottomDL(false), empty(false) {}
        // we have this header type (is set in the getLT... functions)
        bool set;
        // double borders on top