commit c09663d2cb3ba57639e412488f1c58ebe76b04d8
Author: Georg Baum <[email protected]>
Date:   Sun Sep 13 19:43:44 2015 +0200

    Return reference to this in operator=()
    
    This is the recommendede signature of assignment operators and was found by
    cppcheck.

diff --git a/src/insets/InsetGraphicsParams.cpp 
b/src/insets/InsetGraphicsParams.cpp
index 15d6cad..e158e81 100644
--- a/src/insets/InsetGraphicsParams.cpp
+++ b/src/insets/InsetGraphicsParams.cpp
@@ -50,12 +50,13 @@ 
InsetGraphicsParams::InsetGraphicsParams(InsetGraphicsParams const & igp)
 }
 
 
-void InsetGraphicsParams::operator=(InsetGraphicsParams const & params)
+InsetGraphicsParams & InsetGraphicsParams::operator=(InsetGraphicsParams const 
& params)
 {
        // Are we assigning the object into itself?
        if (this == &params)
-               return;
+               return *this;
        copy(params);
+       return *this;
 }
 
 
diff --git a/src/insets/InsetGraphicsParams.h b/src/insets/InsetGraphicsParams.h
index 78d2ebf..4fa54d7 100644
--- a/src/insets/InsetGraphicsParams.h
+++ b/src/insets/InsetGraphicsParams.h
@@ -68,7 +68,7 @@ public:
        ///
        InsetGraphicsParams(InsetGraphicsParams const &);
        ///
-       void operator=(InsetGraphicsParams const &);
+       InsetGraphicsParams & operator=(InsetGraphicsParams const &);
        /// Save the parameters in the LyX format stream.
        /// Buffer is needed to figure out if a figure is embedded.
        void Write(std::ostream & os, Buffer const & buf) const;

Reply via email to