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
bf60453c
Commit
bf60453c
authored
Feb 12, 2001
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Feb 12, 2001
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix the behaviour of EM_GETLINE message.
parent
cd5f28bd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
10 deletions
+31
-10
edit.c
controls/edit.c
+31
-10
No files found.
controls/edit.c
View file @
bf60453c
...
...
@@ -204,7 +204,7 @@ static LRESULT EDIT_EM_CharFromPos(WND *wnd, EDITSTATE *es, INT x, INT y);
static
BOOL
EDIT_EM_FmtLines
(
EDITSTATE
*
es
,
BOOL
add_eol
);
static
HLOCAL
EDIT_EM_GetHandle
(
EDITSTATE
*
es
);
static
HLOCAL16
EDIT_EM_GetHandle16
(
WND
*
wnd
,
EDITSTATE
*
es
);
static
INT
EDIT_EM_GetLine
(
EDITSTATE
*
es
,
INT
line
,
LP
WSTR
lpch
);
static
INT
EDIT_EM_GetLine
(
EDITSTATE
*
es
,
INT
line
,
LP
ARAM
lParam
,
BOOL
unicode
);
static
LRESULT
EDIT_EM_GetSel
(
EDITSTATE
*
es
,
LPUINT
start
,
LPUINT
end
);
static
LRESULT
EDIT_EM_GetThumb
(
WND
*
wnd
,
EDITSTATE
*
es
);
static
INT
EDIT_EM_LineFromChar
(
EDITSTATE
*
es
,
INT
index
);
...
...
@@ -661,7 +661,7 @@ static LRESULT WINAPI EditWndProc_locked( WND *wnd, UINT msg,
/* fall through */
case
EM_GETLINE
:
DPRINTF_EDIT_MSG32
(
"EM_GETLINE"
);
result
=
(
LRESULT
)
EDIT_EM_GetLine
(
es
,
(
INT
)
wParam
,
(
LPWSTR
)
lParam
);
result
=
(
LRESULT
)
EDIT_EM_GetLine
(
es
,
(
INT
)
wParam
,
lParam
,
unicode
);
break
;
case
EM_LIMITTEXT16
:
...
...
@@ -2501,10 +2501,10 @@ static HLOCAL16 EDIT_EM_GetHandle16(WND *wnd, EDITSTATE *es)
* EM_GETLINE
*
*/
static
INT
EDIT_EM_GetLine
(
EDITSTATE
*
es
,
INT
line
,
LP
WSTR
lpch
)
static
INT
EDIT_EM_GetLine
(
EDITSTATE
*
es
,
INT
line
,
LP
ARAM
lParam
,
BOOL
unicode
)
{
LPWSTR
src
;
INT
len
;
INT
l
ine_len
,
dst_l
en
;
INT
i
;
if
(
es
->
style
&
ES_MULTILINE
)
{
...
...
@@ -2514,13 +2514,34 @@ static INT EDIT_EM_GetLine(EDITSTATE *es, INT line, LPWSTR lpch)
line
=
0
;
i
=
EDIT_EM_LineIndex
(
es
,
line
);
src
=
es
->
text
+
i
;
len
=
min
(
*
(
WORD
*
)
lpch
,
EDIT_EM_LineLength
(
es
,
i
));
for
(
i
=
0
;
i
<
len
;
i
++
)
{
*
lpch
=
*
src
;
src
++
;
lpch
++
;
line_len
=
EDIT_EM_LineLength
(
es
,
i
);
dst_len
=
*
(
WORD
*
)
lParam
;
if
(
unicode
)
{
LPWSTR
dst
=
(
LPWSTR
)
lParam
;
if
(
dst_len
<=
line_len
)
{
memcpy
(
dst
,
src
,
dst_len
*
sizeof
(
WCHAR
));
return
dst_len
;
}
else
/* Append 0 if enough space */
{
memcpy
(
dst
,
src
,
line_len
*
sizeof
(
WCHAR
));
dst
[
line_len
]
=
0
;
return
line_len
;
}
}
else
{
LPSTR
dst
=
(
LPSTR
)
lParam
;
INT
ret
;
ret
=
WideCharToMultiByte
(
CP_ACP
,
0
,
src
,
line_len
,
dst
,
dst_len
,
NULL
,
NULL
);
if
(
!
ret
)
/* Insufficient buffer size */
return
dst_len
;
if
(
ret
<
dst_len
)
/* Append 0 if enough space */
dst
[
ret
]
=
0
;
return
ret
;
}
return
(
LRESULT
)
len
;
}
...
...
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