No changes, just minor wxMSW code cleanup: use WinStruct<>.

Use WinStruct instead of the usual ZeroMemory() + cbSize setting fragment to
initialize Win32 structs that need to be initialized in this way.

No real changes.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70383 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2012-01-18 10:05:27 +00:00
parent 89041b2513
commit be85a191e1
4 changed files with 8 additions and 24 deletions

View File

@@ -190,9 +190,7 @@ void SetDefaultMenuItem(HMENU WXUNUSED_IN_WINCE(hmenu),
UINT WXUNUSED_IN_WINCE(id))
{
#ifndef __WXWINCE__
MENUITEMINFO mii;
wxZeroMemory(mii);
mii.cbSize = sizeof(MENUITEMINFO);
WinStruct<MENUITEMINFO> mii;
mii.fMask = MIIM_STATE;
mii.fState = MFS_DEFAULT;
@@ -210,9 +208,7 @@ void SetOwnerDrawnMenuItem(HMENU WXUNUSED_IN_WINCE(hmenu),
BOOL WXUNUSED_IN_WINCE(byPositon = FALSE))
{
#ifndef __WXWINCE__
MENUITEMINFO mii;
wxZeroMemory(mii);
mii.cbSize = sizeof(MENUITEMINFO);
WinStruct<MENUITEMINFO> mii;
mii.fMask = MIIM_FTYPE | MIIM_DATA;
mii.fType = MFT_OWNERDRAW;
mii.dwItemData = data;
@@ -230,9 +226,7 @@ void SetOwnerDrawnMenuItem(HMENU WXUNUSED_IN_WINCE(hmenu),
#ifdef __WXWINCE__
UINT GetMenuState(HMENU hMenu, UINT id, UINT flags)
{
MENUITEMINFO info;
wxZeroMemory(info);
info.cbSize = sizeof(info);
WinStruct<MENUITEMINFO> info;
info.fMask = MIIM_STATE;
// MF_BYCOMMAND is zero so test MF_BYPOSITION
if ( !::GetMenuItemInfo(hMenu, id, flags & MF_BYPOSITION ? TRUE : FALSE , & info) )
@@ -913,9 +907,7 @@ void wxMenu::SetTitle(const wxString& label)
{
// modify the title
#ifdef __WXWINCE__
MENUITEMINFO info;
wxZeroMemory(info);
info.cbSize = sizeof(info);
WinStruct<MENUITEMINFO> info;
info.fMask = MIIM_TYPE;
info.fType = MFT_STRING;
info.cch = m_title.length();
@@ -1269,9 +1261,7 @@ void wxMenuBar::SetMenuLabel(size_t pos, const wxString& label)
}
#ifdef __WXWINCE__
MENUITEMINFO info;
wxZeroMemory(info);
info.cbSize = sizeof(info);
WinStruct<MENUITEMINFO> info;
info.fMask = MIIM_TYPE;
info.fType = MFT_STRING;
info.cch = label.length();