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
d6e29316
Commit
d6e29316
authored
Aug 17, 2007
by
Jacek Caban
Committed by
Alexandre Julliard
Aug 17, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Added IHTMLTxtRange::compareEndPoints implementation.
parent
cbfef318
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
2 deletions
+56
-2
nsiface.idl
dlls/mshtml/nsiface.idl
+7
-0
txtrange.c
dlls/mshtml/txtrange.c
+49
-2
No files found.
dlls/mshtml/nsiface.idl
View file @
d6e29316
...
...
@@ -819,6 +819,13 @@ interface nsIDOMHTMLDocument : nsIDOMDocument
]
interface nsIDOMRange : nsISupports
{
enum {
NS_START_TO_START,
NS_START_TO_END,
NS_END_TO_END,
NS_END_TO_START
};
nsresult GetStartContainer(nsIDOMNode **aStartContainer);
nsresult GetStartOffset(PRInt32 *aStartOffset);
nsresult GetEndContainer(nsIDOMNode **aEndContainer);
...
...
dlls/mshtml/txtrange.c
View file @
d6e29316
...
...
@@ -49,6 +49,34 @@ typedef struct {
#define HTMLTXTRANGE(x) ((IHTMLTxtRange*) &(x)->lpHTMLTxtRangeVtbl)
static
HTMLTxtRange
*
get_range_object
(
HTMLDocument
*
doc
,
IHTMLTxtRange
*
iface
)
{
HTMLTxtRange
*
iter
;
LIST_FOR_EACH_ENTRY
(
iter
,
&
doc
->
range_list
,
HTMLTxtRange
,
entry
)
{
if
(
HTMLTXTRANGE
(
iter
)
==
iface
)
return
iter
;
}
ERR
(
"Could not find range in document
\n
"
);
return
NULL
;
}
static
int
string_to_nscmptype
(
LPCWSTR
str
)
{
static
const
WCHAR
seW
[]
=
{
'S'
,
't'
,
'a'
,
'r'
,
't'
,
'T'
,
'o'
,
'E'
,
'n'
,
'd'
,
0
};
static
const
WCHAR
ssW
[]
=
{
'S'
,
't'
,
'a'
,
'r'
,
't'
,
'T'
,
'o'
,
'S'
,
't'
,
'a'
,
'r'
,
't'
,
0
};
static
const
WCHAR
esW
[]
=
{
'E'
,
'n'
,
'd'
,
'T'
,
'o'
,
'S'
,
't'
,
'a'
,
'r'
,
't'
,
0
};
static
const
WCHAR
eeW
[]
=
{
'E'
,
'n'
,
'd'
,
'T'
,
'o'
,
'E'
,
'n'
,
'd'
,
0
};
if
(
!
strcmpiW
(
str
,
seW
))
return
NS_START_TO_END
;
if
(
!
strcmpiW
(
str
,
ssW
))
return
NS_START_TO_START
;
if
(
!
strcmpiW
(
str
,
esW
))
return
NS_END_TO_START
;
if
(
!
strcmpiW
(
str
,
eeW
))
return
NS_END_TO_END
;
return
-
1
;
}
#define HTMLTXTRANGE_THIS(iface) DEFINE_THIS(HTMLTxtRange, HTMLTxtRange, iface)
static
HRESULT
WINAPI
HTMLTxtRange_QueryInterface
(
IHTMLTxtRange
*
iface
,
REFIID
riid
,
void
**
ppv
)
...
...
@@ -383,8 +411,27 @@ static HRESULT WINAPI HTMLTxtRange_compareEndPoints(IHTMLTxtRange *iface, BSTR h
IHTMLTxtRange
*
SourceRange
,
long
*
ret
)
{
HTMLTxtRange
*
This
=
HTMLTXTRANGE_THIS
(
iface
);
FIXME
(
"(%p)->(%s %p %p)
\n
"
,
This
,
debugstr_w
(
how
),
SourceRange
,
ret
);
return
E_NOTIMPL
;
HTMLTxtRange
*
src_range
;
PRInt16
nsret
=
0
;
int
nscmpt
;
nsresult
nsres
;
TRACE
(
"(%p)->(%s %p %p)
\n
"
,
This
,
debugstr_w
(
how
),
SourceRange
,
ret
);
nscmpt
=
string_to_nscmptype
(
how
);
if
(
nscmpt
==
-
1
)
return
E_INVALIDARG
;
src_range
=
get_range_object
(
This
->
doc
,
SourceRange
);
if
(
!
src_range
)
return
E_FAIL
;
nsres
=
nsIDOMRange_CompareBoundaryPoints
(
This
->
nsrange
,
nscmpt
,
src_range
->
nsrange
,
&
nsret
);
if
(
NS_FAILED
(
nsres
))
ERR
(
"CompareBoundaryPoints failed: %08x
\n
"
,
nsres
);
*
ret
=
nsret
;
return
S_OK
;
}
static
HRESULT
WINAPI
HTMLTxtRange_findText
(
IHTMLTxtRange
*
iface
,
BSTR
String
,
...
...
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