Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
b11208e5
Commit
b11208e5
authored
Sep 23, 2011
by
Nikolay Sivov
Committed by
Alexandre Julliard
Sep 23, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/monthcal: Fix MCM_GETMONTHRANGE with regard to multiple calendars and parameter handling.
parent
4a4678ca
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
32 deletions
+45
-32
monthcal.c
dlls/comctl32/monthcal.c
+37
-28
monthcal.c
dlls/comctl32/tests/monthcal.c
+8
-4
No files found.
dlls/comctl32/monthcal.c
View file @
b11208e5
...
...
@@ -1330,42 +1330,51 @@ MONTHCAL_SetFirstDayOfWeek(MONTHCAL_INFO *infoPtr, INT day)
static
LRESULT
MONTHCAL_GetMonthRange
(
const
MONTHCAL_INFO
*
infoPtr
,
DWORD
flag
,
SYSTEMTIME
*
st
)
{
INT
range
;
TRACE
(
"flag=%d, st=%p
\n
"
,
flag
,
st
);
if
(
st
)
switch
(
flag
)
{
case
GMR_VISIBLE
:
{
switch
(
flag
)
{
case
GMR_VISIBLE
:
{
st
[
0
]
=
infoPtr
->
calendars
[
0
].
month
;
st
[
1
]
=
infoPtr
->
calendars
[
MONTHCAL_GetCalCount
(
infoPtr
)
-
1
].
month
;
if
(
st
)
{
st
[
0
]
=
infoPtr
->
calendars
[
0
].
month
;
st
[
1
]
=
infoPtr
->
calendars
[
MONTHCAL_GetCalCount
(
infoPtr
)
-
1
].
month
;
if
(
st
[
0
].
wMonth
==
min_allowed_date
.
wMonth
&&
st
[
0
].
wYear
==
min_allowed_date
.
wYear
)
{
st
[
0
].
wDay
=
min_allowed_date
.
wDay
;
}
else
st
[
0
].
wDay
=
1
;
MONTHCAL_CalculateDayOfWeek
(
&
st
[
0
],
TRUE
);
if
(
st
[
0
].
wMonth
==
min_allowed_date
.
wMonth
&&
st
[
0
].
wYear
==
min_allowed_date
.
wYear
)
{
st
[
0
].
wDay
=
min_allowed_date
.
wDay
;
}
else
st
[
0
].
wDay
=
1
;
MONTHCAL_CalculateDayOfWeek
(
&
st
[
0
],
TRUE
);
st
[
1
].
wDay
=
MONTHCAL_MonthLength
(
st
[
1
].
wMonth
,
st
[
1
].
wYear
);
MONTHCAL_CalculateDayOfWeek
(
&
st
[
1
],
TRUE
);
st
[
1
].
wDay
=
MONTHCAL_MonthLength
(
st
[
1
].
wMonth
,
st
[
1
].
wYear
);
MONTHCAL_CalculateDayOfWeek
(
&
st
[
1
],
TRUE
);
}
return
MONTHCAL_GetCalCount
(
infoPtr
);
}
case
GMR_DAYSTATE
:
{
MONTHCAL_GetMinDate
(
infoPtr
,
&
st
[
0
]);
MONTHCAL_GetMaxDate
(
infoPtr
,
&
st
[
1
]);
break
;
}
default:
WARN
(
"Unknown flag value, got %d
\n
"
,
flag
);
}
range
=
MONTHCAL_GetCalCount
(
infoPtr
);
break
;
}
case
GMR_DAYSTATE
:
{
if
(
st
)
{
MONTHCAL_GetMinDate
(
infoPtr
,
&
st
[
0
]);
MONTHCAL_GetMaxDate
(
infoPtr
,
&
st
[
1
]);
}
/* include two partially visible months */
range
=
MONTHCAL_GetCalCount
(
infoPtr
)
+
2
;
break
;
}
default:
WARN
(
"Unknown flag value, got %d
\n
"
,
flag
);
range
=
0
;
}
return
infoPtr
->
monthR
ange
;
return
r
ange
;
}
...
...
dlls/comctl32/tests/monthcal.c
View file @
b11208e5
...
...
@@ -1317,7 +1317,6 @@ static void test_monthrange(void)
res
=
SendMessage
(
hwnd
,
MCM_GETMONTHRANGE
,
GMR_VISIBLE
,
(
LPARAM
)
st_visible
);
expect
(
2
,
res
);
expect
(
2000
,
st_visible
[
0
].
wYear
);
expect
(
11
,
st_visible
[
0
].
wMonth
);
expect
(
1
,
st_visible
[
0
].
wDay
);
...
...
@@ -1326,9 +1325,7 @@ static void test_monthrange(void)
expect
(
31
,
st_visible
[
1
].
wDay
);
res
=
SendMessage
(
hwnd
,
MCM_GETMONTHRANGE
,
GMR_DAYSTATE
,
(
LPARAM
)
st_daystate
);
todo_wine
{
expect
(
4
,
res
);
}
expect
(
4
,
res
);
expect
(
2000
,
st_daystate
[
0
].
wYear
);
expect
(
10
,
st_daystate
[
0
].
wMonth
);
expect
(
29
,
st_daystate
[
0
].
wDay
);
...
...
@@ -1338,6 +1335,13 @@ static void test_monthrange(void)
ok_sequence
(
sequences
,
MONTHCAL_SEQ_INDEX
,
monthcal_monthrange_seq
,
"monthcal monthrange"
,
FALSE
);
/* with null date array parameter */
res
=
SendMessage
(
hwnd
,
MCM_GETMONTHRANGE
,
GMR_VISIBLE
,
0
);
expect
(
2
,
res
);
res
=
SendMessage
(
hwnd
,
MCM_GETMONTHRANGE
,
GMR_DAYSTATE
,
0
);
expect
(
4
,
res
);
/* resize control to display single Calendar */
MoveWindow
(
hwnd
,
0
,
0
,
r
.
right
,
r
.
bottom
,
FALSE
);
...
...
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