Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.8, 0.8.1, and 0.8.2

cmenu: avoid to have two consecutive separators

Changeset 2a037d492016

Parent 5777e0448d56

by Giampaolo Fadel

Changes to one file · Browse files at 2a037d492016 Showing diff from parent 5777e0448d56 Diff from another changeset...

 
342
343
344
 
345
346
347
348
 
 
 
 
 
 
 
 
349
350
351
352
 
353
 
 
354
355
356
 
342
343
344
345
346
347
 
 
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
@@ -342,15 +342,25 @@
  if (hSubMenu)   {   UINT indexSubMenu = 0; + bool isSeparator = true ;   for( walk = entries ; *walk != EndOfList ; walk++ )   { - if( *walk == Separator ) - InsertMenu(hSubMenu, indexSubMenu++, MF_SEPARATOR | MF_BYPOSITION, 0, NULL); + if( *walk == Separator) + { + if (!isSeparator) + { + InsertMenu(hSubMenu, indexSubMenu++, MF_SEPARATOR | MF_BYPOSITION, 0, NULL); + isSeparator = true ; + } + }   else   {   UINT idx = (UINT) *walk;   if( !promoted[idx] ) + {   InsertMenuItemByName(hSubMenu, menuDescList[idx].name, indexSubMenu++, idCmd++, idCmdFirst, ""); + isSeparator = false ; + }   }   }   }