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
11d62d7f
Commit
11d62d7f
authored
Oct 19, 2007
by
Jacek Caban
Committed by
Alexandre Julliard
Oct 22, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Added IHTMLTxtRange::expand("TextEdit") implementation.
parent
f02a0157
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
2 deletions
+39
-2
dom.c
dlls/mshtml/tests/dom.c
+3
-0
txtrange.c
dlls/mshtml/txtrange.c
+36
-2
No files found.
dlls/mshtml/tests/dom.c
View file @
11d62d7f
...
...
@@ -43,6 +43,7 @@ static const char doc_str3[] =
static
const
WCHAR
noneW
[]
=
{
'N'
,
'o'
,
'n'
,
'e'
,
0
};
static
WCHAR
characterW
[]
=
{
'c'
,
'h'
,
'a'
,
'r'
,
'a'
,
'c'
,
't'
,
'e'
,
'r'
,
0
};
static
WCHAR
texteditW
[]
=
{
't'
,
'e'
,
'x'
,
't'
,
'e'
,
'd'
,
'i'
,
't'
,
0
};
static
WCHAR
wordW
[]
=
{
'w'
,
'o'
,
'r'
,
'd'
,
0
};
typedef
enum
{
...
...
@@ -873,6 +874,8 @@ static void test_txtrange(IHTMLDocument2 *doc)
test_range_moveend
(
range
,
characterW
,
3
,
3
);
test_range_text
(
range
,
"wor"
);
test_range_parent
(
range
,
ET_BODY
);
test_range_expand
(
range
,
texteditW
,
VARIANT_TRUE
,
"wordabc 123
\r\n
it's text"
);
test_range_expand
(
range
,
texteditW
,
VARIANT_TRUE
,
"wordabc 123
\r\n
it's text"
);
IHTMLTxtRange_Release
(
range
);
}
...
...
dlls/mshtml/txtrange.c
View file @
11d62d7f
...
...
@@ -1073,12 +1073,12 @@ static HRESULT WINAPI HTMLTxtRange_expand(IHTMLTxtRange *iface, BSTR Unit, VARIA
if
(
unit
==
RU_UNKNOWN
)
return
E_INVALIDARG
;
*
Success
=
VARIANT_FALSE
;
switch
(
unit
)
{
case
RU_WORD
:
{
dompos_t
end_pos
,
start_pos
,
new_pos
;
*
Success
=
VARIANT_FALSE
;
get_cur_pos
(
This
,
TRUE
,
&
start_pos
);
get_cur_pos
(
This
,
FALSE
,
&
end_pos
);
if
(
find_next_space
(
&
end_pos
,
TRUE
,
&
new_pos
))
{
...
...
@@ -1097,6 +1097,40 @@ static HRESULT WINAPI HTMLTxtRange_expand(IHTMLTxtRange *iface, BSTR Unit, VARIA
break
;
}
case
RU_TEXTEDIT
:
{
nsIDOMDocument
*
nsdoc
;
nsIDOMHTMLDocument
*
nshtmldoc
;
nsIDOMHTMLElement
*
nsbody
=
NULL
;
nsresult
nsres
;
nsres
=
nsIWebNavigation_GetDocument
(
This
->
doc
->
nscontainer
->
navigation
,
&
nsdoc
);
if
(
NS_FAILED
(
nsres
)
||
!
nsdoc
)
{
ERR
(
"GetDocument failed: %08x
\n
"
,
nsres
);
break
;
}
nsIDOMDocument_QueryInterface
(
nsdoc
,
&
IID_nsIDOMHTMLDocument
,
(
void
**
)
&
nshtmldoc
);
nsIDOMDocument_Release
(
nsdoc
);
nsres
=
nsIDOMHTMLDocument_GetBody
(
nshtmldoc
,
&
nsbody
);
nsIDOMHTMLDocument_Release
(
nshtmldoc
);
if
(
NS_FAILED
(
nsres
)
||
!
nsbody
)
{
ERR
(
"Could not get body: %08x
\n
"
,
nsres
);
break
;
}
nsres
=
nsIDOMRange_SelectNodeContents
(
This
->
nsrange
,
(
nsIDOMNode
*
)
nsbody
);
nsIDOMHTMLElement_Release
(
nsbody
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"Collapse failed: %08x
\n
"
,
nsres
);
break
;
}
*
Success
=
VARIANT_TRUE
;
break
;
}
default:
FIXME
(
"Unimplemented unit %s
\n
"
,
debugstr_w
(
Unit
));
}
...
...
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