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
fc6ec997
Commit
fc6ec997
authored
Aug 19, 2014
by
Piotr Caban
Committed by
Alexandre Julliard
Aug 19, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oleaut32: Add support for VAR_TIMEVALUEONLY and VAR_DATEVALUEONLY flags in VarDateFromUdateEx.
parent
f753ff90
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
8 deletions
+19
-8
vartest.c
dlls/oleaut32/tests/vartest.c
+6
-0
variant.c
dlls/oleaut32/variant.c
+13
-8
No files found.
dlls/oleaut32/tests/vartest.c
View file @
fc6ec997
...
...
@@ -1934,6 +1934,12 @@ static void test_VarDateFromUdate(void)
/* for DATE values 0.0 < x < 1.0, x and -x represent the same datetime */
/* but when converting to DATE, prefer the positive versions */
UD2T
(
30
,
12
,
1899
,
6
,
0
,
0
,
0
,
6
,
364
,
0
,
S_OK
,
0
.
25
);
UD2T
(
1
,
1
,
1980
,
18
,
1
,
16
,
0
,
2
,
1
,
VAR_TIMEVALUEONLY
,
S_OK
,
0
.
7508796296296296
);
UD2T
(
1
,
1
,
1980
,
18
,
1
,
16
,
0
,
2
,
1
,
VAR_DATEVALUEONLY
,
S_OK
,
29221
.
0
);
UD2T
(
25
,
12
,
1899
,
6
,
0
,
0
,
0
,
1
,
359
,
VAR_TIMEVALUEONLY
,
S_OK
,
0
.
25
);
UD2T
(
25
,
12
,
1899
,
6
,
0
,
0
,
0
,
1
,
359
,
VAR_DATEVALUEONLY
,
S_OK
,
-
5
.
0
);
UD2T
(
1
,
-
1
,
1980
,
18
,
1
,
16
,
0
,
0
,
0
,
VAR_TIMEVALUEONLY
|
VAR_DATEVALUEONLY
,
S_OK
,
0
.
7508796296296296
);
}
static
void
test_st2dt
(
int
line
,
WORD
d
,
WORD
m
,
WORD
y
,
WORD
h
,
WORD
mn
,
...
...
dlls/oleaut32/variant.c
View file @
fc6ec997
...
...
@@ -1350,7 +1350,7 @@ INT WINAPI VariantTimeToSystemTime(double dateIn, LPSYSTEMTIME lpSt)
HRESULT
WINAPI
VarDateFromUdateEx
(
UDATE
*
pUdateIn
,
LCID
lcid
,
ULONG
dwFlags
,
DATE
*
pDateOut
)
{
UDATE
ud
;
double
dateVal
,
dateSign
;
double
dateVal
=
0
;
TRACE
(
"(%p->%d/%d/%d %d:%d:%d:%d %d %d,0x%08x,0x%08x,%p)
\n
"
,
pUdateIn
,
pUdateIn
->
st
.
wMonth
,
pUdateIn
->
st
.
wDay
,
pUdateIn
->
st
.
wYear
,
...
...
@@ -1360,6 +1360,8 @@ HRESULT WINAPI VarDateFromUdateEx(UDATE *pUdateIn, LCID lcid, ULONG dwFlags, DAT
if
(
lcid
!=
MAKELCID
(
MAKELANGID
(
LANG_ENGLISH
,
SUBLANG_ENGLISH_US
),
SORT_DEFAULT
))
FIXME
(
"lcid possibly not handled, treating as en-us
\n
"
);
if
(
dwFlags
&
~
(
VAR_TIMEVALUEONLY
|
VAR_DATEVALUEONLY
))
FIXME
(
"unsupported flags: %x
\n
"
,
dwFlags
);
ud
=
*
pUdateIn
;
...
...
@@ -1370,15 +1372,18 @@ HRESULT WINAPI VarDateFromUdateEx(UDATE *pUdateIn, LCID lcid, ULONG dwFlags, DAT
return
E_INVALIDARG
;
/* Date */
dateVal
=
VARIANT_DateFromJulian
(
VARIANT_JulianFromDMY
(
ud
.
st
.
wYear
,
ud
.
st
.
wMonth
,
ud
.
st
.
wDay
));
if
(
!
(
dwFlags
&
VAR_TIMEVALUEONLY
))
dateVal
=
VARIANT_DateFromJulian
(
VARIANT_JulianFromDMY
(
ud
.
st
.
wYear
,
ud
.
st
.
wMonth
,
ud
.
st
.
wDay
));
/* Sign */
dateSign
=
(
dateVal
<
0
.
0
)
?
-
1
.
0
:
1
.
0
;
if
((
dwFlags
&
VAR_TIMEVALUEONLY
)
||
!
(
dwFlags
&
VAR_DATEVALUEONLY
))
{
double
dateSign
=
(
dateVal
<
0
.
0
)
?
-
1
.
0
:
1
.
0
;
/* Time */
dateVal
+=
ud
.
st
.
wHour
/
24
.
0
*
dateSign
;
dateVal
+=
ud
.
st
.
wMinute
/
1440
.
0
*
dateSign
;
dateVal
+=
ud
.
st
.
wSecond
/
86400
.
0
*
dateSign
;
/* Time */
dateVal
+=
ud
.
st
.
wHour
/
24
.
0
*
dateSign
;
dateVal
+=
ud
.
st
.
wMinute
/
1440
.
0
*
dateSign
;
dateVal
+=
ud
.
st
.
wSecond
/
86400
.
0
*
dateSign
;
}
TRACE
(
"Returning %g
\n
"
,
dateVal
);
*
pDateOut
=
dateVal
;
...
...
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