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
18857222
Commit
18857222
authored
Oct 10, 2009
by
Nikolay Sivov
Committed by
Alexandre Julliard
Oct 12, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/monthcal: Handle September 1752 with a special case - it's a 19 day month.
parent
a00c217c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
4 deletions
+38
-4
monthcal.c
dlls/comctl32/monthcal.c
+13
-4
monthcal.c
dlls/comctl32/tests/monthcal.c
+25
-0
No files found.
dlls/comctl32/monthcal.c
View file @
18857222
...
...
@@ -184,6 +184,9 @@ int MONTHCAL_MonthLength(int month, int year)
else
if
(
month
==
13
)
month
=
1
;
/* special case for calendar transition year */
if
(
month
==
min_allowed_date
.
wMonth
&&
year
==
min_allowed_date
.
wYear
)
return
19
;
/* if we have a leap year add 1 day to February */
/* a leap year is a year either divisible by 400 */
/* or divisible by 4 and not by 100 */
...
...
@@ -1224,11 +1227,17 @@ MONTHCAL_GetMonthRange(const MONTHCAL_INFO *infoPtr, DWORD flag, SYSTEMTIME *st)
switch
(
flag
)
{
case
GMR_VISIBLE
:
{
/*FIXME: currently multicalendar feature isn't imple
l
ented, so entirely
/*FIXME: currently multicalendar feature isn't imple
m
ented, so entirely
visible month is current */
st
[
0
]
=
st
[
1
]
=
infoPtr
->
curSel
;
st
[
0
].
wDay
=
1
;
if
(
infoPtr
->
curSel
.
wMonth
==
min_allowed_date
.
wMonth
&&
infoPtr
->
curSel
.
wYear
==
min_allowed_date
.
wYear
)
{
st
[
0
].
wDay
=
min_allowed_date
.
wDay
;
}
else
st
[
0
].
wDay
=
1
;
st
[
0
].
wDayOfWeek
=
MONTHCAL_CalculateDayOfWeek
(
1
,
st
[
0
].
wMonth
,
st
[
0
].
wYear
);
st
[
1
].
wDay
=
MONTHCAL_MonthLength
(
st
[
1
].
wMonth
,
st
[
1
].
wYear
);
...
...
@@ -1239,7 +1248,7 @@ MONTHCAL_GetMonthRange(const MONTHCAL_INFO *infoPtr, DWORD flag, SYSTEMTIME *st)
}
case
GMR_DAYSTATE
:
{
/*FIXME: currently multicalendar feature isn't imple
l
ented,
/*FIXME: currently multicalendar feature isn't imple
m
ented,
min date from previous month and max date from next one returned */
MONTHCAL_GetMinDate
(
infoPtr
,
&
st
[
0
]);
MONTHCAL_GetMaxDate
(
infoPtr
,
&
st
[
1
]);
...
...
@@ -1625,7 +1634,7 @@ MONTHCAL_HitTest(const MONTHCAL_INFO *infoPtr, MCHITTESTINFO *lpht)
lpht
->
st
.
wDay
=
day
;
}
/* always update day of week */
lpht
->
st
.
wDayOfWeek
=
MONTHCAL_CalculateDayOfWeek
(
d
ay
,
lpht
->
st
.
wMonth
,
lpht
->
st
.
wDayOfWeek
=
MONTHCAL_CalculateDayOfWeek
(
lpht
->
st
.
wD
ay
,
lpht
->
st
.
wMonth
,
lpht
->
st
.
wYear
);
goto
done
;
}
...
...
dlls/comctl32/tests/monthcal.c
View file @
18857222
...
...
@@ -1350,6 +1350,7 @@ static void test_monthcal_monthrange(void)
int
res
;
SYSTEMTIME
st_visible
[
2
],
st_daystate
[
2
],
st
;
HWND
hwnd
;
RECT
r
;
hwnd
=
create_monthcal_control
(
0
);
...
...
@@ -1404,6 +1405,30 @@ static void test_monthcal_monthrange(void)
ok_sequence
(
sequences
,
MONTHCAL_SEQ_INDEX
,
monthcal_monthrange_seq
,
"monthcal monthrange"
,
FALSE
);
/* resize control to display single Calendar */
res
=
SendMessage
(
hwnd
,
MCM_GETMINREQRECT
,
0
,
(
LPARAM
)
&
r
);
MoveWindow
(
hwnd
,
0
,
0
,
r
.
right
,
r
.
bottom
,
FALSE
);
memset
(
&
st
,
0
,
sizeof
(
st
));
st
.
wMonth
=
9
;
st
.
wYear
=
1752
;
st
.
wDay
=
14
;
res
=
SendMessage
(
hwnd
,
MCM_SETCURSEL
,
0
,
(
LPARAM
)
&
st
);
expect
(
1
,
res
);
/* September 1752 has 19 days */
res
=
SendMessage
(
hwnd
,
MCM_GETMONTHRANGE
,
GMR_VISIBLE
,
(
LPARAM
)
st_visible
);
expect
(
1
,
res
);
expect
(
1752
,
st_visible
[
0
].
wYear
);
expect
(
9
,
st_visible
[
0
].
wMonth
);
expect
(
14
,
st_visible
[
0
].
wDay
);
expect
(
1752
,
st_visible
[
1
].
wYear
);
expect
(
9
,
st_visible
[
1
].
wMonth
);
expect
(
19
,
st_visible
[
1
].
wDay
);
DestroyWindow
(
hwnd
);
}
...
...
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