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
13d6aa2b
Commit
13d6aa2b
authored
May 21, 2009
by
Aric Stewart
Committed by
Alexandre Julliard
May 22, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msctf: Beginning implementation of ITfContext::GetSelection.
parent
7fa47cd3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
77 additions
and
3 deletions
+77
-3
context.c
dlls/msctf/context.c
+53
-2
inputprocessor.c
dlls/msctf/tests/inputprocessor.c
+22
-1
textstor.idl
include/textstor.idl
+2
-0
No files found.
dlls/msctf/context.c
View file @
13d6aa2b
...
...
@@ -283,8 +283,59 @@ static HRESULT WINAPI Context_GetSelection (ITfContext *iface,
TF_SELECTION
*
pSelection
,
ULONG
*
pcFetched
)
{
Context
*
This
=
(
Context
*
)
iface
;
FIXME
(
"STUB:(%p)
\n
"
,
This
);
return
E_NOTIMPL
;
EditCookie
*
cookie
;
ULONG
count
,
i
;
ULONG
totalFetched
=
0
;
HRESULT
hr
=
S_OK
;
if
(
!
pSelection
||
!
pcFetched
)
return
E_INVALIDARG
;
*
pcFetched
=
0
;
if
(
!
This
->
connected
)
return
TF_E_DISCONNECTED
;
if
(
get_Cookie_magic
(
ec
)
!=
COOKIE_MAGIC_EDITCOOKIE
)
return
TF_E_NOLOCK
;
if
(
!
This
->
pITextStoreACP
)
{
FIXME
(
"Context does not have a ITextStoreACP
\n
"
);
return
E_NOTIMPL
;
}
cookie
=
get_Cookie_data
(
ec
);
if
(
ulIndex
==
TF_DEFAULT_SELECTION
)
count
=
1
;
else
count
=
ulCount
;
for
(
i
=
0
;
i
<
count
;
i
++
)
{
DWORD
fetched
;
TS_SELECTION_ACP
acps
;
hr
=
ITextStoreACP_GetSelection
(
This
->
pITextStoreACP
,
ulIndex
+
i
,
1
,
&
acps
,
&
fetched
);
if
(
hr
==
TS_E_NOLOCK
)
return
TF_E_NOLOCK
;
else
if
(
SUCCEEDED
(
hr
))
{
pSelection
[
totalFetched
].
style
.
ase
=
acps
.
style
.
ase
;
pSelection
[
totalFetched
].
style
.
fInterimChar
=
acps
.
style
.
fInterimChar
;
Range_Constructor
(
iface
,
This
->
pITextStoreACP
,
cookie
->
lockType
,
acps
.
acpStart
,
acps
.
acpEnd
,
&
pSelection
[
totalFetched
].
range
);
totalFetched
++
;
}
else
break
;
}
*
pcFetched
=
totalFetched
;
return
hr
;
}
static
HRESULT
WINAPI
Context_SetSelection
(
ITfContext
*
iface
,
...
...
dlls/msctf/tests/inputprocessor.c
View file @
13d6aa2b
...
...
@@ -58,6 +58,7 @@ static INT test_ACP_AdviseSink = SINK_UNEXPECTED;
static
INT
test_ACP_GetStatus
=
SINK_UNEXPECTED
;
static
INT
test_ACP_RequestLock
=
SINK_UNEXPECTED
;
static
INT
test_ACP_GetEndACP
=
SINK_UNEXPECTED
;
static
INT
test_ACP_GetSelection
=
SINK_UNEXPECTED
;
static
INT
test_DoEditSession
=
SINK_UNEXPECTED
;
...
...
@@ -171,7 +172,15 @@ static HRESULT WINAPI TextStoreACP_QueryInsert(ITextStoreACP *iface,
static
HRESULT
WINAPI
TextStoreACP_GetSelection
(
ITextStoreACP
*
iface
,
ULONG
ulIndex
,
ULONG
ulCount
,
TS_SELECTION_ACP
*
pSelection
,
ULONG
*
pcFetched
)
{
trace
(
"
\n
"
);
ok
(
test_ACP_GetSelection
==
SINK_EXPECTED
,
"Unexpected TextStoreACP_GetSelection
\n
"
);
test_ACP_GetSelection
=
SINK_FIRED
;
pSelection
->
acpStart
=
10
;
pSelection
->
acpEnd
=
20
;
pSelection
->
style
.
fInterimChar
=
0
;
pSelection
->
style
.
ase
=
TS_AE_NONE
;
*
pcFetched
=
1
;
return
S_OK
;
}
static
HRESULT
WINAPI
TextStoreACP_SetSelection
(
ITextStoreACP
*
iface
,
...
...
@@ -1378,6 +1387,8 @@ TfEditCookie ec)
ITfContext
*
cxt
;
ITfDocumentMgr
*
dm
;
ITfRange
*
range
;
TF_SELECTION
selection
;
ULONG
fetched
;
HRESULT
hr
;
ok
(
test_DoEditSession
==
SINK_EXPECTED
,
"Unexpected DoEditSession
\n
"
);
...
...
@@ -1416,6 +1427,16 @@ TfEditCookie ec)
ok
(
test_ACP_GetEndACP
==
SINK_FIRED
,
"GetEndACP not fired as expected
\n
"
);
ITfRange_Release
(
range
);
selection
.
range
=
NULL
;
test_ACP_GetSelection
=
SINK_EXPECTED
;
hr
=
ITfContext_GetSelection
(
cxt
,
ec
,
TF_DEFAULT_SELECTION
,
1
,
&
selection
,
&
fetched
);
ok
(
SUCCEEDED
(
hr
),
"ITfContext_GetSelection failed
\n
"
);
ok
(
fetched
==
1
,
"fetched incorrect
\n
"
);
ok
(
selection
.
range
!=
NULL
,
"NULL range
\n
"
);
ok
(
test_ACP_GetSelection
==
SINK_FIRED
,
" expected ACP_GetSepection not fired
\n
"
);
ITfRange_Release
(
selection
.
range
);
ITfContext_Release
(
cxt
);
ITfDocumentMgr_Release
(
dm
);
return
0xdeadcafe
;
...
...
include/textstor.idl
View file @
13d6aa2b
...
...
@@ -21,6 +21,8 @@ import "oaidl.idl";
#
endif
cpp_quote
(
"#define TS_E_READONLY MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0209)"
)
cpp_quote
(
"#define TS_E_NOLOCK MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0201)"
)
const
ULONG
TS_DEFAULT_SELECTION
=
~
0u
;
...
...
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