Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-fonts
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
Aleksandr Isakov
wine-fonts
Commits
f85ceb1b
Commit
f85ceb1b
authored
Sep 18, 2006
by
Mikołaj Zalewski
Committed by
Alexandre Julliard
Sep 20, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32: header: Merge the simple delete and complex delete.
parent
d98b9a46
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
38 deletions
+24
-38
header.c
dlls/comctl32/header.c
+24
-38
No files found.
dlls/comctl32/header.c
View file @
f85ceb1b
...
...
@@ -1060,54 +1060,40 @@ HEADER_DeleteItem (HWND hwnd, WPARAM wParam)
{
HEADER_INFO
*
infoPtr
=
HEADER_GetInfoPtr
(
hwnd
);
INT
iItem
=
(
INT
)
wParam
;
INT
iOrder
;
INT
i
;
TRACE
(
"[iItem=%d]
\n
"
,
iItem
);
if
((
iItem
<
0
)
||
(
iItem
>=
(
INT
)
infoPtr
->
uNumItem
))
return
FALSE
;
if
(
infoPtr
->
uNumItem
==
1
)
{
TRACE
(
"Simple delete!
\n
"
);
HEADER_DisposeItem
(
&
infoPtr
->
items
[
0
]);
Free
(
infoPtr
->
items
);
Free
(
infoPtr
->
order
);
infoPtr
->
items
=
0
;
infoPtr
->
order
=
0
;
infoPtr
->
uNumItem
=
0
;
}
else
{
INT
i
;
INT
iOrder
;
TRACE
(
"Complex delete! [iItem=%d]
\n
"
,
iItem
);
for
(
i
=
0
;
i
<
infoPtr
->
uNumItem
;
i
++
)
TRACE
(
"%d: order=%d, iOrder=%d, ->iOrder=%d
\n
"
,
i
,
infoPtr
->
order
[
i
],
infoPtr
->
items
[
i
].
iOrder
,
infoPtr
->
items
[
infoPtr
->
order
[
i
]].
iOrder
);
HEADER_DisposeItem
(
&
infoPtr
->
items
[
iItem
]);
iOrder
=
infoPtr
->
items
[
iItem
].
iOrder
;
infoPtr
->
uNumItem
--
;
memmove
(
&
infoPtr
->
items
[
iItem
],
&
infoPtr
->
items
[
iItem
+
1
],
(
infoPtr
->
uNumItem
-
iItem
)
*
sizeof
(
HEADER_ITEM
));
memmove
(
&
infoPtr
->
order
[
iOrder
],
&
infoPtr
->
order
[
iOrder
+
1
],
(
infoPtr
->
uNumItem
-
iOrder
)
*
sizeof
(
INT
));
infoPtr
->
items
=
ReAlloc
(
infoPtr
->
items
,
sizeof
(
HEADER_ITEM
)
*
infoPtr
->
uNumItem
);
infoPtr
->
order
=
ReAlloc
(
infoPtr
->
order
,
sizeof
(
INT
)
*
infoPtr
->
uNumItem
);
/* Correct the orders */
for
(
i
=
0
;
i
<
infoPtr
->
uNumItem
;
i
++
)
{
if
(
infoPtr
->
order
[
i
]
>
iItem
)
infoPtr
->
order
[
i
]
--
;
if
(
i
>=
iOrder
)
infoPtr
->
items
[
infoPtr
->
order
[
i
]].
iOrder
=
i
;
}
for
(
i
=
0
;
i
<
infoPtr
->
uNumItem
;
i
++
)
TRACE
(
"%d: order=%d, iOrder=%d, ->iOrder=%d
\n
"
,
i
,
infoPtr
->
order
[
i
],
infoPtr
->
items
[
i
].
iOrder
,
infoPtr
->
items
[
infoPtr
->
order
[
i
]].
iOrder
);
for
(
i
=
0
;
i
<
infoPtr
->
uNumItem
;
i
++
)
TRACE
(
"%d: order=%d, iOrder=%d, ->iOrder=%d
\n
"
,
i
,
infoPtr
->
order
[
i
],
infoPtr
->
items
[
i
].
iOrder
,
infoPtr
->
items
[
infoPtr
->
order
[
i
]].
iOrder
);
iOrder
=
infoPtr
->
items
[
iItem
].
iOrder
;
HEADER_DisposeItem
(
&
infoPtr
->
items
[
iItem
]);
infoPtr
->
uNumItem
--
;
memmove
(
&
infoPtr
->
items
[
iItem
],
&
infoPtr
->
items
[
iItem
+
1
],
(
infoPtr
->
uNumItem
-
iItem
)
*
sizeof
(
HEADER_ITEM
));
memmove
(
&
infoPtr
->
order
[
iOrder
],
&
infoPtr
->
order
[
iOrder
+
1
],
(
infoPtr
->
uNumItem
-
iOrder
)
*
sizeof
(
INT
));
infoPtr
->
items
=
ReAlloc
(
infoPtr
->
items
,
sizeof
(
HEADER_ITEM
)
*
infoPtr
->
uNumItem
);
infoPtr
->
order
=
ReAlloc
(
infoPtr
->
order
,
sizeof
(
INT
)
*
infoPtr
->
uNumItem
);
/* Correct the orders */
for
(
i
=
0
;
i
<
infoPtr
->
uNumItem
;
i
++
)
{
if
(
infoPtr
->
order
[
i
]
>
iItem
)
infoPtr
->
order
[
i
]
--
;
if
(
i
>=
iOrder
)
infoPtr
->
items
[
infoPtr
->
order
[
i
]].
iOrder
=
i
;
}
for
(
i
=
0
;
i
<
infoPtr
->
uNumItem
;
i
++
)
TRACE
(
"%d: order=%d, iOrder=%d, ->iOrder=%d
\n
"
,
i
,
infoPtr
->
order
[
i
],
infoPtr
->
items
[
i
].
iOrder
,
infoPtr
->
items
[
infoPtr
->
order
[
i
]].
iOrder
);
HEADER_SetItemBounds
(
hwnd
);
InvalidateRect
(
hwnd
,
NULL
,
FALSE
);
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