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
4f3b7879
Commit
4f3b7879
authored
Feb 21, 2011
by
Peter Schellenbach
Committed by
Alexandre Julliard
Feb 22, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oleaut32: Fixed short time & medium time named formats.
parent
955685a7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
1 deletion
+34
-1
varformat.c
dlls/oleaut32/tests/varformat.c
+25
-0
varformat.c
dlls/oleaut32/varformat.c
+9
-1
No files found.
dlls/oleaut32/tests/varformat.c
View file @
4f3b7879
...
...
@@ -217,6 +217,14 @@ static const FMTDATERES VarFormat_date_results[] =
{
40531
.
0
,
"ddd"
,
"Sun"
}
};
/* The following tests require that the time separator is a colon (:) */
static
const
FMTDATERES
VarFormat_namedtime_results
[]
=
{
{
2
.
525
,
"short time"
,
"12:36"
},
{
2
.
525
,
"medium time"
,
"12:36 PM"
},
{
2
.
525
,
"long time"
,
"12:36:00 PM"
}
};
#define VNUMFMT(vt,v) \
for (i = 0; i < sizeof(VarFormat_results)/sizeof(FMTRES); i++) \
{ \
...
...
@@ -301,6 +309,23 @@ static void test_VarFormat(void)
VarFormat_date_results
[
i
].
res
);
}
/* Named time formats */
GetLocaleInfoA
(
LOCALE_USER_DEFAULT
,
LOCALE_STIME
,
buff
,
sizeof
(
buff
)
/
sizeof
(
char
));
if
(
buff
[
0
]
!=
':'
||
buff
[
1
])
{
skip
(
"Skipping namedtime tests as time separator is '%s'
\n
"
,
buff
);
}
else
{
for
(
i
=
0
;
i
<
sizeof
(
VarFormat_namedtime_results
)
/
sizeof
(
FMTDATERES
);
i
++
)
{
fd
=
0
;
VARFMT
(
VT_DATE
,
V_DATE
,
VarFormat_namedtime_results
[
i
].
val
,
VarFormat_namedtime_results
[
i
].
fmt
,
S_OK
,
VarFormat_namedtime_results
[
i
].
res
);
}
}
/* Strings */
bstrin
=
SysAllocString
(
szTesting
);
VARFMT
(
VT_BSTR
,
V_BSTR
,
bstrin
,
""
,
S_OK
,
"testing"
);
...
...
dlls/oleaut32/varformat.c
View file @
4f3b7879
...
...
@@ -263,7 +263,7 @@ typedef struct tagFMT_DATE_HEADER
#define FMT_DATE_HOUR_0 0x1F
/* Hours with leading 0 */
#define FMT_DATE_HOUR_12 0x20
/* Hours with no leading 0, 12 hour clock */
#define FMT_DATE_HOUR_12_0 0x21
/* Hours with leading 0, 12 hour clock */
#define FMT_DATE_TIME_UNK2 0x23
#define FMT_DATE_TIME_UNK2 0x23
/* same as FMT_DATE_HOUR_0, for "short time" format */
/* FIXME: probably missing some here */
#define FMT_DATE_AMPM_SYS1 0x2E
/* AM/PM as defined by system settings */
#define FMT_DATE_AMPM_UPPER 0x2F
/* Upper-case AM or PM */
...
...
@@ -1660,6 +1660,13 @@ static HRESULT VARIANT_FormatDate(LPVARIANT pVarIn, LPOLESTR lpszFormat,
pToken
+=
2
;
break
;
case
FMT_GEN_INLINE
:
pToken
+=
2
;
TRACE
(
"copy %s
\n
"
,
debugstr_a
((
LPCSTR
)
pToken
));
while
(
*
pToken
)
*
pBuff
++
=
*
pToken
++
;
break
;
case
FMT_DATE_TIME_SEP
:
TRACE
(
"time separator
\n
"
);
localeValue
=
LOCALE_STIME
;
...
...
@@ -1836,6 +1843,7 @@ static HRESULT VARIANT_FormatDate(LPVARIANT pVarIn, LPOLESTR lpszFormat,
break
;
case
FMT_DATE_HOUR_0
:
case
FMT_DATE_TIME_UNK2
:
szPrintFmt
=
szPercentZeroTwo_d
;
dwVal
=
udate
.
st
.
wHour
;
break
;
...
...
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