comctl32: Fix bitmap size calculation

Vitaliy Margolen wine-devel at kievinfo.com
Thu Mar 26 19:39:03 CDT 2009


Aleksey Bragin wrote:
> Fix bitmap size calculation in IMAGELIST_InternalExpandBitmaps and
> remove unneded parameter. Memory requirements are greatly reduced after
> this fix.
> 
> The bug was an ambiguous meaning of a cx parameter, which was supposed
> to be a width of an individual image inside the list, but width of a
> whole bitmap was passed in thus making memory requirements huge (number
> of images * width of whole bitmap = required bitmap size).
> Furthermore, cx parameter is redundant because all checks are already
> there (that the image list can't be reduced), and besides of that there
> is no use for it anymore. Thus it's been removed.

That bug was introduced while attempting to change the size of the bitmaps
for the toolbar. Looking at the code it's rely iffy if image list really
should be able to do that at all. Or that toolbar should handle the resize
itself (most likely).

The commit I'm talking about is:
commit 19cef6ca1059140d00ac8b445ab3f9eb0491f239
Author: Gerard Patel <g.patel at wanadoo.fr>
Date:   Sat Jul 8 12:48:37 2000 +0000

    Allow the size of bitmaps to be changed after toolbar buttons have
    been added.


With your patch you "disable" this ability (which I don't think is working
anyway). So some tests are in order. At least a test program demonstrating
what's the correct behavior.

Vitaliy



More information about the wine-devel mailing list