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
057267d8
Commit
057267d8
authored
Feb 08, 2010
by
Nikolay Sivov
Committed by
Alexandre Julliard
Feb 08, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/listview: Revert item width calculation to fix performance issues.
parent
22434f49
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
11 deletions
+4
-11
listview.c
dlls/comctl32/listview.c
+3
-10
listview.c
dlls/comctl32/tests/listview.c
+1
-1
No files found.
dlls/comctl32/listview.c
View file @
057267d8
...
...
@@ -401,7 +401,7 @@ typedef struct tagLISTVIEW_INFO
#define MAX_EMPTYTEXT_SELECT_WIDTH 80
/* default column width for items in list display mode */
#define DEFAULT_COLUMN_WIDTH
96
#define DEFAULT_COLUMN_WIDTH
128
/* Size of "line" scroll for V & H scrolls */
#define LISTVIEW_SCROLL_ICON_LINE_SIZE 37
...
...
@@ -2808,7 +2808,6 @@ static INT LISTVIEW_CalculateItemWidth(const LISTVIEW_INFO *infoPtr)
{
WCHAR
szDispText
[
DISP_TEXT_SIZE
]
=
{
'\0'
};
LVITEMW
lvItem
;
BOOL
empty
;
INT
i
;
lvItem
.
mask
=
LVIF_TEXT
;
...
...
@@ -2823,19 +2822,13 @@ static INT LISTVIEW_CalculateItemWidth(const LISTVIEW_INFO *infoPtr)
nItemWidth
=
max
(
LISTVIEW_GetStringWidthT
(
infoPtr
,
lvItem
.
pszText
,
TRUE
),
nItemWidth
);
}
empty
=
nItemWidth
==
0
;
if
(
infoPtr
->
himlSmall
)
nItemWidth
+=
infoPtr
->
iconSize
.
cx
;
if
(
infoPtr
->
himlState
)
nItemWidth
+=
infoPtr
->
iconStateSize
.
cx
;
if
(
empty
)
nItemWidth
=
max
(
nItemWidth
,
DEFAULT_COLUMN_WIDTH
);
else
nItemWidth
+=
WIDTH_PADDING
;
nItemWidth
=
max
(
DEFAULT_COLUMN_WIDTH
,
nItemWidth
+
WIDTH_PADDING
);
}
TRACE
(
"nItemWidth=%d
\n
"
,
nItemWidth
);
return
nItemWidth
;
}
...
...
@@ -7480,7 +7473,7 @@ static INT LISTVIEW_InsertItemT(LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem,
TRACE
(
" inserting at %d, sorted=%d, count=%d, iItem=%d
\n
"
,
nItem
,
is_sorted
,
infoPtr
->
nItemCount
,
lpLVItem
->
iItem
);
nItem
=
DPA_InsertPtr
(
infoPtr
->
hdpaItems
,
nItem
,
hdpaSubItems
);
if
(
nItem
==
-
1
)
goto
fail
;
i
f
(
++
infoPtr
->
nItemCount
>
0
)
LISTVIEW_UpdateItemSize
(
infoPtr
)
;
i
nfoPtr
->
nItemCount
++
;
/* shift indices first so they don't get tangled */
LISTVIEW_ShiftIndices
(
infoPtr
,
nItem
,
1
);
...
...
dlls/comctl32/tests/listview.c
View file @
057267d8
...
...
@@ -3967,7 +3967,7 @@ static void test_getcolumnwidth(void)
memset
(
&
itema
,
0
,
sizeof
(
itema
));
SendMessage
(
hwnd
,
LVM_INSERTITEMA
,
0
,
(
LPARAM
)
&
itema
);
ret
=
SendMessage
(
hwnd
,
LVM_GETCOLUMNWIDTH
,
0
,
0
);
expect
(
96
,
ret
);
todo_wine
expect
(
96
,
ret
);
DestroyWindow
(
hwnd
);
}
...
...
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