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
86ea6b58
Commit
86ea6b58
authored
Mar 16, 2007
by
Farshad Agah
Committed by
Alexandre Julliard
Mar 16, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32: monthcal: Correct the return value in MCM_SETFIRSTDAYOFWEEK.
parent
9d69d533
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
73 additions
and
36 deletions
+73
-36
monthcal.c
dlls/comctl32/monthcal.c
+12
-8
monthcal.c
dlls/comctl32/tests/monthcal.c
+61
-28
No files found.
dlls/comctl32/monthcal.c
View file @
86ea6b58
...
...
@@ -897,19 +897,23 @@ static LRESULT
MONTHCAL_SetFirstDayOfWeek
(
MONTHCAL_INFO
*
infoPtr
,
LPARAM
lParam
)
{
int
prev
=
infoPtr
->
firstDay
;
int
localFirstDay
;
WCHAR
buf
[
40
];
TRACE
(
"day %ld
\n
"
,
lParam
);
if
((
lParam
>=
0
)
&&
(
lParam
<
7
))
{
infoPtr
->
firstDay
=
(
int
)
lParam
;
}
GetLocaleInfoW
(
LOCALE_USER_DEFAULT
,
LOCALE_IFIRSTDAYOFWEEK
,
buf
,
countof
(
buf
));
TRACE
(
"%s %d
\n
"
,
debugstr_w
(
buf
),
strlenW
(
buf
));
localFirstDay
=
atoiW
(
buf
);
if
(
lParam
==
-
1
)
infoPtr
->
firstDay
=
MAKELONG
(
localFirstDay
,
FALSE
);
else
if
(
lParam
>=
7
)
infoPtr
->
firstDay
=
MAKELONG
(
localFirstDay
,
TRUE
);
else
{
GetLocaleInfoW
(
LOCALE_USER_DEFAULT
,
LOCALE_IFIRSTDAYOFWEEK
,
buf
,
countof
(
buf
));
TRACE
(
"%s %d
\n
"
,
debugstr_w
(
buf
),
strlenW
(
buf
));
infoPtr
->
firstDay
=
(
atoiW
(
buf
)
+
1
)
%
7
;
}
infoPtr
->
firstDay
=
MAKELONG
(
lParam
,
TRUE
);
return
prev
;
}
...
...
dlls/comctl32/tests/monthcal.c
View file @
86ea6b58
...
...
@@ -135,26 +135,56 @@ static const struct message monthcal_curr_date_seq[] = {
static
const
struct
message
monthcal_first_day_seq
[]
=
{
{
MCM_GETFIRSTDAYOFWEEK
,
sent
|
wparam
|
lparam
,
0
,
0
},
{
MCM_SETFIRSTDAYOFWEEK
,
sent
|
wparam
|
lparam
,
0
,
0
},
{
MCM_SETFIRSTDAYOFWEEK
,
sent
|
wparam
|
lparam
,
0
,
-
5
},
{
MCM_GETFIRSTDAYOFWEEK
,
sent
|
wparam
|
lparam
,
0
,
0
},
{
MCM_SETFIRSTDAYOFWEEK
,
sent
|
wparam
|
lparam
,
0
,
1
},
{
MCM_SETFIRSTDAYOFWEEK
,
sent
|
wparam
|
lparam
,
0
,
-
4
},
{
MCM_GETFIRSTDAYOFWEEK
,
sent
|
wparam
|
lparam
,
0
,
0
},
{
MCM_SETFIRSTDAYOFWEEK
,
sent
|
wparam
|
lparam
,
0
,
2
},
{
MCM_SETFIRSTDAYOFWEEK
,
sent
|
wparam
|
lparam
,
0
,
-
3
},
{
MCM_GETFIRSTDAYOFWEEK
,
sent
|
wparam
|
lparam
,
0
,
0
},
{
MCM_SETFIRSTDAYOFWEEK
,
sent
|
wparam
|
lparam
,
0
,
3
},
{
MCM_SETFIRSTDAYOFWEEK
,
sent
|
wparam
|
lparam
,
0
,
-
2
},
{
MCM_GETFIRSTDAYOFWEEK
,
sent
|
wparam
|
lparam
,
0
,
0
},
{
MCM_SETFIRSTDAYOFWEEK
,
sent
|
wparam
|
lparam
,
0
,
4
},
{
MCM_SETFIRSTDAYOFWEEK
,
sent
|
wparam
|
lparam
,
0
,
-
1
},
{
MCM_GETFIRSTDAYOFWEEK
,
sent
|
wparam
|
lparam
,
0
,
0
},
{
MCM_SETFIRSTDAYOFWEEK
,
sent
|
wparam
|
lparam
,
0
,
0
},
{
MCM_GETFIRSTDAYOFWEEK
,
sent
|
wparam
|
lparam
,
0
,
0
},
{
MCM_SETFIRSTDAYOFWEEK
,
sent
|
wparam
|
lparam
,
0
,
1
},
{
MCM_GETFIRSTDAYOFWEEK
,
sent
|
wparam
|
lparam
,
0
,
0
},
{
MCM_SETFIRSTDAYOFWEEK
,
sent
|
wparam
|
lparam
,
0
,
2
},
{
MCM_GETFIRSTDAYOFWEEK
,
sent
|
wparam
|
lparam
,
0
,
0
},
{
MCM_SETFIRSTDAYOFWEEK
,
sent
|
wparam
|
lparam
,
0
,
5
},
{
MCM_SETFIRSTDAYOFWEEK
,
sent
|
wparam
|
lparam
,
0
,
3
},
{
MCM_GETFIRSTDAYOFWEEK
,
sent
|
wparam
|
lparam
,
0
,
0
},
{
MCM_SETFIRSTDAYOFWEEK
,
sent
|
wparam
|
lparam
,
0
,
4
},
{
MCM_GETFIRSTDAYOFWEEK
,
sent
|
wparam
|
lparam
,
0
,
0
},
{
MCM_SETFIRSTDAYOFWEEK
,
sent
|
wparam
|
lparam
,
0
,
5
},
{
MCM_GETFIRSTDAYOFWEEK
,
sent
|
wparam
|
lparam
,
0
,
0
},
{
MCM_SETFIRSTDAYOFWEEK
,
sent
|
wparam
|
lparam
,
0
,
6
},
{
MCM_GETFIRSTDAYOFWEEK
,
sent
|
wparam
|
lparam
,
0
,
0
},
{
MCM_SETFIRSTDAYOFWEEK
,
sent
|
wparam
|
lparam
,
0
,
7
},
{
MCM_GETFIRSTDAYOFWEEK
,
sent
|
wparam
|
lparam
,
0
,
0
},
{
MCM_SETFIRSTDAYOFWEEK
,
sent
|
wparam
|
lparam
,
0
,
8
},
{
MCM_GETFIRSTDAYOFWEEK
,
sent
|
wparam
|
lparam
,
0
,
0
},
{
MCM_SETFIRSTDAYOFWEEK
,
sent
|
wparam
|
lparam
,
0
,
9
},
{
MCM_GETFIRSTDAYOFWEEK
,
sent
|
wparam
|
lparam
,
0
,
0
},
{
MCM_SETFIRSTDAYOFWEEK
,
sent
|
wparam
|
lparam
,
0
,
10
},
{
MCM_GETFIRSTDAYOFWEEK
,
sent
|
wparam
|
lparam
,
0
,
0
},
{
MCM_SETFIRSTDAYOFWEEK
,
sent
|
wparam
|
lparam
,
0
,
11
},
{
MCM_GETFIRSTDAYOFWEEK
,
sent
|
wparam
|
lparam
,
0
,
0
},
{
0
}
};
...
...
@@ -583,40 +613,43 @@ static void test_monthcal_currDate(HWND hwnd)
static
void
test_monthcal_firstDay
(
HWND
hwnd
)
{
int
res
,
fday
,
i
,
temp
;
int
res
,
fday
,
i
,
prev
;
TCHAR
b
[
128
];
LCID
lcid
=
LOCALE_USER_DEFAULT
;
flush_sequences
(
sequences
,
NUM_MSG_SEQUENCES
);
/* Setter and Getters for first day of week */
todo_wine
{
/* check for locale first day */
if
(
GetLocaleInfo
(
lcid
,
LOCALE_IFIRSTDAYOFWEEK
,
b
,
128
)){
fday
=
atoi
(
b
);
res
=
SendMessage
(
hwnd
,
MCM_GETFIRSTDAYOFWEEK
,
0
,
0
);
expect
(
fday
,
res
);
res
=
SendMessage
(
hwnd
,
MCM_SETFIRSTDAYOFWEEK
,
0
,
(
LPARAM
)
0
);
expect
(
fday
,
res
);
}
else
{
skip
(
"Cannot retrieve first day of the week
\n
"
);
SendMessage
(
hwnd
,
MCM_SETFIRSTDAYOFWEEK
,
0
,
(
LPARAM
)
0
);
}
/* check for locale first day */
if
(
GetLocaleInfo
(
lcid
,
LOCALE_IFIRSTDAYOFWEEK
,
b
,
128
)){
fday
=
atoi
(
b
);
res
=
SendMessage
(
hwnd
,
MCM_GETFIRSTDAYOFWEEK
,
0
,
0
);
expect
(
fday
,
res
);
prev
=
fday
;
/* check for days of the week*/
for
(
i
=
1
,
temp
=
0x10000
;
i
<
7
;
i
++
,
temp
++
){
res
=
SendMessage
(
hwnd
,
MCM_GETFIRSTDAYOFWEEK
,
0
,
0
);
expect
(
temp
,
res
);
/* checking for the values that actually will be stored as */
/* current first day when we set a new value */
for
(
i
=
-
5
;
i
<
12
;
i
++
){
res
=
SendMessage
(
hwnd
,
MCM_SETFIRSTDAYOFWEEK
,
0
,
(
LPARAM
)
i
);
expect
(
temp
,
res
);
expect
(
prev
,
res
);
res
=
SendMessage
(
hwnd
,
MCM_GETFIRSTDAYOFWEEK
,
0
,
0
);
prev
=
res
;
if
(
i
==
-
1
){
expect
(
MAKELONG
(
fday
,
FALSE
),
res
);
}
else
if
(
i
>=
7
){
expect
(
MAKELONG
(
fday
,
TRUE
),
res
);
}
else
{
expect
(
MAKELONG
(
i
,
TRUE
),
res
);
}
}
/* check for returning to the original first day */
res
=
SendMessage
(
hwnd
,
MCM_GETFIRSTDAYOFWEEK
,
0
,
0
);
todo_wine
{
expect
(
temp
,
res
);}
ok_sequence
(
sequences
,
MONTHCAL_SEQ_INDEX
,
monthcal_first_day_seq
,
"monthcal firstDay"
,
FALSE
);
}
else
{
skip
(
"Cannot retrieve first day of the week
\n
"
);
}
ok_sequence
(
sequences
,
MONTHCAL_SEQ_INDEX
,
monthcal_first_day_seq
,
"monthcal firstDay"
,
FALSE
);
}
static
void
test_monthcal_unicode
(
HWND
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