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
5f933018
Commit
5f933018
authored
Jun 06, 2015
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jun 08, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched20: Implement GetDuplicate() for selection.
parent
9c6bcec5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
86 additions
and
3 deletions
+86
-3
richole.c
dlls/riched20/richole.c
+11
-3
richole.c
dlls/riched20/tests/richole.c
+75
-0
No files found.
dlls/riched20/richole.c
View file @
5f933018
...
...
@@ -4223,14 +4223,22 @@ static HRESULT WINAPI ITextSelection_fnSetChar(ITextSelection *me, LONG ch)
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
ITextSelection_fnGetDuplicate
(
ITextSelection
*
me
,
ITextRange
**
ppR
ange
)
static
HRESULT
WINAPI
ITextSelection_fnGetDuplicate
(
ITextSelection
*
me
,
ITextRange
**
r
ange
)
{
ITextSelectionImpl
*
This
=
impl_from_ITextSelection
(
me
);
LONG
start
,
end
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
range
);
if
(
!
This
->
reOle
)
return
CO_E_RELEASED
;
FIXME
(
"not implemented
\n
"
);
return
E_NOTIMPL
;
if
(
!
range
)
return
E_INVALIDARG
;
ITextSelection_GetStart
(
me
,
&
start
);
ITextSelection_GetEnd
(
me
,
&
end
);
return
CreateITextRange
(
This
->
reOle
,
start
,
end
,
range
);
}
static
HRESULT
WINAPI
ITextSelection_fnGetFormattedText
(
ITextSelection
*
me
,
ITextRange
**
ppRange
)
...
...
dlls/riched20/tests/richole.c
View file @
5f933018
...
...
@@ -3177,6 +3177,80 @@ static void test_GetStoryLength(void)
ITextRange_Release
(
range
);
}
static
void
test_ITextSelection_GetDuplicate
(
void
)
{
static
const
CHAR
test_text1
[]
=
"TestSomeText"
;
IRichEditOle
*
reOle
=
NULL
;
ITextDocument
*
doc
=
NULL
;
ITextSelection
*
selection
,
*
sel2
;
ITextRange
*
range
,
*
range2
;
ITextFont
*
font
;
LONG
value
;
HRESULT
hr
;
HWND
hwnd
;
create_interfaces
(
&
hwnd
,
&
reOle
,
&
doc
,
&
selection
);
SendMessageA
(
hwnd
,
WM_SETTEXT
,
0
,
(
LPARAM
)
test_text1
);
SendMessageA
(
hwnd
,
EM_SETSEL
,
1
,
2
);
hr
=
ITextSelection_GetDuplicate
(
selection
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x
\n
"
,
hr
);
EXPECT_REF
(
selection
,
2
);
hr
=
ITextSelection_GetDuplicate
(
selection
,
&
range
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
ITextSelection_GetDuplicate
(
selection
,
&
range2
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
range
!=
range2
,
"got %p, %p
\n
"
,
range
,
range2
);
EXPECT_REF
(
selection
,
2
);
EXPECT_REF
(
range
,
1
);
EXPECT_REF
(
range2
,
1
);
ITextRange_Release
(
range2
);
value
=
0
;
hr
=
ITextRange_GetStart
(
range
,
&
value
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
value
==
1
,
"got %d
\n
"
,
value
);
value
=
0
;
hr
=
ITextRange_GetEnd
(
range
,
&
value
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
value
==
2
,
"got %d
\n
"
,
value
);
SendMessageA
(
hwnd
,
EM_SETSEL
,
2
,
3
);
value
=
0
;
hr
=
ITextRange_GetStart
(
range
,
&
value
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
value
==
1
,
"got %d
\n
"
,
value
);
value
=
0
;
hr
=
ITextRange_GetEnd
(
range
,
&
value
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
value
==
2
,
"got %d
\n
"
,
value
);
hr
=
ITextRange_QueryInterface
(
range
,
&
IID_ITextSelection
,
(
void
**
)
&
sel2
);
ok
(
hr
==
E_NOINTERFACE
,
"got 0x%08x
\n
"
,
hr
);
release_interfaces
(
&
hwnd
,
&
reOle
,
&
doc
,
NULL
);
hr
=
ITextSelection_GetDuplicate
(
selection
,
NULL
);
ok
(
hr
==
CO_E_RELEASED
,
"got 0x%08x
\n
"
,
hr
);
hr
=
ITextSelection_GetDuplicate
(
selection
,
&
range
);
ok
(
hr
==
CO_E_RELEASED
,
"got 0x%08x
\n
"
,
hr
);
hr
=
ITextRange_GetFont
(
range
,
&
font
);
ok
(
hr
==
CO_E_RELEASED
,
"got 0x%08x
\n
"
,
hr
);
ITextSelection_Release
(
selection
);
ITextRange_Release
(
range
);
}
START_TEST
(
richole
)
{
/* Must explicitly LoadLibrary(). The test has no references to functions in
...
...
@@ -3211,4 +3285,5 @@ START_TEST(richole)
test_SetFont
();
test_InsertObject
();
test_GetStoryLength
();
test_ITextSelection_GetDuplicate
();
}
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