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
020456f7
Commit
020456f7
authored
Jan 06, 2009
by
Hans Leidekker
Committed by
Alexandre Julliard
Jan 06, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
usp10: Improve handling of whitespace in ScriptBreak.
parent
36bd62c0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
1 deletion
+52
-1
usp10.c
dlls/usp10/tests/usp10.c
+45
-0
usp10.c
dlls/usp10/usp10.c
+7
-1
No files found.
dlls/usp10/tests/usp10.c
View file @
020456f7
...
...
@@ -1382,6 +1382,50 @@ static void test_ScriptGetProperties(void)
ok
(
hr
==
S_OK
,
"ScriptGetProperties failed: 0x%08x
\n
"
,
hr
);
}
static
void
test_ScriptBreak
(
void
)
{
static
const
WCHAR
test
[]
=
{
' '
,
'\r'
,
'\n'
,
0
};
SCRIPT_ITEM
items
[
4
];
SCRIPT_LOGATTR
la
;
HRESULT
hr
;
hr
=
ScriptItemize
(
test
,
3
,
4
,
NULL
,
NULL
,
items
,
NULL
);
ok
(
!
hr
,
"ScriptItemize should return S_OK not %08x
\n
"
,
hr
);
memset
(
&
la
,
0
,
sizeof
(
la
));
hr
=
ScriptBreak
(
test
,
1
,
&
items
[
0
].
a
,
&
la
);
ok
(
!
hr
,
"ScriptBreak should return S_OK not %08x
\n
"
,
hr
);
ok
(
!
la
.
fSoftBreak
,
"fSoftBreak set
\n
"
);
ok
(
la
.
fWhiteSpace
,
"fWhiteSpace not set
\n
"
);
ok
(
la
.
fCharStop
,
"fCharStop not set
\n
"
);
ok
(
!
la
.
fWordStop
,
"fWordStop set
\n
"
);
ok
(
!
la
.
fInvalid
,
"fInvalid set
\n
"
);
ok
(
!
la
.
fReserved
,
"fReserved set
\n
"
);
memset
(
&
la
,
0
,
sizeof
(
la
));
hr
=
ScriptBreak
(
test
+
1
,
1
,
&
items
[
1
].
a
,
&
la
);
ok
(
!
hr
,
"ScriptBreak should return S_OK not %08x
\n
"
,
hr
);
ok
(
!
la
.
fSoftBreak
,
"fSoftBreak set
\n
"
);
ok
(
!
la
.
fWhiteSpace
,
"fWhiteSpace set
\n
"
);
ok
(
la
.
fCharStop
,
"fCharStop not set
\n
"
);
ok
(
!
la
.
fWordStop
,
"fWordStop set
\n
"
);
ok
(
!
la
.
fInvalid
,
"fInvalid set
\n
"
);
ok
(
!
la
.
fReserved
,
"fReserved set
\n
"
);
memset
(
&
la
,
0
,
sizeof
(
la
));
hr
=
ScriptBreak
(
test
+
2
,
1
,
&
items
[
2
].
a
,
&
la
);
ok
(
!
hr
,
"ScriptBreak should return S_OK not %08x
\n
"
,
hr
);
ok
(
!
la
.
fSoftBreak
,
"fSoftBreak set
\n
"
);
ok
(
!
la
.
fWhiteSpace
,
"fWhiteSpace set
\n
"
);
ok
(
la
.
fCharStop
,
"fCharStop not set
\n
"
);
ok
(
!
la
.
fWordStop
,
"fWordStop set
\n
"
);
ok
(
!
la
.
fInvalid
,
"fInvalid set
\n
"
);
ok
(
!
la
.
fReserved
,
"fReserved set
\n
"
);
}
START_TEST
(
usp10
)
{
HWND
hwnd
;
...
...
@@ -1426,6 +1470,7 @@ START_TEST(usp10)
test_ScriptLayout
();
test_digit_substitution
();
test_ScriptGetProperties
();
test_ScriptBreak
();
ReleaseDC
(
hwnd
,
hdc
);
DestroyWindow
(
hwnd
);
...
...
dlls/usp10/usp10.c
View file @
020456f7
...
...
@@ -1041,8 +1041,14 @@ HRESULT WINAPI ScriptBreak(const WCHAR *chars, int count, const SCRIPT_ANALYSIS
memset
(
&
la
[
i
],
0
,
sizeof
(
SCRIPT_LOGATTR
));
/* FIXME: set the other flags */
la
[
i
].
fWhiteSpace
=
isspaceW
(
chars
[
i
]
);
la
[
i
].
fWhiteSpace
=
(
chars
[
i
]
==
' '
);
la
[
i
].
fCharStop
=
1
;
if
(
i
>
0
&&
la
[
i
-
1
].
fWhiteSpace
)
{
la
[
i
].
fSoftBreak
=
1
;
la
[
i
].
fWordStop
=
1
;
}
}
return
S_OK
;
}
...
...
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