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
b56c96a6
Commit
b56c96a6
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 ITextRange::GetStart and ITextRange::GetEnd.
parent
1e434b52
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
75 additions
and
4 deletions
+75
-4
richole.c
dlls/riched20/richole.c
+10
-4
richole.c
dlls/riched20/tests/richole.c
+65
-0
No files found.
dlls/riched20/richole.c
View file @
b56c96a6
...
...
@@ -638,8 +638,11 @@ static HRESULT WINAPI ITextRange_fnGetStart(ITextRange *me, LONG *pcpFirst)
if
(
!
This
->
reOle
)
return
CO_E_RELEASED
;
FIXME
(
"not implemented %p
\n
"
,
This
);
return
E_NOTIMPL
;
if
(
!
pcpFirst
)
return
E_INVALIDARG
;
*
pcpFirst
=
This
->
start
;
TRACE
(
"%d
\n
"
,
*
pcpFirst
);
return
S_OK
;
}
static
HRESULT
WINAPI
ITextRange_fnSetStart
(
ITextRange
*
me
,
LONG
cpFirst
)
...
...
@@ -658,8 +661,11 @@ static HRESULT WINAPI ITextRange_fnGetEnd(ITextRange *me, LONG *pcpLim)
if
(
!
This
->
reOle
)
return
CO_E_RELEASED
;
FIXME
(
"not implemented %p
\n
"
,
This
);
return
E_NOTIMPL
;
if
(
!
pcpLim
)
return
E_INVALIDARG
;
*
pcpLim
=
This
->
end
;
TRACE
(
"%d
\n
"
,
*
pcpLim
);
return
S_OK
;
}
static
HRESULT
WINAPI
ITextRange_fnSetEnd
(
ITextRange
*
me
,
LONG
cpLim
)
...
...
dlls/riched20/tests/richole.c
View file @
b56c96a6
...
...
@@ -631,6 +631,70 @@ static void test_ITextSelection_GetChar(void)
release_interfaces
(
&
w
,
&
reOle
,
&
txtDoc
,
&
txtSel
);
}
static
void
test_ITextRange_GetStart_GetEnd
(
void
)
{
HWND
w
;
IRichEditOle
*
reOle
=
NULL
;
ITextDocument
*
txtDoc
=
NULL
;
ITextRange
*
txtRge
=
NULL
;
HRESULT
hres
;
int
first
,
lim
,
start
,
end
;
static
const
CHAR
test_text1
[]
=
"TestSomeText"
;
create_interfaces
(
&
w
,
&
reOle
,
&
txtDoc
,
NULL
);
SendMessageA
(
w
,
WM_SETTEXT
,
0
,
(
LPARAM
)
test_text1
);
first
=
1
,
lim
=
6
;
ITextDocument_Range
(
txtDoc
,
first
,
lim
,
&
txtRge
);
start
=
0xdeadbeef
;
hres
=
ITextRange_GetStart
(
txtRge
,
&
start
);
ok
(
hres
==
S_OK
,
"ITextRange_GetStart
\n
"
);
ok
(
start
==
1
,
"got wrong start value: %d
\n
"
,
start
);
end
=
0xdeadbeef
;
hres
=
ITextRange_GetEnd
(
txtRge
,
&
end
);
ok
(
hres
==
S_OK
,
"ITextRange_GetEnd
\n
"
);
ok
(
end
==
6
,
"got wrong end value: %d
\n
"
,
end
);
ITextRange_Release
(
txtRge
);
first
=
6
,
lim
=
1
;
ITextDocument_Range
(
txtDoc
,
first
,
lim
,
&
txtRge
);
start
=
0xdeadbeef
;
hres
=
ITextRange_GetStart
(
txtRge
,
&
start
);
ok
(
hres
==
S_OK
,
"ITextRange_GetStart
\n
"
);
ok
(
start
==
1
,
"got wrong start value: %d
\n
"
,
start
);
end
=
0xdeadbeef
;
hres
=
ITextRange_GetEnd
(
txtRge
,
&
end
);
ok
(
hres
==
S_OK
,
"ITextRange_GetEnd
\n
"
);
ok
(
end
==
6
,
"got wrong end value: %d
\n
"
,
end
);
ITextRange_Release
(
txtRge
);
first
=
-
1
,
lim
=
13
;
ITextDocument_Range
(
txtDoc
,
first
,
lim
,
&
txtRge
);
start
=
0xdeadbeef
;
hres
=
ITextRange_GetStart
(
txtRge
,
&
start
);
ok
(
hres
==
S_OK
,
"ITextRange_GetStart
\n
"
);
ok
(
start
==
0
,
"got wrong start value: %d
\n
"
,
start
);
end
=
0xdeadbeef
;
hres
=
ITextRange_GetEnd
(
txtRge
,
&
end
);
ok
(
hres
==
S_OK
,
"ITextRange_GetEnd
\n
"
);
ok
(
end
==
13
,
"got wrong end value: %d
\n
"
,
end
);
ITextRange_Release
(
txtRge
);
first
=
13
,
lim
=
13
;
ITextDocument_Range
(
txtDoc
,
first
,
lim
,
&
txtRge
);
start
=
0xdeadbeef
;
hres
=
ITextRange_GetStart
(
txtRge
,
&
start
);
ok
(
hres
==
S_OK
,
"ITextRange_GetStart
\n
"
);
ok
(
start
==
12
,
"got wrong start value: %d
\n
"
,
start
);
end
=
0xdeadbeef
;
hres
=
ITextRange_GetEnd
(
txtRge
,
&
end
);
ok
(
hres
==
S_OK
,
"ITextRange_GetEnd
\n
"
);
ok
(
end
==
12
,
"got wrong end value: %d
\n
"
,
end
);
ITextRange_Release
(
txtRge
);
release_interfaces
(
&
w
,
&
reOle
,
&
txtDoc
,
NULL
);
}
START_TEST
(
richole
)
{
/* Must explicitly LoadLibrary(). The test has no references to functions in
...
...
@@ -644,4 +708,5 @@ START_TEST(richole)
test_ITextSelection_GetChar
();
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