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
c0a6d2d4
Commit
c0a6d2d4
authored
Jul 06, 2023
by
Gabriel Ivăncescu
Committed by
Alexandre Julliard
Jul 07, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Introduce helper to transfer node ownership to range points when AddRef isn't needed.
Signed-off-by:
Gabriel Ivăncescu
<
gabrielopcode@gmail.com
>
parent
cc3f61e7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
15 deletions
+12
-15
range.c
dlls/mshtml/range.c
+12
-15
No files found.
dlls/mshtml/range.c
View file @
c0a6d2d4
...
...
@@ -174,15 +174,19 @@ static int get_child_index(nsIDOMNode *parent, nsIDOMNode *child)
return
ret
;
}
static
void
init_rangepoint
(
rangepoint_t
*
rangepoint
,
nsIDOMNode
*
node
,
UINT32
off
)
static
void
init_rangepoint
_no_addref
(
rangepoint_t
*
rangepoint
,
nsIDOMNode
*
node
,
UINT32
off
)
{
nsIDOMNode_AddRef
(
node
);
rangepoint
->
type
=
get_node_type
(
node
);
rangepoint
->
node
=
node
;
rangepoint
->
off
=
off
;
}
static
void
init_rangepoint
(
rangepoint_t
*
rangepoint
,
nsIDOMNode
*
node
,
UINT32
off
)
{
nsIDOMNode_AddRef
(
node
);
init_rangepoint_no_addref
(
rangepoint
,
node
,
off
);
}
static
inline
void
free_rangepoint
(
rangepoint_t
*
rangepoint
)
{
nsIDOMNode_Release
(
rangepoint
->
node
);
...
...
@@ -203,8 +207,7 @@ static BOOL rangepoint_next_node(rangepoint_t *iter)
node
=
get_child_node
(
iter
->
node
,
iter
->
off
);
if
(
node
)
{
free_rangepoint
(
iter
);
init_rangepoint
(
iter
,
node
,
0
);
nsIDOMNode_Release
(
node
);
init_rangepoint_no_addref
(
iter
,
node
,
0
);
return
TRUE
;
}
...
...
@@ -216,8 +219,7 @@ static BOOL rangepoint_next_node(rangepoint_t *iter)
off
=
get_child_index
(
node
,
iter
->
node
)
+
1
;
free_rangepoint
(
iter
);
init_rangepoint
(
iter
,
node
,
off
);
nsIDOMNode_Release
(
node
);
init_rangepoint_no_addref
(
iter
,
node
,
off
);
return
TRUE
;
}
...
...
@@ -266,8 +268,7 @@ static BOOL rangepoint_prev_node(rangepoint_t *iter)
off
=
get_node_type
(
node
)
==
TEXT_NODE
?
get_text_length
(
node
)
:
get_child_count
(
node
);
free_rangepoint
(
iter
);
init_rangepoint
(
iter
,
node
,
off
);
nsIDOMNode_Release
(
node
);
init_rangepoint_no_addref
(
iter
,
node
,
off
);
return
TRUE
;
}
...
...
@@ -291,9 +292,7 @@ static void get_start_point(HTMLTxtRange *This, rangepoint_t *ret)
nsIDOMRange_GetStartContainer
(
This
->
nsrange
,
&
node
);
nsIDOMRange_GetStartOffset
(
This
->
nsrange
,
&
off
);
init_rangepoint
(
ret
,
node
,
off
);
nsIDOMNode_Release
(
node
);
init_rangepoint_no_addref
(
ret
,
node
,
off
);
}
static
void
get_end_point
(
HTMLTxtRange
*
This
,
rangepoint_t
*
ret
)
...
...
@@ -304,9 +303,7 @@ static void get_end_point(HTMLTxtRange *This, rangepoint_t *ret)
nsIDOMRange_GetEndContainer
(
This
->
nsrange
,
&
node
);
nsIDOMRange_GetEndOffset
(
This
->
nsrange
,
&
off
);
init_rangepoint
(
ret
,
node
,
off
);
nsIDOMNode_Release
(
node
);
init_rangepoint_no_addref
(
ret
,
node
,
off
);
}
static
void
set_start_point
(
HTMLTxtRange
*
This
,
const
rangepoint_t
*
start
)
...
...
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