diff options
author | nyamatongwe <devnull@localhost> | 2012-04-21 15:56:24 +1000 |
---|---|---|
committer | nyamatongwe <devnull@localhost> | 2012-04-21 15:56:24 +1000 |
commit | 52c72dee14c0a6a5127d319759cfd427059505e2 (patch) | |
tree | eec370b8979d23263e6c7be1576b1e15a0062371 /src | |
parent | 423f81b9e19da08af4992aca9acdf8cfa121413a (diff) | |
download | scintilla-mirror-52c72dee14c0a6a5127d319759cfd427059505e2.tar.gz |
Avoid warning from cppcheck for not checking for self assignment.
Diffstat (limited to 'src')
-rw-r--r-- | src/LineMarker.h | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/src/LineMarker.h b/src/LineMarker.h index a501ed6a1..5c73a6217 100644 --- a/src/LineMarker.h +++ b/src/LineMarker.h @@ -36,7 +36,7 @@ public: image = NULL; } LineMarker(const LineMarker &) { - // Defined to avoid pxpm being blindly copied, not as real copy constructor + // Defined to avoid pxpm being blindly copied, not as a complete copy constructor markType = SC_MARK_CIRCLE; fore = ColourDesired(0,0,0); back = ColourDesired(0xff,0xff,0xff); @@ -49,17 +49,19 @@ public: delete pxpm; delete image; } - LineMarker &operator=(const LineMarker &) { - // Defined to avoid pxpm being blindly copied, not as real assignment operator - markType = SC_MARK_CIRCLE; - fore = ColourDesired(0,0,0); - back = ColourDesired(0xff,0xff,0xff); - backSelected = ColourDesired(0xff,0x00,0x00); - alpha = SC_ALPHA_NOALPHA; - delete pxpm; - pxpm = NULL; - delete image; - image = NULL; + LineMarker &operator=(const LineMarker &other) { + // Defined to avoid pxpm being blindly copied, not as a complete assignment operator + if (this != &other) { + markType = SC_MARK_CIRCLE; + fore = ColourDesired(0,0,0); + back = ColourDesired(0xff,0xff,0xff); + backSelected = ColourDesired(0xff,0x00,0x00); + alpha = SC_ALPHA_NOALPHA; + delete pxpm; + pxpm = NULL; + delete image; + image = NULL; + } return *this; } void SetXPM(const char *textForm); |