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
0aa43343
Commit
0aa43343
authored
Sep 16, 2014
by
Jactry Zeng
Committed by
Alexandre Julliard
Sep 15, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched20: Implement ITextRange::GetChar.
parent
f808da26
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
83 additions
and
2 deletions
+83
-2
richole.c
dlls/riched20/richole.c
+17
-2
richole.c
dlls/riched20/tests/richole.c
+66
-0
No files found.
dlls/riched20/richole.c
View file @
0aa43343
...
...
@@ -567,14 +567,29 @@ static HRESULT WINAPI ITextRange_fnSetText(ITextRange *me, BSTR bstr)
return
E_NOTIMPL
;
}
static
HRESULT
range_GetChar
(
ME_TextEditor
*
editor
,
ME_Cursor
*
cursor
,
LONG
*
pch
)
{
WCHAR
wch
[
2
];
ME_GetTextW
(
editor
,
wch
,
1
,
cursor
,
1
,
FALSE
,
cursor
->
pRun
->
next
->
type
==
diTextEnd
);
*
pch
=
wch
[
0
];
return
S_OK
;
}
static
HRESULT
WINAPI
ITextRange_fnGetChar
(
ITextRange
*
me
,
LONG
*
pch
)
{
ITextRangeImpl
*
This
=
impl_from_ITextRange
(
me
);
ME_Cursor
cursor
;
if
(
!
This
->
reOle
)
return
CO_E_RELEASED
;
TRACE
(
"%p
\n
"
,
pch
);
if
(
!
pch
)
return
E_INVALIDARG
;
FIXME
(
"not implemented %p
\n
"
,
This
);
return
E_NOTIMPL
;
ME_CursorFromCharOfs
(
This
->
reOle
->
editor
,
This
->
start
,
&
cursor
);
return
range_GetChar
(
This
->
reOle
->
editor
,
&
cursor
,
pch
)
;
}
static
HRESULT
WINAPI
ITextRange_fnSetChar
(
ITextRange
*
me
,
LONG
ch
)
...
...
dlls/riched20/tests/richole.c
View file @
0aa43343
...
...
@@ -518,6 +518,71 @@ static void test_ITextDocument_Range(void)
ITextRange_Release
(
txtRge
);
}
static
void
test_ITextRange_GetChar
(
void
)
{
HWND
w
;
IRichEditOle
*
reOle
=
NULL
;
ITextDocument
*
txtDoc
=
NULL
;
ITextRange
*
txtRge
=
NULL
;
HRESULT
hres
;
LONG
pch
=
0xdeadbeef
;
int
first
,
lim
;
static
const
CHAR
test_text1
[]
=
"TestSomeText"
;
first
=
0
,
lim
=
4
;
create_interfaces
(
&
w
,
&
reOle
,
&
txtDoc
,
NULL
);
SendMessageA
(
w
,
WM_SETTEXT
,
0
,
(
LPARAM
)
test_text1
);
ITextDocument_Range
(
txtDoc
,
first
,
lim
,
&
txtRge
);
pch
=
0xdeadbeef
;
hres
=
ITextRange_GetChar
(
txtRge
,
&
pch
);
ok
(
hres
==
S_OK
,
"ITextRange_GetChar
\n
"
);
ok
(
pch
==
'T'
,
"got wrong char: %c
\n
"
,
pch
);
ITextRange_Release
(
txtRge
);
release_interfaces
(
&
w
,
&
reOle
,
&
txtDoc
,
NULL
);
first
=
0
,
lim
=
0
;
create_interfaces
(
&
w
,
&
reOle
,
&
txtDoc
,
NULL
);
SendMessageA
(
w
,
WM_SETTEXT
,
0
,
(
LPARAM
)
test_text1
);
ITextDocument_Range
(
txtDoc
,
first
,
lim
,
&
txtRge
);
pch
=
0xdeadbeef
;
hres
=
ITextRange_GetChar
(
txtRge
,
&
pch
);
ok
(
hres
==
S_OK
,
"ITextRange_GetChar
\n
"
);
ok
(
pch
==
'T'
,
"got wrong char: %c
\n
"
,
pch
);
ITextRange_Release
(
txtRge
);
release_interfaces
(
&
w
,
&
reOle
,
&
txtDoc
,
NULL
);
first
=
12
,
lim
=
12
;
create_interfaces
(
&
w
,
&
reOle
,
&
txtDoc
,
NULL
);
SendMessageA
(
w
,
WM_SETTEXT
,
0
,
(
LPARAM
)
test_text1
);
ITextDocument_Range
(
txtDoc
,
first
,
lim
,
&
txtRge
);
pch
=
0xdeadbeef
;
hres
=
ITextRange_GetChar
(
txtRge
,
&
pch
);
ok
(
hres
==
S_OK
,
"ITextRange_GetChar
\n
"
);
ok
(
pch
==
'\r'
,
"got wrong char: %c
\n
"
,
pch
);
ITextRange_Release
(
txtRge
);
release_interfaces
(
&
w
,
&
reOle
,
&
txtDoc
,
NULL
);
first
=
13
,
lim
=
13
;
create_interfaces
(
&
w
,
&
reOle
,
&
txtDoc
,
NULL
);
SendMessageA
(
w
,
WM_SETTEXT
,
0
,
(
LPARAM
)
test_text1
);
ITextDocument_Range
(
txtDoc
,
first
,
lim
,
&
txtRge
);
pch
=
0xdeadbeef
;
hres
=
ITextRange_GetChar
(
txtRge
,
&
pch
);
ok
(
hres
==
S_OK
,
"ITextRange_GetChar
\n
"
);
ok
(
pch
==
'\r'
,
"got wrong char: %c
\n
"
,
pch
);
ITextRange_Release
(
txtRge
);
release_interfaces
(
&
w
,
&
reOle
,
&
txtDoc
,
NULL
);
create_interfaces
(
&
w
,
&
reOle
,
&
txtDoc
,
NULL
);
SendMessageA
(
w
,
WM_SETTEXT
,
0
,
(
LPARAM
)
test_text1
);
first
=
12
,
lim
=
12
;
ITextDocument_Range
(
txtDoc
,
first
,
lim
,
&
txtRge
);
hres
=
ITextRange_GetChar
(
txtRge
,
NULL
);
ok
(
hres
==
E_INVALIDARG
,
"ITextRange_GetChar
\n
"
);
ITextRange_Release
(
txtRge
);
release_interfaces
(
&
w
,
&
reOle
,
&
txtDoc
,
NULL
);
}
START_TEST
(
richole
)
{
/* Must explicitly LoadLibrary(). The test has no references to functions in
...
...
@@ -529,4 +594,5 @@ START_TEST(richole)
test_ITextDocument_Open
();
test_ITextSelection_GetText
();
test_ITextDocument_Range
();
test_ITextRange_GetChar
();
}
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