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
50397298
Commit
50397298
authored
Oct 23, 2008
by
Dylan Smith
Committed by
Alexandre Julliard
Oct 23, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
richedit: Fixed the call to the EditWordBreakProc.
parent
00fd6b62
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
7 deletions
+21
-7
string.c
dlls/riched20/string.c
+19
-5
editor.c
dlls/riched20/tests/editor.c
+2
-2
No files found.
dlls/riched20/string.c
View file @
50397298
...
...
@@ -304,6 +304,8 @@ ME_WordBreakProc(LPWSTR s, INT start, INT len, INT code)
/* FIXME: Native also knows about punctuation */
TRACE
(
"s==%s, start==%d, len==%d, code==%d
\n
"
,
debugstr_wn
(
s
,
len
),
start
,
len
,
code
);
/* convert number of bytes to number of characters. */
len
/=
sizeof
(
WCHAR
);
switch
(
code
)
{
case
WB_ISDELIMITER
:
...
...
@@ -330,11 +332,23 @@ ME_WordBreakProc(LPWSTR s, INT start, INT len, INT code)
int
ME_CallWordBreakProc
(
ME_TextEditor
*
editor
,
ME_String
*
str
,
INT
start
,
INT
code
)
{
/* FIXME: ANSIfy the string when bEmulateVersion10 is TRUE */
if
(
!
editor
->
pfnWordBreak
)
return
ME_WordBreakProc
(
str
->
szData
,
start
,
str
->
nLen
,
code
);
else
return
editor
->
pfnWordBreak
(
str
->
szData
,
start
,
str
->
nLen
,
code
);
if
(
!
editor
->
pfnWordBreak
)
{
return
ME_WordBreakProc
(
str
->
szData
,
start
,
str
->
nLen
*
sizeof
(
WCHAR
),
code
);
}
else
if
(
!
editor
->
bEmulateVersion10
)
{
/* MSDN lied about the third parameter for EditWordBreakProc being the number
* of characters, it is actually the number of bytes of the string. */
return
editor
->
pfnWordBreak
(
str
->
szData
,
start
,
str
->
nLen
*
sizeof
(
WCHAR
),
code
);
}
else
{
int
result
;
int
buffer_size
=
WideCharToMultiByte
(
CP_ACP
,
0
,
str
->
szData
,
str
->
nLen
,
NULL
,
0
,
NULL
,
NULL
);
char
*
buffer
=
(
char
*
)
heap_alloc
(
buffer_size
);
WideCharToMultiByte
(
CP_ACP
,
0
,
str
->
szData
,
str
->
nLen
,
buffer
,
buffer_size
,
NULL
,
NULL
);
result
=
editor
->
pfnWordBreak
(
str
->
szData
,
start
,
str
->
nLen
,
code
);
heap_free
(
buffer
);
return
result
;
}
}
LPWSTR
ME_ToUnicode
(
BOOL
unicode
,
LPVOID
psz
)
...
...
dlls/riched20/tests/editor.c
View file @
50397298
...
...
@@ -5652,7 +5652,7 @@ static void test_word_movement(void)
/* one twoX|three */
SendMessage
(
hwnd
,
EM_GETSEL
,
(
WPARAM
)
&
sel_start
,
(
LPARAM
)
&
sel_end
);
ok
(
sel_start
==
sel_end
,
"Selection should be empty
\n
"
);
todo_wine
ok
(
sel_start
==
8
,
"Cursor is at %d instead of %d
\n
"
,
sel_start
,
8
);
ok
(
sel_start
==
8
,
"Cursor is at %d instead of %d
\n
"
,
sel_start
,
8
);
DestroyWindow
(
hwnd
);
...
...
@@ -5671,7 +5671,7 @@ static void test_word_movement(void)
/* one twoX|three */
SendMessageW
(
hwnd
,
EM_GETSEL
,
(
WPARAM
)
&
sel_start
,
(
LPARAM
)
&
sel_end
);
ok
(
sel_start
==
sel_end
,
"Selection should be empty
\n
"
);
todo_wine
ok
(
sel_start
==
8
,
"Cursor is at %d instead of %d
\n
"
,
sel_start
,
8
);
ok
(
sel_start
==
8
,
"Cursor is at %d instead of %d
\n
"
,
sel_start
,
8
);
DestroyWindow
(
hwnd
);
}
...
...
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