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
ad7e9c4c
Commit
ad7e9c4c
authored
25 years ago
by
Thuy Nguyen
Committed by
Alexandre Julliard
25 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Implemented OleTranslateColor.
parent
ee3c1d7a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ole/ole2disp.c
+69
-3
69 additions, 3 deletions
ole/ole2disp.c
with
69 additions
and
3 deletions
ole/ole2disp.c
+
69
−
3
View file @
ad7e9c4c
...
...
@@ -315,15 +315,81 @@ HRESULT WINAPI RegisterActiveObject16(
/******************************************************************************
* OleTranslateColor [OLEAUT32.421]
*
* Converts an OLE_COLOR to a COLORREF.
* See the documentation for conversion rules.
* pColorRef can be NULL. In that case the user only wants to test the
* conversion.
*/
INT
WINAPI
OleTranslateColor
(
LONG
clr
,
HPALETTE
hpal
,
COLORREF
*
pColorRef
)
{
FIXME
(
ole
,
"():stub
\n
"
);
*
pColorRef
=
clr
;
COLORREF
colorref
;
BYTE
b
=
HIBYTE
(
HIWORD
(
clr
));
TRACE
(
ole
,
"(%08lx, %d, %p):stub
\n
"
,
clr
,
hpal
,
pColorRef
);
/*
* In case pColorRef is NULL, provide our own to simplify the code.
*/
if
(
pColorRef
==
NULL
)
pColorRef
=
&
colorref
;
switch
(
b
)
{
case
0x00
:
{
if
(
hpal
!=
0
)
*
pColorRef
=
PALETTERGB
(
GetRValue
(
clr
),
GetGValue
(
clr
),
GetBValue
(
clr
));
else
*
pColorRef
=
clr
;
break
;
}
case
0x01
:
{
if
(
hpal
!=
0
)
{
PALETTEENTRY
pe
;
/*
* Validate the palette index.
*/
if
(
GetPaletteEntries
(
hpal
,
LOWORD
(
clr
),
1
,
&
pe
)
==
0
)
return
E_INVALIDARG
;
}
*
pColorRef
=
clr
;
break
;
}
case
0x02
:
*
pColorRef
=
clr
;
break
;
case
0x80
:
{
int
index
=
LOBYTE
(
LOWORD
(
clr
));
/*
* Validate GetSysColor index.
*/
if
((
index
<
COLOR_SCROLLBAR
)
||
(
index
>
COLOR_GRADIENTINACTIVECAPTION
))
return
E_INVALIDARG
;
*
pColorRef
=
GetSysColor
(
index
);
break
;
}
default:
return
E_INVALIDARG
;
}
return
S_OK
;
}
...
...
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