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
c230b327
Commit
c230b327
authored
May 31, 2015
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jun 01, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Handle GetBreakConditions() failure.
parent
10ff4209
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
3 deletions
+35
-3
layout.c
dlls/dwrite/layout.c
+2
-1
layout.c
dlls/dwrite/tests/layout.c
+33
-2
No files found.
dlls/dwrite/layout.c
View file @
c230b327
...
...
@@ -379,9 +379,10 @@ static HRESULT layout_update_breakpoints_range(struct dwrite_textlayout *layout,
HRESULT
hr
;
UINT32
i
;
/* ignore returned conditions if failed */
hr
=
IDWriteInlineObject_GetBreakConditions
(
cur
->
object
,
&
before
,
&
after
);
if
(
FAILED
(
hr
))
return
hr
;
after
=
before
=
DWRITE_BREAK_CONDITION_NEUTRAL
;
if
(
!
layout
->
actual_breakpoints
)
{
layout
->
actual_breakpoints
=
heap_alloc
(
sizeof
(
DWRITE_LINE_BREAKPOINT
)
*
layout
->
len
);
...
...
dlls/dwrite/tests/layout.c
View file @
c230b327
...
...
@@ -542,8 +542,8 @@ static HRESULT WINAPI testinlineobj_GetOverhangMetrics(IDWriteInlineObject *ifac
static
HRESULT
WINAPI
testinlineobj_GetBreakConditions
(
IDWriteInlineObject
*
iface
,
DWRITE_BREAK_CONDITION
*
before
,
DWRITE_BREAK_CONDITION
*
after
)
{
*
before
=
*
after
=
DWRITE_BREAK_CONDITION_
NEUTRAL
;
return
S_OK
;
*
before
=
*
after
=
DWRITE_BREAK_CONDITION_
MUST_BREAK
;
return
0x8feacafe
;
}
static
IDWriteInlineObjectVtbl
testinlineobjvtbl
=
{
...
...
@@ -557,6 +557,7 @@ static IDWriteInlineObjectVtbl testinlineobjvtbl = {
};
static
IDWriteInlineObject
testinlineobj
=
{
&
testinlineobjvtbl
};
static
IDWriteInlineObject
testinlineobj2
=
{
&
testinlineobjvtbl
};
static
void
test_CreateTextLayout
(
void
)
{
...
...
@@ -1422,6 +1423,36 @@ todo_wine
ok
(
metrics
[
0
].
isNewline
==
0
,
"got %d
\n
"
,
metrics
[
0
].
isNewline
);
ok
(
metrics
[
0
].
isSoftHyphen
==
0
,
"got %d
\n
"
,
metrics
[
0
].
isSoftHyphen
);
ok
(
metrics
[
0
].
isRightToLeft
==
0
,
"got %d
\n
"
,
metrics
[
0
].
isRightToLeft
);
/* now set two inline object for [0,1] and [2,3], both fail to report break conditions */
range
.
startPosition
=
2
;
range
.
length
=
2
;
hr
=
IDWriteTextLayout_SetInlineObject
(
layout
,
&
testinlineobj2
,
range
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
count
=
0
;
memset
(
metrics
,
0
,
sizeof
(
metrics
));
hr
=
IDWriteTextLayout_GetClusterMetrics
(
layout
,
metrics
,
3
,
&
count
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
count
==
2
,
"got %u
\n
"
,
count
);
ok
(
metrics
[
0
].
width
==
0
.
0
,
"got %.2f
\n
"
,
metrics
[
0
].
width
);
ok
(
metrics
[
0
].
length
==
2
,
"got %d
\n
"
,
metrics
[
0
].
length
);
ok
(
metrics
[
0
].
canWrapLineAfter
==
0
,
"got %d
\n
"
,
metrics
[
0
].
canWrapLineAfter
);
ok
(
metrics
[
0
].
isWhitespace
==
0
,
"got %d
\n
"
,
metrics
[
0
].
isWhitespace
);
ok
(
metrics
[
0
].
isNewline
==
0
,
"got %d
\n
"
,
metrics
[
0
].
isNewline
);
ok
(
metrics
[
0
].
isSoftHyphen
==
0
,
"got %d
\n
"
,
metrics
[
0
].
isSoftHyphen
);
ok
(
metrics
[
0
].
isRightToLeft
==
0
,
"got %d
\n
"
,
metrics
[
0
].
isRightToLeft
);
ok
(
metrics
[
1
].
width
==
0
.
0
,
"got %.2f
\n
"
,
metrics
[
1
].
width
);
ok
(
metrics
[
1
].
length
==
2
,
"got %d
\n
"
,
metrics
[
1
].
length
);
todo_wine
ok
(
metrics
[
1
].
canWrapLineAfter
==
1
,
"got %d
\n
"
,
metrics
[
1
].
canWrapLineAfter
);
ok
(
metrics
[
1
].
isWhitespace
==
0
,
"got %d
\n
"
,
metrics
[
1
].
isWhitespace
);
ok
(
metrics
[
1
].
isNewline
==
0
,
"got %d
\n
"
,
metrics
[
1
].
isNewline
);
ok
(
metrics
[
1
].
isSoftHyphen
==
0
,
"got %d
\n
"
,
metrics
[
1
].
isSoftHyphen
);
ok
(
metrics
[
1
].
isRightToLeft
==
0
,
"got %d
\n
"
,
metrics
[
1
].
isRightToLeft
);
IDWriteTextLayout_Release
(
layout
);
IDWriteInlineObject_Release
(
trimm
);
...
...
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