commit 41fda35c596bc9b70da7839cc7a3b8409fed82cc
Author: Georg Baum <b...@lyx.org>
Date:   Mon Jun 6 21:55:39 2016 +0200

    Fix cppcheck initialization warnings

diff --git a/src/Compare.cpp b/src/Compare.cpp
index f5046bd..68570b8 100644
--- a/src/Compare.cpp
+++ b/src/Compare.cpp
@@ -61,10 +61,10 @@ public:
                : from(from_), to(to_)
        {}
 
-       DocRange(Buffer const * buf)
+       DocRange(Buffer const * buf) :
+               from(doc_iterator_begin(buf)),
+               to(doc_iterator_end(buf))
        {
-               from = doc_iterator_begin(buf);
-               to = doc_iterator_end(buf);
                to.backwardPos();
        }
 
diff --git a/src/DocIterator.cpp b/src/DocIterator.cpp
index 28d23e8..57286d9 100644
--- a/src/DocIterator.cpp
+++ b/src/DocIterator.cpp
@@ -671,9 +671,9 @@ ostream & operator<<(ostream & os, DocIterator const & dit)
 
 ///////////////////////////////////////////////////////
 
-StableDocIterator::StableDocIterator(DocIterator const & dit)
+StableDocIterator::StableDocIterator(DocIterator const & dit) :
+       data_(dit.internalData())
 {
-       data_ = dit.internalData();
        for (size_t i = 0, n = data_.size(); i != n; ++i)
                data_[i].inset_ = 0;
 }
diff --git a/src/InsetList.cpp b/src/InsetList.cpp
index 56401a4..3d4f715 100644
--- a/src/InsetList.cpp
+++ b/src/InsetList.cpp
@@ -42,9 +42,8 @@ struct InsetTablePosLess
 } // namespace anon
 
 
-InsetList::InsetList(InsetList const & il)
+InsetList::InsetList(InsetList const & il) : list_(il.list_)
 {
-       list_ = il.list_;
        List::iterator it = list_.begin();
        List::iterator end = list_.end();
        for (; it != end; ++it)
diff --git a/src/PrinterParams.cpp b/src/PrinterParams.cpp
index 5bcdeb9..9da9c9a 100644
--- a/src/PrinterParams.cpp
+++ b/src/PrinterParams.cpp
@@ -23,7 +23,6 @@ namespace lyx {
 PrinterParams::PrinterParams() 
 {
        target = PRINTER;
-       file_name = std::string();
        all_pages = true;
        from_page = 1;
        to_page = 0;
diff --git a/src/SpellChecker.h b/src/SpellChecker.h
index 425925c..f908ba2 100644
--- a/src/SpellChecker.h
+++ b/src/SpellChecker.h
@@ -47,6 +47,8 @@ public:
                NO_DICTIONARY
        };
 
+       SpellChecker() : change_number_(0) {}
+
        virtual ~SpellChecker() {}
 
        /// does the spell check failed
diff --git a/src/Text.cpp b/src/Text.cpp
index c003350..7946054 100644
--- a/src/Text.cpp
+++ b/src/Text.cpp
@@ -187,9 +187,8 @@ Text::Text(InsetText * owner, bool use_default_layout)
 
 
 Text::Text(InsetText * owner, Text const & text)
-       : owner_(owner)
+       : owner_(owner), pars_(text.pars_)
 {
-       pars_ = text.pars_;
        ParagraphList::iterator const end = pars_.end();
        ParagraphList::iterator it = pars_.begin();
        for (; it != end; ++it)

Reply via email to