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
57200073
Commit
57200073
authored
Dec 10, 2002
by
Dimitrie O. Paun
Committed by
Alexandre Julliard
Dec 10, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Plug a bunch of memory leaks.
- Make ranges_destroy behave more like free(). - Fix messed up indentation from tabs set to 4 chars. - Updated the documentation.
parent
50bd40c7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
20 deletions
+33
-20
listview.c
dlls/comctl32/listview.c
+33
-20
No files found.
dlls/comctl32/listview.c
View file @
57200073
...
...
@@ -45,13 +45,15 @@
* -- LVA_SNAPTOGRID not implemented
* -- LISTVIEW_ApproximateViewRect partially implemented
* -- LISTVIEW_[GS]etColumnOrderArray stubs
* -- LISTVIEW_GetNextItem is very inefficient
* -- LISTVIEW_SetColumnWidth ignores header images & bitmap
* -- LISTVIEW_SetIconSpacing is incomplete
* -- LISTVIEW_SortItems is broken
* -- LISTVIEW_StyleChanged doesn't handle some changes too well
*
* Speedups
* -- LISTVIEW_GetNextItem needs to be rewritten. It is currently
* linear in the number of items in the list, and this is
* unacceptable for large lists.
* -- in sorted mode, LISTVIEW_InsertItemT sorts the array,
* instead of inserting in the right spot
* -- we should keep an ordered array of coordinates in iconic mode
...
...
@@ -785,16 +787,16 @@ static BOOL notify_dispinfoT(LISTVIEW_INFO *infoPtr, INT notificationCode, LPNML
if
(
convertToAnsi
)
{
if
(
notificationCode
!=
LVN_GETDISPINFOW
)
{
if
(
notificationCode
!=
LVN_GETDISPINFOW
)
{
cchTempBufMax
=
WideCharToMultiByte
(
CP_ACP
,
0
,
pdi
->
item
.
pszText
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
}
else
{
cchTempBufMax
=
pdi
->
item
.
cchTextMax
;
*
pdi
->
item
.
pszText
=
0
;
/* make sure we don't process garbage */
}
else
{
cchTempBufMax
=
pdi
->
item
.
cchTextMax
;
*
pdi
->
item
.
pszText
=
0
;
/* make sure we don't process garbage */
}
pszTempBuf
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
CHAR
)
*
cchTempBufMax
);
...
...
@@ -1016,7 +1018,7 @@ static RANGE iterator_range(ITERATOR* i)
*/
static
inline
void
iterator_destroy
(
ITERATOR
*
i
)
{
if
(
i
->
ranges
)
ranges_destroy
(
i
->
ranges
);
ranges_destroy
(
i
->
ranges
);
}
/***
...
...
@@ -2423,6 +2425,7 @@ static void ranges_clear(RANGES ranges)
static
void
ranges_destroy
(
RANGES
ranges
)
{
if
(
!
ranges
)
return
;
ranges_clear
(
ranges
);
DPA_Destroy
(
ranges
->
hdpa
);
COMCTL32_Free
(
ranges
);
...
...
@@ -2446,7 +2449,7 @@ static RANGES ranges_clone(RANGES ranges)
fail:
TRACE
(
"clone failed
\n
"
);
if
(
clone
)
ranges_destroy
(
clone
);
ranges_destroy
(
clone
);
return
NULL
;
}
...
...
@@ -7013,6 +7016,7 @@ static LRESULT LISTVIEW_Create(HWND hwnd, const CREATESTRUCTW *lpcs)
WS_CHILD
|
HDS_HORZ
|
(
DWORD
)((
LVS_NOSORTHEADER
&
lpcs
->
style
)
?
0
:
HDS_BUTTONS
),
0
,
0
,
0
,
0
,
hwnd
,
NULL
,
lpcs
->
hInstance
,
NULL
);
if
(
!
infoPtr
->
hwndHeader
)
goto
fail
;
/* set header unicode format */
SendMessageW
(
infoPtr
->
hwndHeader
,
HDM_SETUNICODEFORMAT
,
(
WPARAM
)
TRUE
,
(
LPARAM
)
NULL
);
...
...
@@ -7020,15 +7024,12 @@ static LRESULT LISTVIEW_Create(HWND hwnd, const CREATESTRUCTW *lpcs)
/* set header font */
SendMessageW
(
infoPtr
->
hwndHeader
,
WM_SETFONT
,
(
WPARAM
)
infoPtr
->
hFont
,
(
LPARAM
)
TRUE
);
/* allocate memory for the selection ranges */
if
(
!
(
infoPtr
->
selectionRanges
=
ranges_create
(
10
)))
return
-
1
;
/* allocate memory for the data structure */
/* FIXME: what if we fail? */
i
nfoPtr
->
hdpaItems
=
DPA_Create
(
10
)
;
i
nfoPtr
->
hdpaPosX
=
DPA_Create
(
10
)
;
i
nfoPtr
->
hdpaPosY
=
DPA_Create
(
10
)
;
i
nfoPtr
->
hdpaColumns
=
DPA_Create
(
10
)
;
if
(
!
(
infoPtr
->
selectionRanges
=
ranges_create
(
10
)))
goto
fail
;
i
f
(
!
(
infoPtr
->
hdpaItems
=
DPA_Create
(
10
)))
goto
fail
;
i
f
(
!
(
infoPtr
->
hdpaPosX
=
DPA_Create
(
10
)))
goto
fail
;
i
f
(
!
(
infoPtr
->
hdpaPosY
=
DPA_Create
(
10
)))
goto
fail
;
i
f
(
!
(
infoPtr
->
hdpaColumns
=
DPA_Create
(
10
)))
goto
fail
;
/* initialize the icon sizes */
set_icon_size
(
&
infoPtr
->
iconSize
,
infoPtr
->
himlNormal
,
uView
!=
LVS_ICON
);
...
...
@@ -7052,6 +7053,16 @@ static LRESULT LISTVIEW_Create(HWND hwnd, const CREATESTRUCTW *lpcs)
}
return
0
;
fail:
DestroyWindow
(
infoPtr
->
hwndHeader
);
ranges_destroy
(
infoPtr
->
selectionRanges
);
DPA_Destroy
(
infoPtr
->
hdpaItems
);
DPA_Destroy
(
infoPtr
->
hdpaPosX
);
DPA_Destroy
(
infoPtr
->
hdpaPosY
);
DPA_Destroy
(
infoPtr
->
hdpaColumns
);
COMCTL32_Free
(
infoPtr
);
return
-
1
;
}
/***
...
...
@@ -7656,7 +7667,10 @@ static LRESULT LISTVIEW_NCDestroy(LISTVIEW_INFO *infoPtr)
/* destroy data structure */
DPA_Destroy
(
infoPtr
->
hdpaItems
);
if
(
infoPtr
->
selectionRanges
)
ranges_destroy
(
infoPtr
->
selectionRanges
);
DPA_Destroy
(
infoPtr
->
hdpaPosX
);
DPA_Destroy
(
infoPtr
->
hdpaPosY
);
DPA_Destroy
(
infoPtr
->
hdpaColumns
);
ranges_destroy
(
infoPtr
->
selectionRanges
);
/* destroy image lists */
if
(
!
(
infoPtr
->
dwStyle
&
LVS_SHAREIMAGELISTS
))
...
...
@@ -8726,7 +8740,6 @@ LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
SetWindowPos
(
infoPtr
->
hwndSelf
,
0
,
0
,
0
,
0
,
0
,
SWP_FRAMECHANGED
|
SWP_NOACTIVATE
|
SWP_NOZORDER
|
SWP_NOMOVE
|
SWP_NOSIZE
);
/* FIXME: why do we need this here? */
LISTVIEW_UpdateSize
(
infoPtr
);
LISTVIEW_UpdateScroll
(
infoPtr
);
}
...
...
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