# HG changeset patch # User Adrian Buehlmann <adr...@cadifra.com> # Date 1259163498 -3600 # Node ID 5c9682fb8cd7f5b6e44b3243a92800c8df28d4d4 # Parent 3ce6960d9c850503a67d1c8278b11ca2a5559473 shellext: replace tabs with spaces in CShellExtCMenu.cpp
diff --git a/win32/shellext/CShellExtCMenu.cpp b/win32/shellext/CShellExtCMenu.cpp --- a/win32/shellext/CShellExtCMenu.cpp +++ b/win32/shellext/CShellExtCMenu.cpp @@ -222,43 +222,43 @@ void InsertMenuItemWithIcon1( HMENU hMenu, UINT indexMenu, UINT idCmd, const std::wstring& menuText, const std::string& iconName) { - MENUITEMINFOW mi; - memset(&mi, 0, sizeof(mi)); + MENUITEMINFOW mi; + memset(&mi, 0, sizeof(mi)); mi.cbSize = sizeof(mi); mi.dwTypeData = const_cast<wchar_t*>(menuText.c_str()); mi.cch = static_cast<UINT>(menuText.length()); mi.wID = idCmd; mi.fType = MFT_STRING; - if (SysInfo::Instance().IsVistaOrLater()) - { - TDEBUG_TRACE(" InsertMenuItemWithIcon1: Vista or later detected, using modern context menu style"); - HBITMAP hBmp = GetTortoiseIconBitmap(iconName); - if (hBmp) - { - mi.fMask = MIIM_STRING | MIIM_FTYPE | MIIM_ID | MIIM_BITMAP; - mi.hbmpItem = hBmp; - } - else - { - TDEBUG_TRACE(" InsertMenuItemWithIcon1: can't find " + iconName); - mi.fMask = MIIM_TYPE | MIIM_ID; - } - } - else - { - HICON h = GetTortoiseIcon(iconName); - if (h) - { - mi.fMask = MIIM_STRING | MIIM_FTYPE | MIIM_ID | MIIM_BITMAP | MIIM_DATA; - mi.dwItemData = (ULONG_PTR) h; - mi.hbmpItem = HBMMENU_CALLBACK; - } - else - { - TDEBUG_TRACE(" InsertMenuItemWithIcon1: can't find " + iconName); - mi.fMask = MIIM_TYPE | MIIM_ID; - } + if (SysInfo::Instance().IsVistaOrLater()) + { + TDEBUG_TRACE(" InsertMenuItemWithIcon1: Vista or later detected, using modern context menu style"); + HBITMAP hBmp = GetTortoiseIconBitmap(iconName); + if (hBmp) + { + mi.fMask = MIIM_STRING | MIIM_FTYPE | MIIM_ID | MIIM_BITMAP; + mi.hbmpItem = hBmp; + } + else + { + TDEBUG_TRACE(" InsertMenuItemWithIcon1: can't find " + iconName); + mi.fMask = MIIM_TYPE | MIIM_ID; + } + } + else + { + HICON h = GetTortoiseIcon(iconName); + if (h) + { + mi.fMask = MIIM_STRING | MIIM_FTYPE | MIIM_ID | MIIM_BITMAP | MIIM_DATA; + mi.dwItemData = (ULONG_PTR) h; + mi.hbmpItem = HBMMENU_CALLBACK; + } + else + { + TDEBUG_TRACE(" InsertMenuItemWithIcon1: can't find " + iconName); + mi.fMask = MIIM_TYPE | MIIM_ID; + } } InsertMenuItemW(hMenu, indexMenu, TRUE, &mi); @@ -271,8 +271,8 @@ void InsertSubMenuItemWithIcon2( HMENU hMenu, HMENU hSubMenu, UINT indexMenu, UINT idCmd, const std::wstring& menuText, const std::string& iconName) { - MENUITEMINFOW mi; - memset(&mi, 0, sizeof(mi)); + MENUITEMINFOW mi; + memset(&mi, 0, sizeof(mi)); mi.cbSize = sizeof(mi); mi.fType = MFT_STRING; mi.dwTypeData = const_cast<wchar_t*>(menuText.c_str()); @@ -280,35 +280,35 @@ void InsertSubMenuItemWithIcon2( mi.wID = idCmd; mi.hSubMenu = hSubMenu; - if (SysInfo::Instance().IsVistaOrLater()) - { - TDEBUG_TRACE(" InsertMenuItemWithIcon1: Vista or later detected, using modern context menu style"); - HBITMAP hBmp = GetTortoiseIconBitmap(iconName); - if (hBmp) - { - mi.fMask = MIIM_SUBMENU | MIIM_STRING | MIIM_FTYPE | MIIM_ID | MIIM_BITMAP; - mi.hbmpItem = hBmp; - } - else - { - TDEBUG_TRACE(" InsertSubMenuItemWithIcon2: can't find " + iconName); - mi.fMask = MIIM_TYPE | MIIM_ID; - } - } - else - { - HICON h = GetTortoiseIcon(iconName); - if (h) - { - mi.fMask = MIIM_SUBMENU | MIIM_STRING | MIIM_ID; - mi.dwItemData = (ULONG_PTR) h; - mi.hbmpItem = HBMMENU_CALLBACK; - } - else - { - TDEBUG_TRACE(" InsertSubMenuItemWithIcon2: can't find " + iconName); - mi.fMask = MIIM_TYPE | MIIM_ID; - } + if (SysInfo::Instance().IsVistaOrLater()) + { + TDEBUG_TRACE(" InsertMenuItemWithIcon1: Vista or later detected, using modern context menu style"); + HBITMAP hBmp = GetTortoiseIconBitmap(iconName); + if (hBmp) + { + mi.fMask = MIIM_SUBMENU | MIIM_STRING | MIIM_FTYPE | MIIM_ID | MIIM_BITMAP; + mi.hbmpItem = hBmp; + } + else + { + TDEBUG_TRACE(" InsertSubMenuItemWithIcon2: can't find " + iconName); + mi.fMask = MIIM_TYPE | MIIM_ID; + } + } + else + { + HICON h = GetTortoiseIcon(iconName); + if (h) + { + mi.fMask = MIIM_SUBMENU | MIIM_STRING | MIIM_ID; + mi.dwItemData = (ULONG_PTR) h; + mi.hbmpItem = HBMMENU_CALLBACK; + } + else + { + TDEBUG_TRACE(" InsertSubMenuItemWithIcon2: can't find " + iconName); + mi.fMask = MIIM_TYPE | MIIM_ID; + } } InsertMenuItemW(hMenu, indexMenu, TRUE, &mi); @@ -482,18 +482,18 @@ CShellExtCMenu::QueryContextMenu( if (isSeparator && indexSubMenu > 0) RemoveMenu(hSubMenu, indexSubMenu - 1, MF_BYPOSITION); - if (SysInfo::Instance().IsVistaOrLater()) - { - MENUINFO MenuInfo; - - memset(&MenuInfo, 0, sizeof(MenuInfo)); + if (SysInfo::Instance().IsVistaOrLater()) + { + MENUINFO MenuInfo; + + memset(&MenuInfo, 0, sizeof(MenuInfo)); - MenuInfo.cbSize = sizeof(MenuInfo); - MenuInfo.fMask = MIM_STYLE | MIM_APPLYTOSUBMENUS; - MenuInfo.dwStyle = MNS_CHECKORBMP; - - SetMenuInfo(hSubMenu, &MenuInfo); - } + MenuInfo.cbSize = sizeof(MenuInfo); + MenuInfo.fMask = MIM_STYLE | MIM_APPLYTOSUBMENUS; + MenuInfo.dwStyle = MNS_CHECKORBMP; + + SetMenuInfo(hSubMenu, &MenuInfo); + } } TDEBUG_TRACE(" CShellExtCMenu::QueryContextMenu: adding main THG menu"); @@ -504,18 +504,18 @@ CShellExtCMenu::QueryContextMenu( InitStatus::check(); - if (SysInfo::Instance().IsVistaOrLater()) - { - MENUINFO MenuInfo; + if (SysInfo::Instance().IsVistaOrLater()) + { + MENUINFO MenuInfo; - memset(&MenuInfo, 0, sizeof(MenuInfo)); + memset(&MenuInfo, 0, sizeof(MenuInfo)); - MenuInfo.cbSize = sizeof(MenuInfo); - MenuInfo.fMask = MIM_STYLE | MIM_APPLYTOSUBMENUS; - MenuInfo.dwStyle = MNS_CHECKORBMP; + MenuInfo.cbSize = sizeof(MenuInfo); + MenuInfo.fMask = MIM_STYLE | MIM_APPLYTOSUBMENUS; + MenuInfo.dwStyle = MNS_CHECKORBMP; - SetMenuInfo(hMenu, &MenuInfo); - } + SetMenuInfo(hMenu, &MenuInfo); + } return ResultFromShort(idCmd - idCmdFirst); } ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Tortoisehg-develop mailing list Tortoisehg-develop@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tortoisehg-develop