Revert parts of r33578:

- First of all, MenuSetItemData is only called from InsertMenuA/W and ModifyMenuA/W.
  Therefore the passed MENUITEMINFO structure will always be empty, so it makes no sense to check for flags in this structure.
  This way, I could simplify the code block for MF_BITMAP.
- Also fType = MFT_BITMAP and fMask = MIIM_BITMAP at the same time passed to win32k don't work.
  Changing this back to only set fMask fixes bitmap menus.
- Furthermore the data for MF_OWNERDRAW is really stored in dwItemData and not in dwTypeData.
  The MSDN documentation for InsertMenu applies here, not the one for the MENUITEMINFO structure.
  This fixes owner-drawn menus like the one in Abiword.

See issue #3272 for more details.

svn path=/trunk/; revision=33958
This commit is contained in:
Colin Finck 2008-06-13 23:14:27 +00:00
parent 7a0f6cc635
commit aa42a19f40

View file

@ -3712,20 +3712,8 @@ MenuSetItemData(
*/
if(Flags & MF_BITMAP)
{
if (mii->fType & MFT_BITMAP)
{
/* use old way of storing bitmap */
mii->fMask |= (MIIM_TYPE | MIIM_FTYPE);
mii->fType |= MF_BITMAP;
mii->dwTypeData = (LPWSTR)NewItem;
}
else
{
/* use new way of storing type */
mii->hbmpItem = (HBITMAP) NewItem;
mii->fType |= MFT_BITMAP;
mii->fMask |= MIIM_BITMAP;
}
mii->fMask |= MIIM_BITMAP; /* Use the new way of seting hbmpItem.*/
mii->hbmpItem = (HBITMAP) NewItem;
if (Flags & MF_HELP)
{
@ -3736,8 +3724,8 @@ MenuSetItemData(
else if(Flags & MF_OWNERDRAW)
{
mii->fType |= MFT_OWNERDRAW;
mii->fMask |= (MIIM_TYPE | MIIM_FTYPE);
mii->dwTypeData = (LPWSTR) NewItem;
mii->fMask |= MIIM_DATA;
mii->dwItemData = (DWORD) NewItem;
}
else if (Flags & MF_SEPARATOR)
{