André Hentschel : comdlg32: Remove duplicate code ( PVS-Studio).
Module: wine Branch: master Commit: c4747f46cfa83a69801f6e961a938ca91fbf80fc URL: http://source.winehq.org/git/wine.git/?a=commit;h=c4747f46cfa83a69801f6e961a... Author: André Hentschel <nerv(a)dawncrow.de> Date: Tue Oct 28 00:02:11 2014 +0100 comdlg32: Remove duplicate code (PVS-Studio). --- dlls/comdlg32/filedlg.c | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/dlls/comdlg32/filedlg.c b/dlls/comdlg32/filedlg.c index 0f1a144..f76d01e 100644 --- a/dlls/comdlg32/filedlg.c +++ b/dlls/comdlg32/filedlg.c @@ -3270,7 +3270,6 @@ static LRESULT FILEDLG95_LOOKIN_DrawItem(LPDRAWITEMSTRUCT pDIStruct) int iIndentation; TEXTMETRICW tm; LPSFOLDER tmpFolder; - LookInInfos *liInfos = GetPropA(pDIStruct->hwndItem,LookInInfosStr); UINT shgfi_flags = SHGFI_PIDL | SHGFI_OPENICON | SHGFI_SYSICONINDEX | SHGFI_DISPLAYNAME; UINT icon_width, icon_height; @@ -3293,16 +3292,8 @@ static LRESULT FILEDLG95_LOOKIN_DrawItem(LPDRAWITEMSTRUCT pDIStruct) shgfi_flags |= SHGFI_SMALLICON; } - if(pDIStruct->itemID == liInfos->uSelectedItem) - { - ilItemImage = (HIMAGELIST) SHGetFileInfoW ((LPCWSTR) tmpFolder->pidlItem, - 0, &sfi, sizeof (sfi), shgfi_flags ); - } - else - { - ilItemImage = (HIMAGELIST) SHGetFileInfoW ((LPCWSTR) tmpFolder->pidlItem, - 0, &sfi, sizeof (sfi), shgfi_flags ); - } + ilItemImage = (HIMAGELIST) SHGetFileInfoW ((LPCWSTR) tmpFolder->pidlItem, + 0, &sfi, sizeof (sfi), shgfi_flags ); /* Is this item selected ? */ if(pDIStruct->itemState & ODS_SELECTED) @@ -3320,16 +3311,10 @@ static LRESULT FILEDLG95_LOOKIN_DrawItem(LPDRAWITEMSTRUCT pDIStruct) /* Do not indent item if drawing in the edit of the combo */ if(pDIStruct->itemState & ODS_COMBOBOXEDIT) - { iIndentation = 0; - ilItemImage = (HIMAGELIST) SHGetFileInfoW ((LPCWSTR) tmpFolder->pidlItem, - 0, &sfi, sizeof (sfi), shgfi_flags ); - - } else - { iIndentation = tmpFolder->m_iIndent; - } + /* Draw text and icon */ /* Initialise the icon display area */
participants (1)
-
Alexandre Julliard