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
3a0670ed
Commit
3a0670ed
authored
May 17, 2015
by
Nikolay Sivov
Committed by
Alexandre Julliard
May 18, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched20: Implement SetStart().
parent
6d19ac5c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
71 additions
and
3 deletions
+71
-3
richole.c
dlls/riched20/richole.c
+23
-3
richole.c
dlls/riched20/tests/richole.c
+48
-0
No files found.
dlls/riched20/richole.c
View file @
3a0670ed
...
...
@@ -905,14 +905,34 @@ static HRESULT WINAPI ITextRange_fnGetStart(ITextRange *me, LONG *pcpFirst)
return
S_OK
;
}
static
HRESULT
WINAPI
ITextRange_fnSetStart
(
ITextRange
*
me
,
LONG
cpFirs
t
)
static
HRESULT
WINAPI
ITextRange_fnSetStart
(
ITextRange
*
me
,
LONG
star
t
)
{
ITextRangeImpl
*
This
=
impl_from_ITextRange
(
me
);
int
len
;
TRACE
(
"(%p)->(%d)
\n
"
,
This
,
start
);
if
(
!
This
->
reOle
)
return
CO_E_RELEASED
;
FIXME
(
"not implemented %p
\n
"
,
This
);
return
E_NOTIMPL
;
if
(
start
==
This
->
start
)
return
S_FALSE
;
if
(
start
<
0
)
{
This
->
start
=
0
;
return
S_OK
;
}
len
=
ME_GetTextLength
(
This
->
reOle
->
editor
);
if
(
start
>
This
->
end
)
This
->
end
=
len
;
if
(
start
>
len
)
This
->
start
=
len
;
else
This
->
start
=
start
;
return
S_OK
;
}
static
HRESULT
WINAPI
ITextRange_fnGetEnd
(
ITextRange
*
me
,
LONG
*
pcpLim
)
...
...
dlls/riched20/tests/richole.c
View file @
3a0670ed
...
...
@@ -711,6 +711,54 @@ static void test_ITextRange_GetStart_GetEnd(void)
hres
=
ITextRange_GetEnd
(
txtRge
,
&
end
);
ok
(
hres
==
S_OK
,
"ITextRange_GetEnd
\n
"
);
ok
(
end
==
12
,
"got wrong end value: %d
\n
"
,
end
);
/* SetStart */
hres
=
ITextRange_SetStart
(
txtRge
,
0
);
ok
(
hres
==
S_OK
,
"got 0x%08x
\n
"
,
hres
);
/* same value */
hres
=
ITextRange_SetStart
(
txtRge
,
0
);
ok
(
hres
==
S_FALSE
,
"got 0x%08x
\n
"
,
hres
);
hres
=
ITextRange_SetStart
(
txtRge
,
1
);
ok
(
hres
==
S_OK
,
"got 0x%08x
\n
"
,
hres
);
/* negative resets to 0 */
hres
=
ITextRange_SetStart
(
txtRge
,
-
1
);
ok
(
hres
==
S_OK
,
"got 0x%08x
\n
"
,
hres
);
start
=
-
1
;
hres
=
ITextRange_GetStart
(
txtRge
,
&
start
);
ok
(
hres
==
S_OK
,
"got 0x%08x
\n
"
,
hres
);
ok
(
start
==
0
,
"got %d
\n
"
,
start
);
/* greater than initial end, but less than total char count */
hres
=
ITextRange_SetStart
(
txtRge
,
10
);
ok
(
hres
==
S_OK
,
"got 0x%08x
\n
"
,
hres
);
start
=
0
;
hres
=
ITextRange_GetStart
(
txtRge
,
&
start
);
ok
(
hres
==
S_OK
,
"got 0x%08x
\n
"
,
hres
);
ok
(
start
==
10
,
"got %d
\n
"
,
start
);
end
=
0
;
hres
=
ITextRange_GetEnd
(
txtRge
,
&
end
);
ok
(
hres
==
S_OK
,
"got 0x%08x
\n
"
,
hres
);
ok
(
end
==
12
,
"got %d
\n
"
,
end
);
hres
=
ITextRange_SetStart
(
txtRge
,
50
);
ok
(
hres
==
S_OK
,
"got 0x%08x
\n
"
,
hres
);
start
=
0
;
hres
=
ITextRange_GetStart
(
txtRge
,
&
start
);
ok
(
hres
==
S_OK
,
"got 0x%08x
\n
"
,
hres
);
ok
(
start
==
12
,
"got %d
\n
"
,
start
);
end
=
0
;
hres
=
ITextRange_GetEnd
(
txtRge
,
&
end
);
ok
(
hres
==
S_OK
,
"got 0x%08x
\n
"
,
hres
);
ok
(
end
==
12
,
"got %d
\n
"
,
end
);
ITextRange_Release
(
txtRge
);
release_interfaces
(
&
w
,
&
reOle
,
&
txtDoc
,
NULL
);
...
...
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