#15389 closed defect (fixed)

wxImage::ConvertToDisabled does modify *this object in place

Reported by: jbbbms Owned by:
Priority: normal Milestone:
Component: GUI-all Version: 2.9.5
Keywords: wxImage, ConvertToDisabled Cc: vgdoqd@…
Blocked By: Blocking:
Patch: yes

Description

wxImage::ConvertToDisabled does modify *this object in place, which seems to unintentionally conflict with the const declaration of the method.

Please refer to the patch file. The op = of wxImage is to increase the ref count, not to deep copy *this. As the result, *this will be changed, which is probably not what we want. We will lose the original image.

Attachments (1)

image.diff download (453 bytes) - added by jbbbms 13 months ago.

Download all attachments as: .zip

Change History (4)

Changed 13 months ago by jbbbms

comment:1 Changed 13 months ago by jbbbms

  • Cc vgdoqd@… added
  • Keywords wxImage ConvertToDisabled added

comment:2 Changed 13 months ago by jbbbms

  • Keywords changed from wxImage ConvertToDisabled to wxImage, ConvertToDisabled

comment:3 Changed 13 months ago by PC

  • Resolution set to fixed
  • Status changed from new to closed

(In [74625]) Rewrite ConvertToGreyscale() and ConvertToDisabled()
They do almost the same thing, so use almost the same code.
Fixes ConvertToDisabled() modifying its own data.
Closes #15389

Note: See TracTickets for help on using tickets.