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
40456439
Commit
40456439
authored
Sep 17, 2014
by
Jactry Zeng
Committed by
Alexandre Julliard
Sep 17, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched20: Implement ITextSelection::Collapse.
parent
07154f7f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
77 additions
and
2 deletions
+77
-2
richole.c
dlls/riched20/richole.c
+7
-2
richole.c
dlls/riched20/tests/richole.c
+70
-0
No files found.
dlls/riched20/richole.c
View file @
40456439
...
...
@@ -1754,11 +1754,16 @@ static HRESULT WINAPI ITextSelection_fnGetStoryType(ITextSelection *me, LONG *pV
static
HRESULT
WINAPI
ITextSelection_fnCollapse
(
ITextSelection
*
me
,
LONG
bStart
)
{
ITextSelectionImpl
*
This
=
impl_from_ITextSelection
(
me
);
LONG
start
,
end
;
HRESULT
hres
;
if
(
!
This
->
reOle
)
return
CO_E_RELEASED
;
FIXME
(
"not implemented
\n
"
);
return
E_NOTIMPL
;
ME_GetSelectionOfs
(
This
->
reOle
->
editor
,
&
start
,
&
end
);
hres
=
range_Collapse
(
bStart
,
&
start
,
&
end
);
if
(
SUCCEEDED
(
hres
))
ME_SetSelection
(
This
->
reOle
->
editor
,
start
,
end
);
return
hres
;
}
static
HRESULT
WINAPI
ITextSelection_fnExpand
(
ITextSelection
*
me
,
LONG
Unit
,
LONG
*
pDelta
)
...
...
dlls/riched20/tests/richole.c
View file @
40456439
...
...
@@ -872,6 +872,75 @@ static void test_ITextRange_Collapse(void)
release_interfaces
(
&
w
,
&
reOle
,
&
txtDoc
,
NULL
);
}
static
void
test_ITextSelection_Collapse
(
void
)
{
HWND
w
;
IRichEditOle
*
reOle
=
NULL
;
ITextDocument
*
txtDoc
=
NULL
;
ITextSelection
*
txtSel
=
NULL
;
HRESULT
hres
;
LONG
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
=
4
,
lim
=
8
;
SendMessageA
(
w
,
EM_SETSEL
,
first
,
lim
);
hres
=
ITextSelection_Collapse
(
txtSel
,
tomTrue
);
ok
(
hres
==
S_OK
,
"ITextSelection_Collapse
\n
"
);
SendMessageA
(
w
,
EM_GETSEL
,
(
LPARAM
)
&
start
,
(
WPARAM
)
&
end
);
ok
(
start
==
4
,
"got wrong start value: %d
\n
"
,
start
);
ok
(
end
==
4
,
"got wrong end value: %d
\n
"
,
end
);
SendMessageA
(
w
,
EM_SETSEL
,
first
,
lim
);
hres
=
ITextSelection_Collapse
(
txtSel
,
tomStart
);
ok
(
hres
==
S_OK
,
"ITextSelection_Collapse
\n
"
);
SendMessageA
(
w
,
EM_GETSEL
,
(
LPARAM
)
&
start
,
(
WPARAM
)
&
end
);
ok
(
start
==
4
,
"got wrong start value: %d
\n
"
,
start
);
ok
(
end
==
4
,
"got wrong end value: %d
\n
"
,
end
);
SendMessageA
(
w
,
EM_SETSEL
,
first
,
lim
);
hres
=
ITextSelection_Collapse
(
txtSel
,
tomFalse
);
ok
(
hres
==
S_OK
,
"ITextSelection_Collapse
\n
"
);
SendMessageA
(
w
,
EM_GETSEL
,
(
LPARAM
)
&
start
,
(
WPARAM
)
&
end
);
ok
(
start
==
8
,
"got wrong start value: %d
\n
"
,
start
);
ok
(
end
==
8
,
"got wrong end value: %d
\n
"
,
end
);
SendMessageA
(
w
,
EM_SETSEL
,
first
,
lim
);
hres
=
ITextSelection_Collapse
(
txtSel
,
tomEnd
);
ok
(
hres
==
S_OK
,
"ITextSelection_Collapse
\n
"
);
SendMessageA
(
w
,
EM_GETSEL
,
(
LPARAM
)
&
start
,
(
WPARAM
)
&
end
);
ok
(
start
==
8
,
"got wrong start value: %d
\n
"
,
start
);
ok
(
end
==
8
,
"got wrong end value: %d
\n
"
,
end
);
/* tomStart is the default */
SendMessageA
(
w
,
EM_SETSEL
,
first
,
lim
);
hres
=
ITextSelection_Collapse
(
txtSel
,
256
);
ok
(
hres
==
S_OK
,
"ITextSelection_Collapse
\n
"
);
SendMessageA
(
w
,
EM_GETSEL
,
(
LPARAM
)
&
start
,
(
WPARAM
)
&
end
);
ok
(
start
==
4
,
"got wrong start value: %d
\n
"
,
start
);
ok
(
end
==
4
,
"got wrong end value: %d
\n
"
,
end
);
first
=
6
,
lim
=
6
;
SendMessageA
(
w
,
EM_SETSEL
,
first
,
lim
);
hres
=
ITextSelection_Collapse
(
txtSel
,
tomEnd
);
ok
(
hres
==
S_FALSE
,
"ITextSelection_Collapse
\n
"
);
SendMessageA
(
w
,
EM_GETSEL
,
(
LPARAM
)
&
start
,
(
WPARAM
)
&
end
);
ok
(
start
==
6
,
"got wrong start value: %d
\n
"
,
start
);
ok
(
end
==
6
,
"got wrong end value: %d
\n
"
,
end
);
first
=
8
,
lim
=
8
;
SendMessageA
(
w
,
EM_SETSEL
,
first
,
lim
);
hres
=
ITextSelection_Collapse
(
txtSel
,
tomStart
);
ok
(
hres
==
S_FALSE
,
"ITextSelection_Collapse
\n
"
);
SendMessageA
(
w
,
EM_GETSEL
,
(
LPARAM
)
&
start
,
(
WPARAM
)
&
end
);
ok
(
start
==
8
,
"got wrong start value: %d
\n
"
,
start
);
ok
(
end
==
8
,
"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
...
...
@@ -884,6 +953,7 @@ START_TEST(richole)
test_ITextSelection_GetText
();
test_ITextSelection_GetChar
();
test_ITextSelection_GetStart_GetEnd
();
test_ITextSelection_Collapse
();
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