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
52fee149
Commit
52fee149
authored
Sep 16, 2014
by
Jactry Zeng
Committed by
Alexandre Julliard
Sep 16, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched20: Implement ITextSelection::GetStart and ITextSelection::GetEnd.
parent
b56c96a6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
73 additions
and
4 deletions
+73
-4
richole.c
dlls/riched20/richole.c
+12
-4
richole.c
dlls/riched20/tests/richole.c
+61
-0
No files found.
dlls/riched20/richole.c
View file @
52fee149
...
...
@@ -1630,11 +1630,15 @@ static HRESULT WINAPI ITextSelection_fnSetFormattedText(ITextSelection *me, ITex
static
HRESULT
WINAPI
ITextSelection_fnGetStart
(
ITextSelection
*
me
,
LONG
*
pcpFirst
)
{
ITextSelectionImpl
*
This
=
impl_from_ITextSelection
(
me
);
LONG
lim
;
if
(
!
This
->
reOle
)
return
CO_E_RELEASED
;
FIXME
(
"not implemented
\n
"
);
return
E_NOTIMPL
;
if
(
!
pcpFirst
)
return
E_INVALIDARG
;
ME_GetSelectionOfs
(
This
->
reOle
->
editor
,
pcpFirst
,
&
lim
);
TRACE
(
"%d
\n
"
,
*
pcpFirst
);
return
S_OK
;
}
static
HRESULT
WINAPI
ITextSelection_fnSetStart
(
ITextSelection
*
me
,
LONG
cpFirst
)
...
...
@@ -1650,11 +1654,15 @@ static HRESULT WINAPI ITextSelection_fnSetStart(ITextSelection *me, LONG cpFirst
static
HRESULT
WINAPI
ITextSelection_fnGetEnd
(
ITextSelection
*
me
,
LONG
*
pcpLim
)
{
ITextSelectionImpl
*
This
=
impl_from_ITextSelection
(
me
);
LONG
first
;
if
(
!
This
->
reOle
)
return
CO_E_RELEASED
;
FIXME
(
"not implemented
\n
"
);
return
E_NOTIMPL
;
if
(
!
pcpLim
)
return
E_INVALIDARG
;
ME_GetSelectionOfs
(
This
->
reOle
->
editor
,
&
first
,
pcpLim
);
TRACE
(
"%d
\n
"
,
*
pcpLim
);
return
S_OK
;
}
static
HRESULT
WINAPI
ITextSelection_fnSetEnd
(
ITextSelection
*
me
,
LONG
cpLim
)
...
...
dlls/riched20/tests/richole.c
View file @
52fee149
...
...
@@ -695,6 +695,66 @@ static void test_ITextRange_GetStart_GetEnd(void)
release_interfaces
(
&
w
,
&
reOle
,
&
txtDoc
,
NULL
);
}
static
void
test_ITextSelection_GetStart_GetEnd
(
void
)
{
HWND
w
;
IRichEditOle
*
reOle
=
NULL
;
ITextDocument
*
txtDoc
=
NULL
;
ITextSelection
*
txtSel
=
NULL
;
HRESULT
hres
;
int
first
,
lim
,
start
,
end
;
static
const
CHAR
test_text1
[]
=
"TestSomeText"
;
create_interfaces
(
&
w
,
&
reOle
,
&
txtDoc
,
&
txtSel
);
SendMessageA
(
w
,
WM_SETTEXT
,
0
,
(
LPARAM
)
test_text1
);
first
=
2
,
lim
=
5
;
SendMessageA
(
w
,
EM_SETSEL
,
first
,
lim
);
start
=
0xdeadbeef
;
hres
=
ITextSelection_GetStart
(
txtSel
,
&
start
);
ok
(
hres
==
S_OK
,
"ITextSelection_GetStart
\n
"
);
ok
(
start
==
2
,
"got wrong start value: %d
\n
"
,
start
);
end
=
0xdeadbeef
;
hres
=
ITextSelection_GetEnd
(
txtSel
,
&
end
);
ok
(
hres
==
S_OK
,
"ITextSelection_GetEnd
\n
"
);
ok
(
end
==
5
,
"got wrong end value: %d
\n
"
,
end
);
first
=
5
,
lim
=
2
;
SendMessageA
(
w
,
EM_SETSEL
,
first
,
lim
);
start
=
0xdeadbeef
;
hres
=
ITextSelection_GetStart
(
txtSel
,
&
start
);
ok
(
hres
==
S_OK
,
"ITextSelection_GetStart
\n
"
);
ok
(
start
==
2
,
"got wrong start value: %d
\n
"
,
start
);
end
=
0xdeadbeef
;
hres
=
ITextSelection_GetEnd
(
txtSel
,
&
end
);
ok
(
hres
==
S_OK
,
"ITextSelection_GetEnd
\n
"
);
ok
(
end
==
5
,
"got wrong end value: %d
\n
"
,
end
);
first
=
0
,
lim
=
-
1
;
SendMessageA
(
w
,
EM_SETSEL
,
first
,
lim
);
start
=
0xdeadbeef
;
hres
=
ITextSelection_GetStart
(
txtSel
,
&
start
);
ok
(
hres
==
S_OK
,
"ITextSelection_GetStart
\n
"
);
ok
(
start
==
0
,
"got wrong start value: %d
\n
"
,
start
);
end
=
0xdeadbeef
;
hres
=
ITextSelection_GetEnd
(
txtSel
,
&
end
);
ok
(
hres
==
S_OK
,
"ITextSelection_GetEnd
\n
"
);
ok
(
end
==
13
,
"got wrong end value: %d
\n
"
,
end
);
first
=
13
,
lim
=
13
;
SendMessageA
(
w
,
EM_SETSEL
,
first
,
lim
);
start
=
0xdeadbeef
;
hres
=
ITextSelection_GetStart
(
txtSel
,
&
start
);
ok
(
hres
==
S_OK
,
"ITextSelection_GetStart
\n
"
);
ok
(
start
==
12
,
"got wrong start value: %d
\n
"
,
start
);
end
=
0xdeadbeef
;
hres
=
ITextSelection_GetEnd
(
txtSel
,
&
end
);
ok
(
hres
==
S_OK
,
"ITextSelection_GetEnd
\n
"
);
ok
(
end
==
12
,
"got wrong end value: %d
\n
"
,
end
);
release_interfaces
(
&
w
,
&
reOle
,
&
txtDoc
,
&
txtSel
);
}
START_TEST
(
richole
)
{
/* Must explicitly LoadLibrary(). The test has no references to functions in
...
...
@@ -706,6 +766,7 @@ START_TEST(richole)
test_ITextDocument_Open
();
test_ITextSelection_GetText
();
test_ITextSelection_GetChar
();
test_ITextSelection_GetStart_GetEnd
();
test_ITextDocument_Range
();
test_ITextRange_GetChar
();
test_ITextRange_GetStart_GetEnd
();
...
...
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