Skip to content

Commit

Permalink
Added extra check for duplicate groupids when creating new groups on …
Browse files Browse the repository at this point in the history
…Vista/Win7+
  • Loading branch information
snakefoot committed Jun 19, 2012
1 parent c08b018 commit a524f06
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions CGridListCtrlEx/CGridListCtrlGroups.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,18 @@ LRESULT CGridListCtrlGroups::InsertGroupHeader(int nIndex, int nGroupId, const C
lg.cchHeader = (int)header.Length();
#endif

#ifdef _DEBUG
if (IsGroupStateEnabled())
{
// Extra check as Vista/Win7+ doesn't complain about inserting the same groupid twice
CSimpleArray<int> groupIds;
if (GetGroupIds(groupIds))
{
for(int i = 0 ; i < groupIds.GetSize(); ++i)
VERIFY( groupIds[i] != nGroupId );
}
}
#endif
return InsertGroup(nIndex, (PLVGROUP)&lg );
}

Expand Down

0 comments on commit a524f06

Please # to comment.