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
8431bed5
Commit
8431bed5
authored
Oct 11, 2009
by
Nikolay Sivov
Committed by
Alexandre Julliard
Oct 12, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/datetime: Get rid of duplicated helper.
parent
a4b5c5db
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
24 deletions
+7
-24
datetime.c
dlls/comctl32/datetime.c
+7
-24
No files found.
dlls/comctl32/datetime.c
View file @
8431bed5
...
...
@@ -448,19 +448,6 @@ DATETIME_ReturnTxt (const DATETIME_INFO *infoPtr, int count, LPWSTR result, int
TRACE
(
"arg%d=%x->[%s]
\n
"
,
count
,
infoPtr
->
fieldspec
[
count
],
debugstr_w
(
result
));
}
/* Offsets of days in the week to the weekday of january 1 in a leap year. */
static
const
int
DayOfWeekTable
[]
=
{
0
,
3
,
2
,
5
,
0
,
3
,
5
,
1
,
4
,
6
,
2
,
4
};
/* returns the day in the week(0 == sunday, 6 == saturday) */
/* day(1 == 1st, 2 == 2nd... etc), year is the year value */
static
int
DATETIME_CalculateDayOfWeek
(
DWORD
day
,
DWORD
month
,
DWORD
year
)
{
year
-=
(
month
<
3
);
return
((
year
+
year
/
4
-
year
/
100
+
year
/
400
+
DayOfWeekTable
[
month
-
1
]
+
day
)
%
7
);
}
static
int
wrap
(
int
val
,
int
delta
,
int
minVal
,
int
maxVal
)
{
val
+=
delta
;
...
...
@@ -484,14 +471,14 @@ DATETIME_IncreaseField (DATETIME_INFO *infoPtr, int number, int delta)
case
TWODIGITYEAR
:
case
FULLYEAR
:
date
->
wYear
=
wrap
(
date
->
wYear
,
delta
,
1752
,
9999
);
date
->
wDayOfWeek
=
DATETIME_CalculateDayOfWeek
(
date
->
wDay
,
date
->
wMonth
,
date
->
wYear
);
MONTHCAL_CalculateDayOfWeek
(
date
,
TRUE
);
break
;
case
ONEDIGITMONTH
:
case
TWODIGITMONTH
:
case
THREECHARMONTH
:
case
FULLMONTH
:
date
->
wMonth
=
wrap
(
date
->
wMonth
,
delta
,
1
,
12
);
date
->
wDayOfWeek
=
DATETIME_CalculateDayOfWeek
(
date
->
wDay
,
date
->
wMonth
,
date
->
wYear
);
MONTHCAL_CalculateDayOfWeek
(
date
,
TRUE
);
delta
=
0
;
/* fall through */
case
ONEDIGITDAY
:
...
...
@@ -499,7 +486,7 @@ DATETIME_IncreaseField (DATETIME_INFO *infoPtr, int number, int delta)
case
THREECHARDAY
:
case
FULLDAY
:
date
->
wDay
=
wrap
(
date
->
wDay
,
delta
,
1
,
MONTHCAL_MonthLength
(
date
->
wMonth
,
date
->
wYear
));
date
->
wDayOfWeek
=
DATETIME_CalculateDayOfWeek
(
date
->
wDay
,
date
->
wMonth
,
date
->
wYear
);
MONTHCAL_CalculateDayOfWeek
(
date
,
TRUE
);
break
;
case
ONELETTERAMPM
:
case
TWOLETTERAMPM
:
...
...
@@ -1042,16 +1029,14 @@ DATETIME_Char (DATETIME_INFO *infoPtr, WPARAM vkCode)
case
TWODIGITYEAR
:
date
->
wYear
=
date
->
wYear
-
(
date
->
wYear
%
100
)
+
(
date
->
wYear
%
10
)
*
10
+
num
;
date
->
wDayOfWeek
=
DATETIME_CalculateDayOfWeek
(
date
->
wDay
,
date
->
wMonth
,
date
->
wYear
);
MONTHCAL_CalculateDayOfWeek
(
date
,
TRUE
);
DATETIME_SendDateTimeChangeNotify
(
infoPtr
);
break
;
case
INVALIDFULLYEAR
:
case
FULLYEAR
:
/* reset current year initialy */
date
->
wYear
=
((
date
->
wYear
/
1000
)
?
0
:
1
)
*
(
date
->
wYear
%
1000
)
*
10
+
num
;
date
->
wDayOfWeek
=
DATETIME_CalculateDayOfWeek
(
date
->
wDay
,
date
->
wMonth
,
date
->
wYear
);
MONTHCAL_CalculateDayOfWeek
(
date
,
TRUE
);
DATETIME_SendDateTimeChangeNotify
(
infoPtr
);
break
;
case
ONEDIGITMONTH
:
...
...
@@ -1060,8 +1045,7 @@ DATETIME_Char (DATETIME_INFO *infoPtr, WPARAM vkCode)
date
->
wMonth
=
num
;
else
date
->
wMonth
=
(
date
->
wMonth
%
10
)
*
10
+
num
;
date
->
wDayOfWeek
=
DATETIME_CalculateDayOfWeek
(
date
->
wDay
,
date
->
wMonth
,
date
->
wYear
);
MONTHCAL_CalculateDayOfWeek
(
date
,
TRUE
);
DATETIME_SendDateTimeChangeNotify
(
infoPtr
);
break
;
case
ONEDIGITDAY
:
...
...
@@ -1071,8 +1055,7 @@ DATETIME_Char (DATETIME_INFO *infoPtr, WPARAM vkCode)
date
->
wDay
=
num
;
else
date
->
wDay
=
newDays
;
date
->
wDayOfWeek
=
DATETIME_CalculateDayOfWeek
(
date
->
wDay
,
date
->
wMonth
,
date
->
wYear
);
MONTHCAL_CalculateDayOfWeek
(
date
,
TRUE
);
DATETIME_SendDateTimeChangeNotify
(
infoPtr
);
break
;
case
ONEDIGIT12HOUR
:
...
...
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