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
9667a891
Commit
9667a891
authored
Aug 03, 2006
by
Krzysztof Foltman
Committed by
Alexandre Julliard
Aug 03, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched20: Make EM_GETLINE work properly in 1.0 emulation mode.
parent
5f32291a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
editor.c
dlls/riched20/editor.c
+9
-5
No files found.
dlls/riched20/editor.c
View file @
9667a891
...
...
@@ -2048,6 +2048,9 @@ LRESULT WINAPI RichEditANSIWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lP
const
unsigned
int
nMaxChars
=
*
(
WORD
*
)
lParam
;
unsigned
int
nEndChars
,
nCharsLeft
=
nMaxChars
;
char
*
dest
=
(
char
*
)
lParam
;
/* rich text editor 1.0 uses \r\n for line end, 2.0 uses just \r;
we need to know how if we have the extra \n or not */
int
nLF
=
editor
->
bEmulateVersion10
;
TRACE
(
"EM_GETLINE: row=%d, nMaxChars=%d (%s)
\n
"
,
(
int
)
wParam
,
nMaxChars
,
bUnicode
?
"Unicode"
:
"Ansi"
);
...
...
@@ -2075,20 +2078,21 @@ LRESULT WINAPI RichEditANSIWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lP
nCharsLeft
-=
nCopy
;
}
/* append \r\0, space allowing */
nEndChars
=
min
(
nCharsLeft
,
2
);
/* append \r\0
(or \r\n\0 in 1.0)
, space allowing */
nEndChars
=
min
(
nCharsLeft
,
2
+
nLF
);
nCharsLeft
-=
nEndChars
;
if
(
bUnicode
)
{
const
WCHAR
src
[]
=
{
'\r'
,
'\0'
};
lstrcpynW
((
LPWSTR
)
dest
,
src
,
nEndChars
);
const
WCHAR
src10
[]
=
{
'\r'
,
'\n'
,
'\0'
};
lstrcpynW
((
LPWSTR
)
dest
,
nLF
?
src10
:
src
,
nEndChars
);
}
else
lstrcpynA
(
dest
,
"
\r
"
,
nEndChars
);
lstrcpynA
(
dest
,
nLF
?
"
\r\n
"
:
"
\r
"
,
nEndChars
);
TRACE
(
"EM_GETLINE: got %u bytes
\n
"
,
nMaxChars
-
nCharsLeft
);
if
(
nEndChars
==
2
)
if
(
nEndChars
==
2
+
nLF
)
return
nMaxChars
-
nCharsLeft
-
1
;
/* don't count \0 */
else
return
nMaxChars
-
nCharsLeft
;
...
...
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