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
0ba3dc75
Commit
0ba3dc75
authored
Oct 19, 2002
by
Dimitrie O. Paun
Committed by
Alexandre Julliard
Oct 19, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More traces to help us make sense of the output.
Faster, cleaner ranges_{add,del}.
parent
c79eb2de
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
26 deletions
+33
-26
listview.c
dlls/comctl32/listview.c
+33
-26
No files found.
dlls/comctl32/listview.c
View file @
0ba3dc75
...
...
@@ -926,6 +926,7 @@ static BOOL iterator_frameditems(ITERATOR* i, LISTVIEW_INFO* infoPtr, const RECT
if
(
!
LISTVIEW_GetOrigin
(
infoPtr
,
&
Origin
))
return
FALSE
;
TRACE
(
"(lprc=%s)
\n
"
,
debugrect
(
lprc
));
OffsetRect
(
&
frame
,
-
Origin
.
x
,
-
Origin
.
y
);
if
(
uView
==
LVS_ICON
||
uView
==
LVS_SMALLICON
)
...
...
@@ -939,6 +940,7 @@ static BOOL iterator_frameditems(ITERATOR* i, LISTVIEW_INFO* infoPtr, const RECT
}
if
(
!
(
i
->
ranges
=
ranges_create
(
50
)))
return
FALSE
;
/* to do better here, we need to have PosX, and PosY sorted */
TRACE
(
"building icon ranges:
\n
"
);
for
(
nItem
=
0
;
nItem
<
infoPtr
->
nItemCount
;
nItem
++
)
{
rcItem
.
left
=
(
LONG
)
DPA_GetPtr
(
infoPtr
->
hdpaPosX
,
nItem
);
...
...
@@ -986,6 +988,7 @@ static BOOL iterator_frameditems(ITERATOR* i, LISTVIEW_INFO* infoPtr, const RECT
if
(
nLastCol
<
nFirstCol
||
nLastRow
<
nFirstRow
)
return
TRUE
;
if
(
!
(
i
->
ranges
=
ranges_create
(
nLastCol
-
nFirstCol
+
1
)))
return
FALSE
;
TRACE
(
"building list ranges:
\n
"
);
for
(
nCol
=
nFirstCol
;
nCol
<=
nLastCol
;
nCol
++
)
{
item_range
.
lower
=
nCol
*
nPerCol
+
nFirstRow
;
...
...
@@ -1019,6 +1022,7 @@ static BOOL iterator_visibleitems(ITERATOR* i, LISTVIEW_INFO *infoPtr, HDC hdc)
/* if we can't deal with the region, we'll just go with the simple range */
if
(
!
LISTVIEW_GetOrigin
(
infoPtr
,
&
Origin
))
return
TRUE
;
TRACE
(
"building visible range:
\n
"
);
if
(
!
i
->
ranges
)
{
if
(
!
(
i
->
ranges
=
ranges_create
(
50
)))
return
TRUE
;
...
...
@@ -1042,6 +1046,7 @@ static BOOL iterator_visibleitems(ITERATOR* i, LISTVIEW_INFO *infoPtr, HDC hdc)
ranges_delitem
(
i
->
ranges
,
i
->
nItem
);
}
/* the iterator should restart on the next iterator_next */
TRACE
(
"done
\n
"
);
return
TRUE
;
}
...
...
@@ -2232,7 +2237,7 @@ static void ranges_assert(RANGES ranges, LPCSTR desc)
assert
(
ranges
);
assert
(
ranges
->
hdpa
->
nItemCount
>=
0
);
if
(
ranges
->
hdpa
->
nItemCount
==
0
)
return
;
TRACE
(
"
Checking %s:
\n
"
,
desc
);
TRACE
(
"
*** Checking %s ***
\n
"
,
desc
);
ranges_dump
(
ranges
);
assert
((
prev
=
(
RANGE
*
)
DPA_GetPtr
(
ranges
->
hdpa
,
0
))
->
lower
>=
0
);
/* assert (((RANGE *)DPA_GetPtr(ranges->hdpa, ranges->hdpa->nItemCount - 1))->upper <= nUpper); */
...
...
@@ -2242,6 +2247,7 @@ static void ranges_assert(RANGES ranges, LPCSTR desc)
assert
(
prev
->
upper
<=
curr
->
lower
);
prev
=
curr
;
}
TRACE
(
"--- Done checking---
\n
"
);
}
static
RANGES
ranges_create
(
int
count
)
...
...
@@ -2370,7 +2376,7 @@ static BOOL ranges_add(RANGES ranges, RANGE range)
/* try find overlapping regions first */
srchrgn
.
lower
=
range
.
lower
-
1
;
srchrgn
.
upper
=
range
.
upper
+
1
;
index
=
DPA_Search
(
ranges
->
hdpa
,
&
srchrgn
,
0
,
ranges_cmp
,
0
,
0
);
index
=
DPA_Search
(
ranges
->
hdpa
,
&
srchrgn
,
0
,
ranges_cmp
,
0
,
DPAS_SORTED
);
if
(
index
==
-
1
)
{
...
...
@@ -2444,64 +2450,65 @@ fail:
static
BOOL
ranges_del
(
RANGES
ranges
,
RANGE
range
)
{
RANGE
remrgn
,
tmprgn
,
*
chkrgn
;
BOOL
done
=
FALSE
;
RANGE
*
chkrgn
;
INT
index
;
TRACE
(
"(%s)
\n
"
,
debugrange
(
&
range
));
ranges_check
(
ranges
,
"before del"
);
if
(
!
ranges
)
goto
fail
;
remrgn
=
range
;
do
/* we don't use DPAS_SORTED here, since we need *
* to find the first overlapping range */
index
=
DPA_Search
(
ranges
->
hdpa
,
&
range
,
0
,
ranges_cmp
,
0
,
0
);
while
(
index
!=
-
1
)
{
index
=
DPA_Search
(
ranges
->
hdpa
,
&
remrgn
,
0
,
ranges_cmp
,
0
,
0
);
if
(
index
==
-
1
)
break
;
chkrgn
=
DPA_GetPtr
(
ranges
->
hdpa
,
index
);
if
(
!
chkrgn
)
goto
fail
;
TRACE
(
"Matches range %s @%d
\n
"
,
debugrange
(
chkrgn
),
index
);
/* case 1: Same range */
if
(
(
chkrgn
->
upper
==
r
emrgn
.
upper
)
&&
(
chkrgn
->
lower
==
r
emrgn
.
lower
)
)
if
(
(
chkrgn
->
upper
==
r
ange
.
upper
)
&&
(
chkrgn
->
lower
==
r
ange
.
lower
)
)
{
DPA_DeletePtr
(
ranges
->
hdpa
,
index
);
done
=
TRUE
;
break
;
}
/* case 2: engulf */
else
if
(
(
chkrgn
->
upper
<=
r
emrgn
.
upper
)
&&
(
chkrgn
->
lower
>=
r
emrgn
.
lower
)
)
else
if
(
(
chkrgn
->
upper
<=
r
ange
.
upper
)
&&
(
chkrgn
->
lower
>=
r
ange
.
lower
)
)
{
DPA_DeletePtr
(
ranges
->
hdpa
,
index
);
}
/* case 3: overlap upper */
else
if
(
(
chkrgn
->
upper
<=
r
emrgn
.
upper
)
&&
(
chkrgn
->
lower
<
r
emrgn
.
lower
)
)
else
if
(
(
chkrgn
->
upper
<=
r
ange
.
upper
)
&&
(
chkrgn
->
lower
<
r
ange
.
lower
)
)
{
chkrgn
->
upper
=
r
emrgn
.
lower
;
chkrgn
->
upper
=
r
ange
.
lower
;
}
/* case 4: overlap lower */
else
if
(
(
chkrgn
->
upper
>
r
emrgn
.
upper
)
&&
(
chkrgn
->
lower
>=
r
emrgn
.
lower
)
)
else
if
(
(
chkrgn
->
upper
>
r
ange
.
upper
)
&&
(
chkrgn
->
lower
>=
r
ange
.
lower
)
)
{
chkrgn
->
lower
=
remrgn
.
upper
;
chkrgn
->
lower
=
range
.
upper
;
break
;
}
/* case 5: fully internal */
else
{
RANGE
*
newrgn
=
(
RANGE
*
)
COMCTL32_Alloc
(
sizeof
(
RANGE
))
;
if
(
!
newrgn
)
goto
fail
;
tmprgn
=
*
chkrgn
;
RANGE
tmprgn
=
*
chkrgn
,
*
newrgn
;
if
(
!
(
newrgn
=
(
RANGE
*
)
COMCTL32_Alloc
(
sizeof
(
RANGE
))))
goto
fail
;
newrgn
->
lower
=
chkrgn
->
lower
;
newrgn
->
upper
=
r
emrgn
.
lower
;
chkrgn
->
lower
=
r
emrgn
.
upper
;
newrgn
->
upper
=
r
ange
.
lower
;
chkrgn
->
lower
=
r
ange
.
upper
;
DPA_InsertPtr
(
ranges
->
hdpa
,
index
,
newrgn
);
chkrgn
=
&
tmprgn
;
break
;
}
index
=
DPA_Search
(
ranges
->
hdpa
,
&
range
,
index
,
ranges_cmp
,
0
,
0
);
}
while
(
!
done
);
ranges_check
(
ranges
,
"after del"
);
return
TRUE
;
...
...
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