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
f2f444a2
Commit
f2f444a2
authored
Jun 11, 2009
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jun 11, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/listview: Don't use special value (1) for item width to represent both…
comctl32/listview: Don't use special value (1) for item width to represent both zero and one pixel width.
parent
a5c970de
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
7 deletions
+21
-7
listview.c
dlls/comctl32/listview.c
+20
-6
listview.c
dlls/comctl32/tests/listview.c
+1
-1
No files found.
dlls/comctl32/listview.c
View file @
f2f444a2
...
...
@@ -1239,12 +1239,25 @@ static BOOL iterator_frameditems(ITERATOR* i, const LISTVIEW_INFO* infoPtr, cons
INT
nPerCol
=
max
((
infoPtr
->
rcList
.
bottom
-
infoPtr
->
rcList
.
top
)
/
infoPtr
->
nItemHeight
,
1
);
INT
nFirstRow
=
max
(
frame
.
top
/
infoPtr
->
nItemHeight
,
0
);
INT
nLastRow
=
min
((
frame
.
bottom
-
1
)
/
infoPtr
->
nItemHeight
,
nPerCol
-
1
);
INT
nFirstCol
=
max
(
frame
.
left
/
infoPtr
->
nItemWidth
,
0
)
;
INT
nLastCol
=
min
((
frame
.
right
-
1
)
/
infoPtr
->
nItemWidth
,
(
infoPtr
->
nItemCount
+
nPerCol
-
1
)
/
nPerCol
)
;
INT
lower
=
nFirstCol
*
nPerCol
+
nFirstRow
;
INT
nFirstCol
;
INT
nLastCol
;
INT
lower
;
RANGE
item_range
;
INT
nCol
;
if
(
infoPtr
->
nItemWidth
)
{
nFirstCol
=
max
(
frame
.
left
/
infoPtr
->
nItemWidth
,
0
);
nLastCol
=
min
((
frame
.
right
-
1
)
/
infoPtr
->
nItemWidth
,
(
infoPtr
->
nItemCount
+
nPerCol
-
1
)
/
nPerCol
);
}
else
{
nFirstCol
=
max
(
frame
.
left
,
0
);
nLastCol
=
min
(
frame
.
right
-
1
,
(
infoPtr
->
nItemCount
+
nPerCol
-
1
)
/
nPerCol
);
}
lower
=
nFirstCol
*
nPerCol
+
nFirstRow
;
TRACE
(
"nPerCol=%d, nFirstRow=%d, nLastRow=%d, nFirstCol=%d, nLastCol=%d, lower=%d
\n
"
,
nPerCol
,
nFirstRow
,
nLastRow
,
nFirstCol
,
nLastCol
,
lower
);
...
...
@@ -1493,7 +1506,7 @@ static inline INT LISTVIEW_GetCountPerRow(const LISTVIEW_INFO *infoPtr)
{
INT
nListWidth
=
infoPtr
->
rcList
.
right
-
infoPtr
->
rcList
.
left
;
return
max
(
nListWidth
/
infoPtr
->
nItemWidth
,
1
);
return
max
(
nListWidth
/
(
infoPtr
->
nItemWidth
?
infoPtr
->
nItemWidth
:
1
)
,
1
);
}
/***
...
...
@@ -1736,7 +1749,8 @@ static void LISTVIEW_UpdateScroll(const LISTVIEW_INFO *infoPtr)
if
(
horzInfo
.
nPage
<
infoPtr
->
nItemWidth
)
horzInfo
.
nPage
=
infoPtr
->
nItemWidth
;
horzInfo
.
nPage
/=
infoPtr
->
nItemWidth
;
if
(
infoPtr
->
nItemWidth
)
horzInfo
.
nPage
/=
infoPtr
->
nItemWidth
;
}
else
if
(
infoPtr
->
uView
==
LV_VIEW_DETAILS
)
{
...
...
@@ -2530,7 +2544,7 @@ static INT LISTVIEW_CalculateItemWidth(const LISTVIEW_INFO *infoPtr)
nItemWidth
=
max
(
DEFAULT_COLUMN_WIDTH
,
nItemWidth
+
WIDTH_PADDING
);
}
return
max
(
nItemWidth
,
1
)
;
return
nItemWidth
;
}
/***
...
...
dlls/comctl32/tests/listview.c
View file @
f2f444a2
...
...
@@ -2829,7 +2829,7 @@ static void test_getitemrect(void)
/* zero width rectangle with no padding */
expect
(
0
,
rect
.
left
);
todo_wine
expect
(
0
,
rect
.
right
);
expect
(
0
,
rect
.
right
);
insert_column
(
hwnd
,
0
);
insert_column
(
hwnd
,
1
);
...
...
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