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() {
delete pxpm;
}
LineMarker &operator=(const LineMarker &) {
LineMarker &operator=(const LineMarker &other) {
// 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);
alpha = SC_ALPHA_NOALPHA;
delete pxpm;
pxpm = NULL;
if ( &other != this ) {
markType = SC_MARK_CIRCLE;
fore = ColourDesired(0,0,0);
back = ColourDesired(0xff,0xff,0xff);
alpha = SC_ALPHA_NOALPHA;
delete pxpm;
pxpm = NULL;
}
return *this;
}
void RefreshColourPalette(Palette &pal, bool want);