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
3681a59c
Commit
3681a59c
authored
Jun 07, 2015
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jun 08, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched20: Improve error handling in SetFont (Coverity).
parent
26883637
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
33 deletions
+34
-33
richole.c
dlls/riched20/richole.c
+34
-33
No files found.
dlls/riched20/richole.c
View file @
3681a59c
...
...
@@ -523,12 +523,13 @@ static inline const IRichEditOleImpl *get_range_reole(ITextRange *range)
static
void
textrange_set_font
(
ITextRange
*
range
,
ITextFont
*
font
)
{
CHARFORMAT2W
fmt
;
HRESULT
hr
;
LONG
value
;
BSTR
str
;
FLOAT
f
;
#define CHARFORMAT_SET_B_FIELD(mask, value) \
if (value != tomUndefined) { \
if (
hr == S_OK &&
value != tomUndefined) { \
fmt.dwMask |= CFM_##mask; \
if (value == tomTrue) fmt.dwEffects |= CFE_##mask; \
} \
...
...
@@ -538,73 +539,73 @@ static void textrange_set_font(ITextRange *range, ITextFont *font)
fmt
.
cbSize
=
sizeof
(
fmt
);
value
=
tomUndefined
;
ITextFont_GetAllCaps
(
font
,
&
value
);
hr
=
ITextFont_GetAllCaps
(
font
,
&
value
);
CHARFORMAT_SET_B_FIELD
(
ALLCAPS
,
value
);
value
=
tomUndefined
;
ITextFont_GetBold
(
font
,
&
value
);
hr
=
ITextFont_GetBold
(
font
,
&
value
);
CHARFORMAT_SET_B_FIELD
(
BOLD
,
value
);
value
=
tomUndefined
;
ITextFont_GetEmboss
(
font
,
&
value
);
hr
=
ITextFont_GetEmboss
(
font
,
&
value
);
CHARFORMAT_SET_B_FIELD
(
EMBOSS
,
value
);
value
=
tomUndefined
;
ITextFont_GetHidden
(
font
,
&
value
);
hr
=
ITextFont_GetHidden
(
font
,
&
value
);
CHARFORMAT_SET_B_FIELD
(
HIDDEN
,
value
);
value
=
tomUndefined
;
ITextFont_GetEngrave
(
font
,
&
value
);
hr
=
ITextFont_GetEngrave
(
font
,
&
value
);
CHARFORMAT_SET_B_FIELD
(
IMPRINT
,
value
);
value
=
tomUndefined
;
ITextFont_GetItalic
(
font
,
&
value
);
hr
=
ITextFont_GetItalic
(
font
,
&
value
);
CHARFORMAT_SET_B_FIELD
(
ITALIC
,
value
);
value
=
tomUndefined
;
ITextFont_GetOutline
(
font
,
&
value
);
hr
=
ITextFont_GetOutline
(
font
,
&
value
);
CHARFORMAT_SET_B_FIELD
(
OUTLINE
,
value
);
value
=
tomUndefined
;
ITextFont_GetProtected
(
font
,
&
value
);
hr
=
ITextFont_GetProtected
(
font
,
&
value
);
CHARFORMAT_SET_B_FIELD
(
PROTECTED
,
value
);
value
=
tomUndefined
;
ITextFont_GetShadow
(
font
,
&
value
);
hr
=
ITextFont_GetShadow
(
font
,
&
value
);
CHARFORMAT_SET_B_FIELD
(
SHADOW
,
value
);
value
=
tomUndefined
;
ITextFont_GetSmallCaps
(
font
,
&
value
);
hr
=
ITextFont_GetSmallCaps
(
font
,
&
value
);
CHARFORMAT_SET_B_FIELD
(
SMALLCAPS
,
value
);
value
=
tomUndefined
;
ITextFont_GetStrikeThrough
(
font
,
&
value
);
hr
=
ITextFont_GetStrikeThrough
(
font
,
&
value
);
CHARFORMAT_SET_B_FIELD
(
STRIKEOUT
,
value
);
value
=
tomUndefined
;
ITextFont_GetSubscript
(
font
,
&
value
);
hr
=
ITextFont_GetSubscript
(
font
,
&
value
);
CHARFORMAT_SET_B_FIELD
(
SUBSCRIPT
,
value
);
value
=
tomUndefined
;
ITextFont_GetSuperscript
(
font
,
&
value
);
hr
=
ITextFont_GetSuperscript
(
font
,
&
value
);
CHARFORMAT_SET_B_FIELD
(
SUPERSCRIPT
,
value
);
value
=
tomUndefined
;
ITextFont_GetUnderline
(
font
,
&
value
);
hr
=
ITextFont_GetUnderline
(
font
,
&
value
);
CHARFORMAT_SET_B_FIELD
(
UNDERLINE
,
value
);
#undef CHARFORMAT_SET_B_FIELD
value
=
tomUndefined
;
ITextFont_GetAnimation
(
font
,
&
value
);
if
(
value
!=
tomUndefined
)
{
hr
=
ITextFont_GetAnimation
(
font
,
&
value
);
if
(
hr
==
S_OK
&&
value
!=
tomUndefined
)
{
fmt
.
dwMask
|=
CFM_ANIMATION
;
fmt
.
bAnimation
=
value
;
}
value
=
tomUndefined
;
ITextFont_GetBackColor
(
font
,
&
value
);
if
(
value
!=
tomUndefined
)
{
hr
=
ITextFont_GetBackColor
(
font
,
&
value
);
if
(
hr
==
S_OK
&&
value
!=
tomUndefined
)
{
fmt
.
dwMask
|=
CFM_BACKCOLOR
;
if
(
value
==
tomAutoColor
)
fmt
.
dwEffects
|=
CFE_AUTOBACKCOLOR
;
...
...
@@ -613,8 +614,8 @@ static void textrange_set_font(ITextRange *range, ITextFont *font)
}
value
=
tomUndefined
;
ITextFont_GetForeColor
(
font
,
&
value
);
if
(
value
!=
tomUndefined
)
{
hr
=
ITextFont_GetForeColor
(
font
,
&
value
);
if
(
hr
==
S_OK
&&
value
!=
tomUndefined
)
{
fmt
.
dwMask
|=
CFM_COLOR
;
if
(
value
==
tomAutoColor
)
fmt
.
dwEffects
|=
CFE_AUTOCOLOR
;
...
...
@@ -623,15 +624,15 @@ static void textrange_set_font(ITextRange *range, ITextFont *font)
}
value
=
tomUndefined
;
ITextFont_GetKerning
(
font
,
&
f
);
if
(
f
!=
tomUndefined
)
{
hr
=
ITextFont_GetKerning
(
font
,
&
f
);
if
(
hr
==
S_OK
&&
f
!=
tomUndefined
)
{
fmt
.
dwMask
|=
CFM_KERNING
;
fmt
.
wKerning
=
points_to_twips
(
f
);
}
value
=
tomUndefined
;
ITextFont_GetLanguageID
(
font
,
&
value
);
if
(
value
!=
tomUndefined
)
{
hr
=
ITextFont_GetLanguageID
(
font
,
&
value
);
if
(
hr
==
S_OK
&&
value
!=
tomUndefined
)
{
fmt
.
dwMask
|=
CFM_LCID
;
fmt
.
lcid
=
value
;
}
...
...
@@ -642,26 +643,26 @@ static void textrange_set_font(ITextRange *range, ITextFont *font)
SysFreeString
(
str
);
}
ITextFont_GetPosition
(
font
,
&
f
);
if
(
f
!=
tomUndefined
)
{
hr
=
ITextFont_GetPosition
(
font
,
&
f
);
if
(
hr
==
S_OK
&&
f
!=
tomUndefined
)
{
fmt
.
dwMask
|=
CFM_OFFSET
;
fmt
.
yOffset
=
points_to_twips
(
f
);
}
ITextFont_GetSize
(
font
,
&
f
);
if
(
f
!=
tomUndefined
)
{
hr
=
ITextFont_GetSize
(
font
,
&
f
);
if
(
hr
==
S_OK
&&
f
!=
tomUndefined
)
{
fmt
.
dwMask
|=
CFM_SIZE
;
fmt
.
yHeight
=
points_to_twips
(
f
);
}
ITextFont_GetSpacing
(
font
,
&
f
);
if
(
f
!=
tomUndefined
)
{
hr
=
ITextFont_GetSpacing
(
font
,
&
f
);
if
(
hr
==
S_OK
&&
f
!=
tomUndefined
)
{
fmt
.
dwMask
|=
CFM_SPACING
;
fmt
.
sSpacing
=
f
;
}
ITextFont_GetWeight
(
font
,
&
value
);
if
(
value
!=
tomUndefined
)
{
hr
=
ITextFont_GetWeight
(
font
,
&
value
);
if
(
hr
==
S_OK
&&
value
!=
tomUndefined
)
{
fmt
.
dwMask
|=
CFM_WEIGHT
;
fmt
.
wWeight
=
value
;
}
...
...
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