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
3f932308
Commit
3f932308
authored
Mar 08, 2012
by
Owen Rudge
Committed by
Alexandre Julliard
Mar 12, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/datetime: Ensure up/down/home/end increments remain within bounds.
parent
c8c3c4be
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
2 deletions
+31
-2
datetime.c
dlls/comctl32/datetime.c
+31
-2
No files found.
dlls/comctl32/datetime.c
View file @
3f932308
...
...
@@ -506,6 +506,9 @@ static void
DATETIME_IncreaseField
(
DATETIME_INFO
*
infoPtr
,
int
number
,
int
delta
)
{
SYSTEMTIME
*
date
=
&
infoPtr
->
date
;
SYSTEMTIME
range
[
2
];
DWORD
limits
;
BOOL
min
;
TRACE
(
"%d
\n
"
,
number
);
if
((
number
>
infoPtr
->
nrFields
)
||
(
number
<
0
))
return
;
...
...
@@ -516,7 +519,13 @@ DATETIME_IncreaseField (DATETIME_INFO *infoPtr, int number, int delta)
case
ONEDIGITYEAR
:
case
TWODIGITYEAR
:
case
FULLYEAR
:
date
->
wYear
=
wrap
(
date
->
wYear
,
delta
,
1752
,
9999
);
if
(
delta
==
INT_MIN
)
date
->
wYear
=
1752
;
else
if
(
delta
==
INT_MAX
)
date
->
wYear
=
9999
;
else
date
->
wYear
=
max
(
min
(
date
->
wYear
+
delta
,
9999
),
1752
);
if
(
date
->
wDay
>
MONTHCAL_MonthLength
(
date
->
wMonth
,
date
->
wYear
))
/* This can happen when moving away from a leap year. */
date
->
wDay
=
MONTHCAL_MonthLength
(
date
->
wMonth
,
date
->
wYear
);
...
...
@@ -573,8 +582,28 @@ DATETIME_IncreaseField (DATETIME_INFO *infoPtr, int number, int delta)
date
->
wMinute
=
0
;
date
->
wHour
=
0
;
}
}
/* Ensure time is within bounds */
limits
=
SendMessageW
(
infoPtr
->
hMonthCal
,
MCM_GETRANGE
,
0
,
(
LPARAM
)
&
range
);
min
=
((
delta
<
0
)
?
TRUE
:
FALSE
);
if
(
limits
&
(
min
?
GDTR_MIN
:
GDTR_MAX
))
{
int
i
=
(
min
?
0
:
1
);
if
(
MONTHCAL_CompareSystemTime
(
date
,
&
range
[
i
])
==
(
min
?
-
1
:
1
))
{
date
->
wYear
=
range
[
i
].
wYear
;
date
->
wMonth
=
range
[
i
].
wMonth
;
date
->
wDayOfWeek
=
range
[
i
].
wDayOfWeek
;
date
->
wDay
=
range
[
i
].
wDay
;
date
->
wHour
=
range
[
i
].
wHour
;
date
->
wMinute
=
range
[
i
].
wMinute
;
date
->
wSecond
=
range
[
i
].
wSecond
;
date
->
wMilliseconds
=
range
[
i
].
wMilliseconds
;
}
}
}
static
void
DATETIME_ReturnFieldWidth
(
const
DATETIME_INFO
*
infoPtr
,
HDC
hdc
,
int
count
,
SHORT
*
width
)
...
...
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