Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
379d492b
Commit
379d492b
authored
Dec 21, 2012
by
Ričardas Barkauskas
Committed by
Alexandre Julliard
Dec 26, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32: Use index value if property sheet page isn't found.
parent
beffac00
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
27 deletions
+15
-27
propsheet.c
dlls/comctl32/propsheet.c
+14
-26
propsheet.c
dlls/comctl32/tests/propsheet.c
+1
-1
No files found.
dlls/comctl32/propsheet.c
View file @
379d492b
...
...
@@ -168,7 +168,7 @@ static BOOL PROPSHEET_SetCurSel(HWND hwndDlg,
int
index
,
int
skipdir
,
HPROPSHEETPAGE
hpage
);
static
int
PROPSHEET_GetPageIndex
(
HPROPSHEETPAGE
hpage
,
const
PropSheetInfo
*
psInfo
);
static
int
PROPSHEET_GetPageIndex
(
HPROPSHEETPAGE
hpage
,
const
PropSheetInfo
*
psInfo
,
int
original_index
);
static
PADDING_INFO
PROPSHEET_GetPaddingInfoWizard
(
HWND
hwndDlg
,
const
PropSheetInfo
*
psInfo
);
static
BOOL
PROPSHEET_DoCommand
(
HWND
hwnd
,
WORD
wID
);
static
BOOL
PROPSHEET_RemovePage
(
HWND
hwndDlg
,
int
index
,
HPROPSHEETPAGE
hpage
);
...
...
@@ -1998,9 +1998,8 @@ static BOOL PROPSHEET_SetCurSel(HWND hwndDlg,
HWND
hwndTabControl
=
GetDlgItem
(
hwndDlg
,
IDC_TABCONTROL
);
TRACE
(
"index %d, skipdir %d, hpage %p
\n
"
,
index
,
skipdir
,
hpage
);
/* hpage takes precedence over index */
if
(
hpage
!=
NULL
)
index
=
PROPSHEET_GetPageIndex
(
hpage
,
psInfo
);
index
=
PROPSHEET_GetPageIndex
(
hpage
,
psInfo
,
index
);
if
(
index
<
0
||
index
>=
psInfo
->
nPages
)
{
...
...
@@ -2331,13 +2330,8 @@ static BOOL PROPSHEET_RemovePage(HWND hwndDlg,
if
(
!
psInfo
)
{
return
FALSE
;
}
/*
* hpage takes precedence over index.
*/
if
(
hpage
!=
0
)
{
index
=
PROPSHEET_GetPageIndex
(
hpage
,
psInfo
);
}
index
=
PROPSHEET_GetPageIndex
(
hpage
,
psInfo
,
index
);
/* Make sure that index is within range */
if
(
index
<
0
||
index
>=
psInfo
->
nPages
)
...
...
@@ -2652,26 +2646,20 @@ static BOOL PROPSHEET_RecalcPageSizes(HWND hwndDlg)
* PROPSHEET_GetPageIndex
*
* Given a HPROPSHEETPAGE, returns the index of the corresponding page from
* the array of PropPageInfo.
* the array of PropPageInfo. If page is not found original index is used
* (page takes precedence over index).
*/
static
int
PROPSHEET_GetPageIndex
(
HPROPSHEETPAGE
hpage
,
const
PropSheetInfo
*
psInfo
)
static
int
PROPSHEET_GetPageIndex
(
HPROPSHEETPAGE
page
,
const
PropSheetInfo
*
psInfo
,
int
original_index
)
{
BOOL
found
=
FALSE
;
int
index
=
0
;
int
index
;
TRACE
(
"hpage %p
\n
"
,
hpage
);
while
((
index
<
psInfo
->
nPages
)
&&
(
found
==
FALSE
))
{
if
(
psInfo
->
proppage
[
index
].
hpage
==
hpage
)
found
=
TRUE
;
else
index
++
;
}
TRACE
(
"page %p index %d
\n
"
,
page
,
original_index
);
if
(
found
==
FALSE
)
index
=
-
1
;
for
(
index
=
0
;
index
<
psInfo
->
nPages
;
index
++
)
if
(
psInfo
->
proppage
[
index
].
hpage
==
page
)
return
index
;
return
index
;
return
original_
index
;
}
/******************************************************************************
...
...
dlls/comctl32/tests/propsheet.c
View file @
379d492b
...
...
@@ -821,7 +821,7 @@ if (0)
ok
(
r
==
4
,
"got %d
\n
"
,
r
);
/* select page that can't be created */
ret
=
SendMessageA
(
hdlg
,
PSM_SETCURSEL
,
3
,
0
);
ret
=
SendMessageA
(
hdlg
,
PSM_SETCURSEL
,
3
,
1
);
ok
(
ret
==
TRUE
,
"got %d
\n
"
,
ret
);
r
=
SendMessageA
(
tab
,
TCM_GETITEMCOUNT
,
0
,
0
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment