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
95573761
Commit
95573761
authored
Oct 01, 2009
by
Nikolay Sivov
Committed by
Alexandre Julliard
Oct 01, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/datetime: Always store a recalculated day of week instead of a value…
comctl32/datetime: Always store a recalculated day of week instead of a value passed in (DTM_SETSYSTEMTIME).
parent
99ded940
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
7 deletions
+13
-7
comctl32.h
dlls/comctl32/comctl32.h
+1
-0
datetime.c
dlls/comctl32/datetime.c
+8
-3
monthcal.c
dlls/comctl32/monthcal.c
+1
-1
datetime.c
dlls/comctl32/tests/datetime.c
+3
-3
No files found.
dlls/comctl32/comctl32.h
View file @
95573761
...
...
@@ -231,6 +231,7 @@ extern void UPDOWN_Unregister(void);
int
MONTHCAL_MonthLength
(
int
month
,
int
year
);
int
MONTHCAL_CalculateDayOfWeek
(
DWORD
day
,
DWORD
month
,
DWORD
year
);
extern
void
THEMING_Initialize
(
void
);
extern
void
THEMING_Uninitialize
(
void
);
...
...
dlls/comctl32/datetime.c
View file @
95573761
...
...
@@ -88,6 +88,7 @@ typedef struct
/* in monthcal.c */
extern
int
MONTHCAL_MonthLength
(
int
month
,
int
year
);
extern
int
MONTHCAL_CalculateDayOfWeek
(
DWORD
day
,
DWORD
month
,
DWORD
year
);
/* this list of defines is closely related to `allowedformatchars' defined
* in datetime.c; the high nibble indicates the `base type' of the format
...
...
@@ -164,17 +165,21 @@ DATETIME_SetSystemTime (DATETIME_INFO *infoPtr, DWORD flag, const SYSTEMTIME *sy
if
(
flag
==
GDT_VALID
)
{
if
(
systime
->
wYear
<
1601
||
systime
->
wYear
>
30827
||
systime
->
wMonth
<
1
||
systime
->
wMonth
>
12
||
systime
->
wDayOfWeek
>
6
||
systime
->
wDay
<
1
||
systime
->
wDay
>
31
||
systime
->
wHour
>
23
||
systime
->
wMinute
>
59
||
systime
->
wSecond
>
59
||
systime
->
wMilliseconds
>
999
)
return
0
;
return
FALSE
;
infoPtr
->
dateValid
=
TRUE
;
infoPtr
->
date
=
*
systime
;
/* always store a valid day of week */
infoPtr
->
date
.
wDayOfWeek
=
MONTHCAL_CalculateDayOfWeek
(
infoPtr
->
date
.
wDay
,
infoPtr
->
date
.
wMonth
,
infoPtr
->
date
.
wYear
);
SendMessageW
(
infoPtr
->
hMonthCal
,
MCM_SETCURSEL
,
0
,
(
LPARAM
)(
&
infoPtr
->
date
));
SendMessageW
(
infoPtr
->
hwndCheckbut
,
BM_SETCHECK
,
BST_CHECKED
,
0
);
}
else
if
((
infoPtr
->
dwStyle
&
DTS_SHOWNONE
)
&&
(
flag
==
GDT_NONE
))
{
...
...
@@ -182,7 +187,7 @@ DATETIME_SetSystemTime (DATETIME_INFO *infoPtr, DWORD flag, const SYSTEMTIME *sy
SendMessageW
(
infoPtr
->
hwndCheckbut
,
BM_SETCHECK
,
BST_UNCHECKED
,
0
);
}
else
return
0
;
return
FALSE
;
InvalidateRect
(
infoPtr
->
hwndSelf
,
NULL
,
TRUE
);
return
TRUE
;
...
...
dlls/comctl32/monthcal.c
View file @
95573761
...
...
@@ -199,7 +199,7 @@ static void MONTHCAL_CopyTime(const SYSTEMTIME *from, SYSTEMTIME *to)
/* returns the day in the week(0 == sunday, 6 == saturday) */
/* day(1 == 1st, 2 == 2nd... etc), year is the year value */
static
int
MONTHCAL_CalculateDayOfWeek
(
DWORD
day
,
DWORD
month
,
DWORD
year
)
int
MONTHCAL_CalculateDayOfWeek
(
DWORD
day
,
DWORD
month
,
DWORD
year
)
{
year
-=
(
month
<
3
);
...
...
dlls/comctl32/tests/datetime.c
View file @
95573761
...
...
@@ -616,7 +616,7 @@ static void test_dtm_set_and_get_system_time(void)
st
=
ref
;
st
.
wDayOfWeek
=
10
;
r
=
SendMessage
(
hWnd
,
DTM_SETSYSTEMTIME
,
GDT_VALID
,
(
LPARAM
)
&
st
);
todo_wine
expect
(
1
,
r
);
expect
(
1
,
r
);
r
=
SendMessage
(
hWnd
,
DTM_GETSYSTEMTIME
,
0
,
(
LPARAM
)
&
getSt
);
expect
(
GDT_VALID
,
r
);
expect_systime
(
&
ref
,
&
getSt
);
...
...
@@ -661,9 +661,9 @@ static void test_dtm_set_and_get_system_time(void)
r
=
SendMessage
(
hWnd
,
DTM_GETSYSTEMTIME
,
0
,
(
LPARAM
)
&
getSt
);
expect
(
GDT_VALID
,
r
);
/* 01.10.2009 is Thursday */
todo_wine
expect
(
4
,
(
LRESULT
)
getSt
.
wDayOfWeek
);
expect
(
4
,
(
LRESULT
)
getSt
.
wDayOfWeek
);
st
.
wDayOfWeek
=
4
;
todo_wine
expect_systime
(
&
st
,
&
getSt
);
expect_systime
(
&
st
,
&
getSt
);
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