mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
Return reference to this in operator=()
This is the recommendede signature of assignment operators and was found by cppcheck.
This commit is contained in:
parent
d4a79d81d2
commit
c09663d2cb
@ -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 == ¶ms)
|
||||
return;
|
||||
return *this;
|
||||
copy(params);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user