assigning line marker to itself shouldn't invalidate it, add self-assignment check

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56770 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2008-11-14 23:18:39 +00:00
parent 557946748f
commit e81ea1070d

View File

@@ -39,14 +39,16 @@ public:
~LineMarker() { ~LineMarker() {
delete pxpm; delete pxpm;
} }
LineMarker &operator=(const LineMarker &) { LineMarker &operator=(const LineMarker &other) {
// Defined to avoid pxpm being blindly copied, not as real assignment operator // Defined to avoid pxpm being blindly copied, not as real assignment operator
markType = SC_MARK_CIRCLE; if ( &other != this ) {
fore = ColourDesired(0,0,0); markType = SC_MARK_CIRCLE;
back = ColourDesired(0xff,0xff,0xff); fore = ColourDesired(0,0,0);
alpha = SC_ALPHA_NOALPHA; back = ColourDesired(0xff,0xff,0xff);
delete pxpm; alpha = SC_ALPHA_NOALPHA;
pxpm = NULL; delete pxpm;
pxpm = NULL;
}
return *this; return *this;
} }
void RefreshColourPalette(Palette &pal, bool want); void RefreshColourPalette(Palette &pal, bool want);