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
48b9ab37
Commit
48b9ab37
authored
Feb 04, 2013
by
Huw Davies
Committed by
Alexandre Julliard
Feb 05, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched20: Pass the character ptr and string length directly to the break proc helper.
parent
bf6bb4fc
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
16 deletions
+18
-16
caret.c
dlls/riched20/caret.c
+12
-10
editor.h
dlls/riched20/editor.h
+1
-1
string.c
dlls/riched20/string.c
+5
-5
No files found.
dlls/riched20/caret.c
View file @
48b9ab37
...
...
@@ -680,19 +680,21 @@ ME_MoveCursorWords(ME_TextEditor *editor, ME_Cursor *cursor, int nRelOfs)
/* Backward movement */
while
(
TRUE
)
{
nOffset
=
ME_CallWordBreakProc
(
editor
,
pRun
->
member
.
run
.
strText
,
nOffset
,
WB_MOVEWORDLEFT
);
nOffset
=
ME_CallWordBreakProc
(
editor
,
get_text
(
&
pRun
->
member
.
run
,
0
)
,
pRun
->
member
.
run
.
len
,
nOffset
,
WB_MOVEWORDLEFT
);
if
(
nOffset
)
break
;
pOtherRun
=
ME_FindItemBack
(
pRun
,
diRunOrParagraph
);
if
(
pOtherRun
->
type
==
diRun
)
{
if
(
ME_CallWordBreakProc
(
editor
,
pOtherRun
->
member
.
run
.
strText
,
if
(
ME_CallWordBreakProc
(
editor
,
get_text
(
&
pOtherRun
->
member
.
run
,
0
),
pOtherRun
->
member
.
run
.
len
,
pOtherRun
->
member
.
run
.
len
-
1
,
WB_ISDELIMITER
)
&&
!
(
pRun
->
member
.
run
.
nFlags
&
MERF_ENDPARA
)
&&
!
(
cursor
->
pRun
==
pRun
&&
cursor
->
nOffset
==
0
)
&&
!
ME_CallWordBreakProc
(
editor
,
pRun
->
member
.
run
.
strText
,
0
,
&&
!
ME_CallWordBreakProc
(
editor
,
get_text
(
&
pRun
->
member
.
run
,
0
),
pRun
->
member
.
run
.
len
,
0
,
WB_ISDELIMITER
))
break
;
pRun
=
pOtherRun
;
...
...
@@ -724,18 +726,18 @@ ME_MoveCursorWords(ME_TextEditor *editor, ME_Cursor *cursor, int nRelOfs)
while
(
TRUE
)
{
if
(
last_delim
&&
!
ME_CallWordBreakProc
(
editor
,
pRun
->
member
.
run
.
strText
,
nOffset
,
WB_ISDELIMITER
))
if
(
last_delim
&&
!
ME_CallWordBreakProc
(
editor
,
get_text
(
&
pRun
->
member
.
run
,
0
)
,
pRun
->
member
.
run
.
len
,
nOffset
,
WB_ISDELIMITER
))
break
;
nOffset
=
ME_CallWordBreakProc
(
editor
,
pRun
->
member
.
run
.
strText
,
nOffset
,
WB_MOVEWORDRIGHT
);
nOffset
=
ME_CallWordBreakProc
(
editor
,
get_text
(
&
pRun
->
member
.
run
,
0
)
,
pRun
->
member
.
run
.
len
,
nOffset
,
WB_MOVEWORDRIGHT
);
if
(
nOffset
<
pRun
->
member
.
run
.
len
)
break
;
pOtherRun
=
ME_FindItemFwd
(
pRun
,
diRunOrParagraphOrEnd
);
if
(
pOtherRun
->
type
==
diRun
)
{
last_delim
=
ME_CallWordBreakProc
(
editor
,
pRun
->
member
.
run
.
strText
,
nOffset
-
1
,
WB_ISDELIMITER
);
last_delim
=
ME_CallWordBreakProc
(
editor
,
get_text
(
&
pRun
->
member
.
run
,
0
)
,
pRun
->
member
.
run
.
len
,
nOffset
-
1
,
WB_ISDELIMITER
);
pRun
=
pOtherRun
;
nOffset
=
0
;
}
...
...
dlls/riched20/editor.h
View file @
48b9ab37
...
...
@@ -105,7 +105,7 @@ void ME_DestroyString(ME_String *s) DECLSPEC_HIDDEN;
void
ME_AppendString
(
ME_String
*
s1
,
const
ME_String
*
s2
)
DECLSPEC_HIDDEN
;
ME_String
*
ME_VSplitString
(
ME_String
*
orig
,
int
nVPos
)
DECLSPEC_HIDDEN
;
int
ME_FindNonWhitespaceV
(
const
ME_String
*
s
,
int
nVChar
)
DECLSPEC_HIDDEN
;
int
ME_CallWordBreakProc
(
ME_TextEditor
*
editor
,
ME_String
*
str
,
INT
start
,
INT
code
)
DECLSPEC_HIDDEN
;
int
ME_CallWordBreakProc
(
ME_TextEditor
*
editor
,
WCHAR
*
str
,
INT
len
,
INT
start
,
INT
code
)
DECLSPEC_HIDDEN
;
void
ME_StrDeleteV
(
ME_String
*
s
,
int
nVChar
,
int
nChars
)
DECLSPEC_HIDDEN
;
/* smart helpers for A<->W conversions, they reserve/free memory and call MultiByte<->WideChar functions */
LPWSTR
ME_ToUnicode
(
BOOL
unicode
,
LPVOID
psz
)
DECLSPEC_HIDDEN
;
...
...
dlls/riched20/string.c
View file @
48b9ab37
...
...
@@ -180,20 +180,20 @@ ME_WordBreakProc(LPWSTR s, INT start, INT len, INT code)
int
ME_CallWordBreakProc
(
ME_TextEditor
*
editor
,
ME_String
*
str
,
INT
start
,
INT
code
)
ME_CallWordBreakProc
(
ME_TextEditor
*
editor
,
WCHAR
*
str
,
INT
len
,
INT
start
,
INT
code
)
{
if
(
!
editor
->
pfnWordBreak
)
{
return
ME_WordBreakProc
(
str
->
szData
,
start
,
str
->
nLen
*
sizeof
(
WCHAR
),
code
);
return
ME_WordBreakProc
(
str
,
start
,
len
*
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
);
return
editor
->
pfnWordBreak
(
str
,
start
,
len
*
sizeof
(
WCHAR
),
code
);
}
else
{
int
result
;
int
buffer_size
=
WideCharToMultiByte
(
CP_ACP
,
0
,
str
->
szData
,
str
->
nL
en
,
int
buffer_size
=
WideCharToMultiByte
(
CP_ACP
,
0
,
str
,
l
en
,
NULL
,
0
,
NULL
,
NULL
);
char
*
buffer
=
heap_alloc
(
buffer_size
);
WideCharToMultiByte
(
CP_ACP
,
0
,
str
->
szData
,
str
->
nL
en
,
WideCharToMultiByte
(
CP_ACP
,
0
,
str
,
l
en
,
buffer
,
buffer_size
,
NULL
,
NULL
);
result
=
editor
->
pfnWordBreak
((
WCHAR
*
)
buffer
,
start
,
buffer_size
,
code
);
heap_free
(
buffer
);
...
...
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