Rob Shearman : credui: Check for and don' t add duplicates when filling the username combo box.

Alexandre Julliard julliard at winehq.org
Mon Nov 19 08:19:40 CST 2007


Module: wine
Branch: master
Commit: 4002964259e9d461f9e917b09da85498c3305d7e
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=4002964259e9d461f9e917b09da85498c3305d7e

Author: Rob Shearman <rob at codeweavers.com>
Date:   Sat Nov 17 17:31:16 2007 +0000

credui: Check for and don't add duplicates when filling the username combo box.

---

 dlls/credui/credui_main.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/dlls/credui/credui_main.c b/dlls/credui/credui_main.c
index 83fb183..e7960d4 100644
--- a/dlls/credui/credui_main.c
+++ b/dlls/credui/credui_main.c
@@ -142,6 +142,8 @@ static void CredDialogFillUsernameCombo(HWND hwndUsername, struct cred_dialog_pa
     for (i = 0; i < count; i++)
     {
         COMBOBOXEXITEMW comboitem;
+        DWORD j;
+        BOOL duplicate = FALSE;
 
         if (params->dwFlags & CREDUI_FLAGS_GENERIC_CREDENTIALS)
         {
@@ -154,6 +156,17 @@ static void CredDialogFillUsernameCombo(HWND hwndUsername, struct cred_dialog_pa
                 continue;
         }
 
+        /* don't add another item with the same name if we've already added it */
+        for (j = 0; j < i; j++)
+            if (!strcmpW(credentials[i]->UserName, credentials[j]->UserName))
+            {
+                duplicate = TRUE;
+                break;
+            }
+
+        if (duplicate)
+            continue;
+
         comboitem.mask = CBEIF_TEXT;
         comboitem.iItem = -1;
         comboitem.pszText = credentials[i]->UserName;




More information about the wine-cvs mailing list