=?UTF-8?Q?Ri=C4=8Dardas=20Barkauskas=20?=: comctl32: Avoid code duplication by reusing PROPSHEET_GetPageIndex.

Alexandre Julliard julliard at winehq.org
Wed Dec 26 14:05:17 CST 2012


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

Author: Ričardas Barkauskas <rbarkauskas at codeweavers.com>
Date:   Fri Dec 21 19:07:17 2012 +0200

comctl32: Avoid code duplication by reusing PROPSHEET_GetPageIndex.

---

 dlls/comctl32/propsheet.c |    7 +------
 1 files changed, 1 insertions(+), 6 deletions(-)

diff --git a/dlls/comctl32/propsheet.c b/dlls/comctl32/propsheet.c
index c3db7e3..f2c55ab 100644
--- a/dlls/comctl32/propsheet.c
+++ b/dlls/comctl32/propsheet.c
@@ -2561,16 +2561,11 @@ static LRESULT PROPSHEET_IndexToHwnd(HWND hwndDlg, int iPageIndex)
  */
 static LRESULT PROPSHEET_PageToIndex(HWND hwndDlg, HPROPSHEETPAGE hPage)
 {
-    int index;
     PropSheetInfo * psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
 
     TRACE("(%p, %p)\n", hwndDlg, hPage);
 
-    for (index = 0; index < psInfo->nPages; index++)
-        if (psInfo->proppage[index].hpage == hPage)
-            return index;
-    WARN("%p not found\n", hPage);
-    return -1;
+    return PROPSHEET_GetPageIndex(hPage, psInfo, -1);
 }
 
 /******************************************************************************




More information about the wine-cvs mailing list