Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Zsolt Vadász
wine
Commits
4f3b7879
Commit
4f3b7879
authored
14 years ago
by
Peter Schellenbach
Committed by
Alexandre Julliard
14 years ago
Browse files
Options
Downloads
Patches
Plain Diff
oleaut32: Fixed short time & medium time named formats.
parent
955685a7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dlls/oleaut32/tests/varformat.c
+25
-0
25 additions, 0 deletions
dlls/oleaut32/tests/varformat.c
dlls/oleaut32/varformat.c
+9
-1
9 additions, 1 deletion
dlls/oleaut32/varformat.c
with
34 additions
and
1 deletion
dlls/oleaut32/tests/varformat.c
+
25
−
0
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"
);
...
...
This diff is collapsed.
Click to expand it.
dlls/oleaut32/varformat.c
+
9
−
1
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
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment