diff options
author | nyamatongwe <unknown> | 2012-04-21 15:56:24 +1000 |
---|---|---|
committer | nyamatongwe <unknown> | 2012-04-21 15:56:24 +1000 |
commit | fa48a920b4520fac4feab563cae0f812ea284dbc (patch) | |
tree | 0fd935f24ddef874a12a4f5e7f627f307a7e6bce /src | |
parent | 119aa76054d6aa99a9366fa8d32948d74fac3247 (diff) | |
download | scintilla-mirror-fa48a920b4520fac4feab563cae0f812ea284dbc.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); |