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
534398a5
Commit
534398a5
authored
Feb 27, 2010
by
David Hedberg
Committed by
Alexandre Julliard
Mar 01, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
richedit: GTL_PRECISE to GETTEXTLENGTHEX implies GTL_NUMBYTES.
If GTL_PRECISE is passed without specifying either GTL_NUMCHARS or GTL_NUMBYTES, behave as if GTL_NUMBYTES was passed.
parent
7ed13120
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
2 deletions
+43
-2
caret.c
dlls/riched20/caret.c
+4
-2
editor.c
dlls/riched20/tests/editor.c
+39
-0
No files found.
dlls/riched20/caret.c
View file @
534398a5
...
...
@@ -91,8 +91,10 @@ int ME_GetTextLengthEx(ME_TextEditor *editor, const GETTEXTLENGTHEX *how)
&&
(
how
->
flags
&
GTL_USECRLF
)
&&
!
editor
->
bEmulateVersion10
)
/* Ignore GTL_USECRLF flag in 1.0 emulation */
length
+=
editor
->
nParagraphs
-
1
;
if
(
how
->
flags
&
GTL_NUMBYTES
)
if
(
how
->
flags
&
GTL_NUMBYTES
||
(
how
->
flags
&
GTL_PRECISE
&&
/* GTL_PRECISE seems to imply GTL_NUMBYTES */
!
(
how
->
flags
&
GTL_NUMCHARS
)))
/* unless GTL_NUMCHARS is given */
{
CPINFO
cpinfo
;
...
...
dlls/riched20/tests/editor.c
View file @
534398a5
...
...
@@ -5540,6 +5540,45 @@ static void test_EM_GETTEXTLENGTHEX(void)
ret
=
SendMessageA
(
hwnd
,
EM_GETTEXTLENGTHEX
,
(
WPARAM
)
&
gtl
,
0
);
ok
(
ret
==
6
,
"ret %d
\n
"
,
ret
);
/* Unicode/NUMCHARS/NUMBYTES */
SendMessage
(
hwnd
,
WM_SETTEXT
,
0
,
(
LPARAM
)
test_string_2
);
gtl
.
flags
=
GTL_DEFAULT
;
gtl
.
codepage
=
1200
;
ret
=
SendMessage
(
hwnd
,
EM_GETTEXTLENGTHEX
,
(
WPARAM
)
&
gtl
,
0
);
ok
(
ret
==
lstrlen
(
test_string_2
),
"GTL_DEFAULT gave %i, expected %i
\n
"
,
ret
,
lstrlen
(
test_string_2
));
gtl
.
flags
=
GTL_NUMCHARS
;
gtl
.
codepage
=
1200
;
ret
=
SendMessage
(
hwnd
,
EM_GETTEXTLENGTHEX
,
(
WPARAM
)
&
gtl
,
0
);
ok
(
ret
==
lstrlen
(
test_string_2
),
"GTL_NUMCHARS gave %i, expected %i
\n
"
,
ret
,
lstrlen
(
test_string_2
));
gtl
.
flags
=
GTL_NUMBYTES
;
gtl
.
codepage
=
1200
;
ret
=
SendMessage
(
hwnd
,
EM_GETTEXTLENGTHEX
,
(
WPARAM
)
&
gtl
,
0
);
ok
(
ret
==
lstrlen
(
test_string_2
)
*
2
,
"GTL_NUMBYTES gave %i, expected %i
\n
"
,
ret
,
lstrlen
(
test_string_2
)
*
2
);
gtl
.
flags
=
GTL_PRECISE
;
gtl
.
codepage
=
1200
;
ret
=
SendMessage
(
hwnd
,
EM_GETTEXTLENGTHEX
,
(
WPARAM
)
&
gtl
,
0
);
ok
(
ret
==
lstrlen
(
test_string_2
)
*
2
,
"GTL_PRECISE gave %i, expected %i
\n
"
,
ret
,
lstrlen
(
test_string_2
)
*
2
);
gtl
.
flags
=
GTL_NUMCHARS
|
GTL_PRECISE
;
gtl
.
codepage
=
1200
;
ret
=
SendMessage
(
hwnd
,
EM_GETTEXTLENGTHEX
,
(
WPARAM
)
&
gtl
,
0
);
ok
(
ret
==
lstrlen
(
test_string_2
),
"GTL_NUMCHAR | GTL_PRECISE gave %i, expected %i
\n
"
,
ret
,
lstrlen
(
test_string_2
));
gtl
.
flags
=
GTL_NUMCHARS
|
GTL_NUMBYTES
;
gtl
.
codepage
=
1200
;
ret
=
SendMessage
(
hwnd
,
EM_GETTEXTLENGTHEX
,
(
WPARAM
)
&
gtl
,
0
);
ok
(
ret
==
E_INVALIDARG
,
"GTL_NUMCHARS | GTL_NUMBYTES gave %i, expected %i
\n
"
,
ret
,
E_INVALIDARG
);
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