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
329252f8
Commit
329252f8
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 ITextSelection::GetChar.
parent
0aa43343
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
2 deletions
+56
-2
richole.c
dlls/riched20/richole.c
+7
-2
richole.c
dlls/riched20/tests/richole.c
+49
-0
No files found.
dlls/riched20/richole.c
View file @
329252f8
...
...
@@ -1569,11 +1569,16 @@ static HRESULT WINAPI ITextSelection_fnSetText(ITextSelection *me, BSTR bstr)
static
HRESULT
WINAPI
ITextSelection_fnGetChar
(
ITextSelection
*
me
,
LONG
*
pch
)
{
ITextSelectionImpl
*
This
=
impl_from_ITextSelection
(
me
);
ME_Cursor
*
start
=
NULL
,
*
end
=
NULL
;
if
(
!
This
->
reOle
)
return
CO_E_RELEASED
;
TRACE
(
"%p
\n
"
,
pch
);
if
(
!
pch
)
return
E_INVALIDARG
;
FIXME
(
"not implemented
\n
"
);
return
E_NOTIMPL
;
ME_GetSelection
(
This
->
reOle
->
editor
,
&
start
,
&
end
);
return
range_GetChar
(
This
->
reOle
->
editor
,
start
,
pch
)
;
}
static
HRESULT
WINAPI
ITextSelection_fnSetChar
(
ITextSelection
*
me
,
LONG
ch
)
...
...
dlls/riched20/tests/richole.c
View file @
329252f8
...
...
@@ -583,6 +583,54 @@ static void test_ITextRange_GetChar(void)
release_interfaces
(
&
w
,
&
reOle
,
&
txtDoc
,
NULL
);
}
static
void
test_ITextSelection_GetChar
(
void
)
{
HWND
w
;
IRichEditOle
*
reOle
=
NULL
;
ITextDocument
*
txtDoc
=
NULL
;
ITextSelection
*
txtSel
=
NULL
;
HRESULT
hres
;
LONG
pch
=
0xdeadbeef
;
int
first
,
lim
;
static
const
CHAR
test_text1
[]
=
"TestSomeText"
;
create_interfaces
(
&
w
,
&
reOle
,
&
txtDoc
,
&
txtSel
);
SendMessageA
(
w
,
WM_SETTEXT
,
0
,
(
LPARAM
)
test_text1
);
first
=
0
,
lim
=
4
;
SendMessageA
(
w
,
EM_SETSEL
,
first
,
lim
);
pch
=
0xdeadbeef
;
hres
=
ITextSelection_GetChar
(
txtSel
,
&
pch
);
ok
(
hres
==
S_OK
,
"ITextSelection_GetChar
\n
"
);
ok
(
pch
==
'T'
,
"got wrong char: %c
\n
"
,
pch
);
first
=
0
,
lim
=
0
;
SendMessageA
(
w
,
EM_SETSEL
,
first
,
lim
);
pch
=
0xdeadbeef
;
hres
=
ITextSelection_GetChar
(
txtSel
,
&
pch
);
ok
(
hres
==
S_OK
,
"ITextSelection_GetChar
\n
"
);
ok
(
pch
==
'T'
,
"got wrong char: %c
\n
"
,
pch
);
first
=
12
,
lim
=
12
;
SendMessageA
(
w
,
EM_SETSEL
,
first
,
lim
);
pch
=
0xdeadbeef
;
hres
=
ITextSelection_GetChar
(
txtSel
,
&
pch
);
ok
(
hres
==
S_OK
,
"ITextSelection_GetChar
\n
"
);
ok
(
pch
==
'\r'
,
"got wrong char: %c
\n
"
,
pch
);
first
=
13
,
lim
=
13
;
SendMessageA
(
w
,
EM_SETSEL
,
first
,
lim
);
pch
=
0xdeadbeef
;
hres
=
ITextSelection_GetChar
(
txtSel
,
&
pch
);
ok
(
hres
==
S_OK
,
"ITextSelection_GetChar
\n
"
);
ok
(
pch
==
'\r'
,
"got wrong char: %c
\n
"
,
pch
);
hres
=
ITextSelection_GetChar
(
txtSel
,
NULL
);
ok
(
hres
==
E_INVALIDARG
,
"ITextSelection_GetChar
\n
"
);
release_interfaces
(
&
w
,
&
reOle
,
&
txtDoc
,
&
txtSel
);
}
START_TEST
(
richole
)
{
/* Must explicitly LoadLibrary(). The test has no references to functions in
...
...
@@ -593,6 +641,7 @@ START_TEST(richole)
test_Interfaces
();
test_ITextDocument_Open
();
test_ITextSelection_GetText
();
test_ITextSelection_GetChar
();
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