summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
2c55673)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36863
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
+- Fixed crash with ownerdrawn menu items accelerators (Perry Miller)
- wxFileDialog respects absence of wxCHANGE_DIR flag under NT (Brad Anderson).
- Switching page of a hidden notebook doesn't lose focus (Jamie Gadd).
- Removed wxImageList *GetImageList(int) const.
- wxFileDialog respects absence of wxCHANGE_DIR flag under NT (Brad Anderson).
- Switching page of a hidden notebook doesn't lose focus (Jamie Gadd).
- Removed wxImageList *GetImageList(int) const.
MENUITEMINFO mii;
wxZeroMemory(mii);
mii.cbSize = sizeof(MENUITEMINFO);
MENUITEMINFO mii;
wxZeroMemory(mii);
mii.cbSize = sizeof(MENUITEMINFO);
+
+ // we could use MIIM_FTYPE here as we only need to know if the item is
+ // ownerdrawn or not and not dwTypeData which MIIM_TYPE also returns, but
+ // MIIM_FTYPE is not supported under Win95
mii.fMask = MIIM_TYPE | MIIM_DATA;
// find if we have this letter in any owner drawn item
const int count = ::GetMenuItemCount(hmenu);
for ( int i = 0; i < count; i++ )
{
mii.fMask = MIIM_TYPE | MIIM_DATA;
// find if we have this letter in any owner drawn item
const int count = ::GetMenuItemCount(hmenu);
for ( int i = 0; i < count; i++ )
{
+ // previous loop iteration could modify it, reset it back before
+ // calling GetMenuItemInfo() to prevent it from overflowing dwTypeData
+ mii.cch = 0;
+
if ( ::GetMenuItemInfo(hmenu, i, TRUE, &mii) )
{
if ( mii.fType == MFT_OWNERDRAW )
if ( ::GetMenuItemInfo(hmenu, i, TRUE, &mii) )
{
if ( mii.fType == MFT_OWNERDRAW )
}
else // failed to get the menu text?
{
}
else // failed to get the menu text?
{
- // it's not fatal, so don't show error, but still log
- // it
+ // it's not fatal, so don't show error, but still log it
wxLogLastError(_T("GetMenuItemInfo"));
}
}
wxLogLastError(_T("GetMenuItemInfo"));
}
}