/* Calculate the distance between two menus and include the skip value of StartMenu. */
UINTN GetDistanceBetweenMenus(IN LIST_ENTRY *StartMenu, IN LIST_ENTRY *EndMenu)
/* Calculate the distance between two menus and include the skip value of StartMenu. */
UINTN GetDistanceBetweenMenus(IN LIST_ENTRY *StartMenu, IN LIST_ENTRY *EndMenu)
{
  LIST_ENTRY      *Link;
  UI_MENU_OPTION  *MenuOption;
  UINTN           Distance;
  Distance = 0;
  Link = StartMenu;
  while (Link != EndMenu) {
    MenuOption = MENU_OPTION_FROM_LINK (Link);
    if (MenuOption->Row == 0) {
      UpdateOptionSkipLines (MenuOption);
    }
    Distance += MenuOption->Skip;
    Link      = Link->BackLink;
  }
  return Distance;
}