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
d6c14fba
Commit
d6c14fba
authored
Sep 12, 2007
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 13, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Added IHTMLTxtRange::moveEnd implementation.
parent
11591e77
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
64 additions
and
2 deletions
+64
-2
dom.c
dlls/mshtml/tests/dom.c
+22
-0
txtrange.c
dlls/mshtml/txtrange.c
+42
-2
No files found.
dlls/mshtml/tests/dom.c
View file @
d6c14fba
...
...
@@ -155,6 +155,17 @@ static void _test_range_move(unsigned line, IHTMLTxtRange *range, LPWSTR unit, l
_test_range_text
(
line
,
range
,
NULL
);
}
#define test_range_moveend(r,u,c,e) _test_range_moveend(__LINE__,r,u,c,e)
static
void
_test_range_moveend
(
unsigned
line
,
IHTMLTxtRange
*
range
,
LPWSTR
unit
,
long
cnt
,
long
excnt
)
{
long
c
=
0xdeadbeef
;
HRESULT
hres
;
hres
=
IHTMLTxtRange_moveEnd
(
range
,
unit
,
cnt
,
&
c
);
ok_
(
__FILE__
,
line
)
(
hres
==
S_OK
,
"move failed: %08x
\n
"
,
hres
);
ok_
(
__FILE__
,
line
)
(
c
==
excnt
,
"count=%ld, expected %ld
\n
"
,
c
,
excnt
);
}
#define test_range_inrange(r1,r2,b) _test_range_inrange(__LINE__,r1,r2,b)
static
void
_test_range_inrange
(
unsigned
line
,
IHTMLTxtRange
*
range1
,
IHTMLTxtRange
*
range2
,
VARIANT_BOOL
exb
)
{
...
...
@@ -245,6 +256,17 @@ static void test_txtrange(IHTMLDocument2 *doc)
test_range_text
(
range
,
"test abc 123
\r\n
it's text"
);
test_range_move
(
range
,
characterW
,
3
,
3
);
test_range_moveend
(
range
,
characterW
,
1
,
1
);
test_range_text
(
range
,
"t"
);
test_range_moveend
(
range
,
characterW
,
3
,
3
);
test_range_text
(
range
,
"t ab"
);
test_range_moveend
(
range
,
characterW
,
-
2
,
-
2
);
test_range_text
(
range
,
"t "
);
test_range_move
(
range
,
characterW
,
6
,
6
);
test_range_moveend
(
range
,
characterW
,
3
,
3
);
test_range_text
(
range
,
"123"
);
test_range_moveend
(
range
,
characterW
,
2
,
2
);
test_range_text
(
range
,
"123
\r\n
i"
);
IHTMLTxtRange_Release
(
range
);
IHTMLTxtRange_Release
(
body_range
);
...
...
dlls/mshtml/txtrange.c
View file @
d6c14fba
...
...
@@ -1095,8 +1095,48 @@ static HRESULT WINAPI HTMLTxtRange_moveEnd(IHTMLTxtRange *iface, BSTR Unit,
long
Count
,
long
*
ActualCount
)
{
HTMLTxtRange
*
This
=
HTMLTXTRANGE_THIS
(
iface
);
FIXME
(
"(%p)->(%s %ld %p)
\n
"
,
This
,
debugstr_w
(
Unit
),
Count
,
ActualCount
);
return
E_NOTIMPL
;
range_unit_t
unit
;
TRACE
(
"(%p)->(%s %ld %p)
\n
"
,
This
,
debugstr_w
(
Unit
),
Count
,
ActualCount
);
unit
=
string_to_unit
(
Unit
);
if
(
unit
==
RU_UNKNOWN
)
return
E_INVALIDARG
;
if
(
!
Count
)
{
*
ActualCount
=
0
;
return
S_OK
;
}
switch
(
unit
)
{
case
RU_CHAR
:
{
dompos_t
cur_pos
,
new_pos
;
PRBool
collapsed
;
get_cur_pos
(
This
,
FALSE
,
&
cur_pos
);
nsIDOMRange_GetCollapsed
(
This
->
nsrange
,
&
collapsed
);
if
(
Count
>
0
)
{
*
ActualCount
=
move_next_chars
(
Count
,
&
cur_pos
,
collapsed
,
&
new_pos
);
set_range_pos
(
This
,
FALSE
,
&
new_pos
);
}
else
{
*
ActualCount
=
-
move_prev_chars
(
This
,
-
Count
,
&
cur_pos
,
TRUE
,
&
new_pos
);
if
(
*
ActualCount
==
Count
)
set_range_pos
(
This
,
FALSE
,
&
new_pos
);
else
IHTMLTxtRange_collapse
(
HTMLTXTRANGE
(
This
),
TRUE
);
}
dompos_release
(
&
cur_pos
);
dompos_release
(
&
new_pos
);
break
;
}
default:
FIXME
(
"unimplemented unit %s
\n
"
,
debugstr_w
(
Unit
));
}
return
S_OK
;
}
static
HRESULT
WINAPI
HTMLTxtRange_select
(
IHTMLTxtRange
*
iface
)
...
...
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