Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
617f668f
Commit
617f668f
authored
Oct 14, 2014
by
Nikolay Sivov
Committed by
Alexandre Julliard
Oct 15, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Block negative max height/width for layout.
parent
d8a66e63
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
0 deletions
+51
-0
layout.c
dlls/dwrite/layout.c
+8
-0
layout.c
dlls/dwrite/tests/layout.c
+43
-0
No files found.
dlls/dwrite/layout.c
View file @
617f668f
...
...
@@ -772,6 +772,10 @@ static HRESULT WINAPI dwritetextlayout_SetMaxWidth(IDWriteTextLayout2 *iface, FL
{
struct
dwrite_textlayout
*
This
=
impl_from_IDWriteTextLayout2
(
iface
);
TRACE
(
"(%p)->(%.1f)
\n
"
,
This
,
maxWidth
);
if
(
maxWidth
<
0
.
0
)
return
E_INVALIDARG
;
This
->
maxwidth
=
maxWidth
;
return
S_OK
;
}
...
...
@@ -780,6 +784,10 @@ static HRESULT WINAPI dwritetextlayout_SetMaxHeight(IDWriteTextLayout2 *iface, F
{
struct
dwrite_textlayout
*
This
=
impl_from_IDWriteTextLayout2
(
iface
);
TRACE
(
"(%p)->(%.1f)
\n
"
,
This
,
maxHeight
);
if
(
maxHeight
<
0
.
0
)
return
E_INVALIDARG
;
This
->
maxheight
=
maxHeight
;
return
S_OK
;
}
...
...
dlls/dwrite/tests/layout.c
View file @
617f668f
...
...
@@ -550,6 +550,7 @@ static void test_fontweight(void)
IDWriteTextLayout
*
layout
;
DWRITE_FONT_WEIGHT
weight
;
DWRITE_TEXT_RANGE
range
;
FLOAT
size
;
HRESULT
hr
;
hr
=
IDWriteFactory_CreateTextFormat
(
factory
,
tahomaW
,
NULL
,
DWRITE_FONT_WEIGHT_BOLD
,
DWRITE_FONT_STYLE_NORMAL
,
...
...
@@ -581,6 +582,48 @@ static void test_fontweight(void)
ok
(
weight
==
DWRITE_FONT_WEIGHT_NORMAL
,
"got %d
\n
"
,
weight
);
ok
(
range
.
length
==
6
,
"got %d
\n
"
,
range
.
length
);
size
=
IDWriteTextLayout_GetMaxWidth
(
layout
);
ok
(
size
==
100
.
0
,
"got %.2f
\n
"
,
size
);
hr
=
IDWriteTextLayout_SetMaxWidth
(
layout
,
0
.
0
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
size
=
IDWriteTextLayout_GetMaxWidth
(
layout
);
ok
(
size
==
0
.
0
,
"got %.2f
\n
"
,
size
);
hr
=
IDWriteTextLayout_SetMaxWidth
(
layout
,
-
1
.
0
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x
\n
"
,
hr
);
size
=
IDWriteTextLayout_GetMaxWidth
(
layout
);
ok
(
size
==
0
.
0
,
"got %.2f
\n
"
,
size
);
hr
=
IDWriteTextLayout_SetMaxWidth
(
layout
,
100
.
0
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
size
=
IDWriteTextLayout_GetMaxWidth
(
layout
);
ok
(
size
==
100
.
0
,
"got %.2f
\n
"
,
size
);
size
=
IDWriteTextLayout_GetMaxHeight
(
layout
);
ok
(
size
==
100
.
0
,
"got %.2f
\n
"
,
size
);
hr
=
IDWriteTextLayout_SetMaxHeight
(
layout
,
0
.
0
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
size
=
IDWriteTextLayout_GetMaxHeight
(
layout
);
ok
(
size
==
0
.
0
,
"got %.2f
\n
"
,
size
);
hr
=
IDWriteTextLayout_SetMaxHeight
(
layout
,
-
1
.
0
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x
\n
"
,
hr
);
size
=
IDWriteTextLayout_GetMaxHeight
(
layout
);
ok
(
size
==
0
.
0
,
"got %.2f
\n
"
,
size
);
hr
=
IDWriteTextLayout_SetMaxHeight
(
layout
,
100
.
0
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
size
=
IDWriteTextLayout_GetMaxHeight
(
layout
);
ok
(
size
==
100
.
0
,
"got %.2f
\n
"
,
size
);
IDWriteTextLayout_Release
(
layout
);
IDWriteTextFormat_Release
(
fmt2
);
IDWriteTextFormat_Release
(
format
);
...
...
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