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
d8d5196d
Commit
d8d5196d
authored
Feb 04, 2007
by
Mikołaj Zalewski
Committed by
Alexandre Julliard
Feb 05, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32: rebar: Merge InsertBandA and InsertBandW.
parent
8909419b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
126 deletions
+20
-126
rebar.c
dlls/comctl32/rebar.c
+20
-126
No files found.
dlls/comctl32/rebar.c
View file @
d8d5196d
...
...
@@ -3117,9 +3117,9 @@ REBAR_IdToIndex (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
static
LRESULT
REBAR_InsertBand
A
(
REBAR_INFO
*
infoPtr
,
WPARAM
wParam
,
LPARAM
lParam
)
REBAR_InsertBand
T
(
REBAR_INFO
*
infoPtr
,
WPARAM
wParam
,
LPARAM
lParam
,
BOOL
bUnicode
)
{
LPREBARBANDINFO
A
lprbbi
=
(
LPREBARBANDINFOA
)
lParam
;
LPREBARBANDINFO
W
lprbbi
=
(
LPREBARBANDINFOW
)
lParam
;
UINT
uIndex
=
(
UINT
)
wParam
;
REBAR_BAND
*
lpBand
;
...
...
@@ -3131,56 +3131,31 @@ REBAR_InsertBandA (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
return
FALSE
;
/* trace the index as signed to see the -1 */
TRACE
(
"insert band at %d!
\n
"
,
(
INT
)
uIndex
);
REBAR_DumpBandInfo
(
lprbbi
);
if
(
infoPtr
->
uNumBands
==
0
)
{
infoPtr
->
bands
=
(
REBAR_BAND
*
)
Alloc
(
sizeof
(
REBAR_BAND
));
uIndex
=
0
;
}
else
{
REBAR_BAND
*
oldBands
=
infoPtr
->
bands
;
infoPtr
->
bands
=
(
REBAR_BAND
*
)
Alloc
((
infoPtr
->
uNumBands
+
1
)
*
sizeof
(
REBAR_BAND
));
if
(((
INT
)
uIndex
==
-
1
)
||
(
uIndex
>
infoPtr
->
uNumBands
))
uIndex
=
infoPtr
->
uNumBands
;
/* pre insert copy */
if
(
uIndex
>
0
)
{
memcpy
(
&
infoPtr
->
bands
[
0
],
&
oldBands
[
0
],
uIndex
*
sizeof
(
REBAR_BAND
));
}
/* post copy */
if
(
uIndex
<
infoPtr
->
uNumBands
)
{
memcpy
(
&
infoPtr
->
bands
[
uIndex
+
1
],
&
oldBands
[
uIndex
],
(
infoPtr
->
uNumBands
-
uIndex
)
*
sizeof
(
REBAR_BAND
));
}
Free
(
oldBands
);
}
TRACE
(
"insert band at %d (bUnicode=%d)!
\n
"
,
(
INT
)
uIndex
,
bUnicode
);
REBAR_DumpBandInfo
((
LPREBARBANDINFOA
)
lprbbi
);
infoPtr
->
bands
=
ReAlloc
(
infoPtr
->
bands
,
(
infoPtr
->
uNumBands
+
1
)
*
sizeof
(
REBAR_BAND
));
if
(((
INT
)
uIndex
==
-
1
)
||
(
uIndex
>
infoPtr
->
uNumBands
))
uIndex
=
infoPtr
->
uNumBands
;
memmove
(
&
infoPtr
->
bands
[
uIndex
+
1
],
&
infoPtr
->
bands
[
uIndex
],
sizeof
(
REBAR_BAND
)
*
(
infoPtr
->
uNumBands
-
uIndex
));
infoPtr
->
uNumBands
++
;
TRACE
(
"index %u!
\n
"
,
uIndex
);
/* initialize band (infoPtr->bands[uIndex])*/
lpBand
=
&
infoPtr
->
bands
[
uIndex
];
lpBand
->
fMask
=
0
;
lpBand
->
fStatus
=
0
;
ZeroMemory
(
lpBand
,
sizeof
(
*
lpBand
));
lpBand
->
clrFore
=
infoPtr
->
clrText
;
lpBand
->
clrBack
=
infoPtr
->
clrBk
;
lpBand
->
hwndChild
=
0
;
lpBand
->
hwndPrevParent
=
0
;
lpBand
->
iImage
=
-
1
;
REBAR_CommonSetupBand
(
infoPtr
->
hwndSelf
,
lprbbi
,
lpBand
);
lpBand
->
lpText
=
NULL
;
REBAR_CommonSetupBand
(
infoPtr
->
hwndSelf
,
(
LPREBARBANDINFOA
)
lprbbi
,
lpBand
);
if
((
lprbbi
->
fMask
&
RBBIM_TEXT
)
&&
(
lprbbi
->
lpText
))
{
INT
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
lprbbi
->
lpText
,
-
1
,
NULL
,
0
);
if
(
len
>
1
)
{
lpBand
->
lpText
=
(
LPWSTR
)
Alloc
(
len
*
sizeof
(
WCHAR
));
MultiByteToWideChar
(
CP_ACP
,
0
,
lprbbi
->
lpText
,
-
1
,
lpBand
->
lpText
,
len
);
}
if
(
bUnicode
)
Str_SetPtrW
(
&
lpBand
->
lpText
,
lprbbi
->
lpText
);
else
Str_SetPtrAtoW
(
&
lpBand
->
lpText
,
(
LPSTR
)
lprbbi
->
lpText
);
}
REBAR_ValidateBand
(
infoPtr
,
lpBand
);
...
...
@@ -3191,88 +3166,7 @@ REBAR_InsertBandA (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
REBAR_DumpBand
(
infoPtr
);
REBAR_Layout
(
infoPtr
,
NULL
,
TRUE
,
FALSE
);
InvalidateRect
(
infoPtr
->
hwndSelf
,
0
,
1
);
return
TRUE
;
}
static
LRESULT
REBAR_InsertBandW
(
REBAR_INFO
*
infoPtr
,
WPARAM
wParam
,
LPARAM
lParam
)
{
LPREBARBANDINFOW
lprbbi
=
(
LPREBARBANDINFOW
)
lParam
;
UINT
uIndex
=
(
UINT
)
wParam
;
REBAR_BAND
*
lpBand
;
if
(
infoPtr
==
NULL
)
return
FALSE
;
if
(
lprbbi
==
NULL
)
return
FALSE
;
if
(
lprbbi
->
cbSize
<
REBARBANDINFOW_V3_SIZE
)
return
FALSE
;
/* trace the index as signed to see the -1 */
TRACE
(
"insert band at %d!
\n
"
,
(
INT
)
uIndex
);
REBAR_DumpBandInfo
((
LPREBARBANDINFOA
)
lprbbi
);
if
(
infoPtr
->
uNumBands
==
0
)
{
infoPtr
->
bands
=
(
REBAR_BAND
*
)
Alloc
(
sizeof
(
REBAR_BAND
));
uIndex
=
0
;
}
else
{
REBAR_BAND
*
oldBands
=
infoPtr
->
bands
;
infoPtr
->
bands
=
(
REBAR_BAND
*
)
Alloc
((
infoPtr
->
uNumBands
+
1
)
*
sizeof
(
REBAR_BAND
));
if
(((
INT
)
uIndex
==
-
1
)
||
(
uIndex
>
infoPtr
->
uNumBands
))
uIndex
=
infoPtr
->
uNumBands
;
/* pre insert copy */
if
(
uIndex
>
0
)
{
memcpy
(
&
infoPtr
->
bands
[
0
],
&
oldBands
[
0
],
uIndex
*
sizeof
(
REBAR_BAND
));
}
/* post copy */
if
(
uIndex
<=
infoPtr
->
uNumBands
-
1
)
{
memcpy
(
&
infoPtr
->
bands
[
uIndex
+
1
],
&
oldBands
[
uIndex
],
(
infoPtr
->
uNumBands
-
uIndex
)
*
sizeof
(
REBAR_BAND
));
}
Free
(
oldBands
);
}
infoPtr
->
uNumBands
++
;
TRACE
(
"index %u!
\n
"
,
uIndex
);
/* initialize band (infoPtr->bands[uIndex])*/
lpBand
=
&
infoPtr
->
bands
[
uIndex
];
lpBand
->
fMask
=
0
;
lpBand
->
fStatus
=
0
;
lpBand
->
clrFore
=
infoPtr
->
clrText
;
lpBand
->
clrBack
=
infoPtr
->
clrBk
;
lpBand
->
hwndChild
=
0
;
lpBand
->
hwndPrevParent
=
0
;
REBAR_CommonSetupBand
(
infoPtr
->
hwndSelf
,
(
LPREBARBANDINFOA
)
lprbbi
,
lpBand
);
lpBand
->
lpText
=
NULL
;
if
((
lprbbi
->
fMask
&
RBBIM_TEXT
)
&&
(
lprbbi
->
lpText
))
{
INT
len
=
lstrlenW
(
lprbbi
->
lpText
);
if
(
len
>
0
)
{
lpBand
->
lpText
=
(
LPWSTR
)
Alloc
((
len
+
1
)
*
sizeof
(
WCHAR
));
strcpyW
(
lpBand
->
lpText
,
lprbbi
->
lpText
);
}
}
REBAR_ValidateBand
(
infoPtr
,
lpBand
);
/* On insert of second band, revalidate band 1 to possible add gripper */
if
(
infoPtr
->
uNumBands
==
2
)
REBAR_ValidateBand
(
infoPtr
,
&
infoPtr
->
bands
[
uIndex
?
0
:
1
]);
REBAR_DumpBand
(
infoPtr
);
REBAR_Layout
(
infoPtr
,
NULL
,
TRUE
,
FALSE
);
InvalidateRect
(
infoPtr
->
hwndSelf
,
0
,
1
);
InvalidateRect
(
infoPtr
->
hwndSelf
,
0
,
TRUE
);
return
TRUE
;
}
...
...
@@ -4657,10 +4551,10 @@ REBAR_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return
REBAR_IdToIndex
(
infoPtr
,
wParam
,
lParam
);
case
RB_INSERTBANDA
:
return
REBAR_InsertBand
A
(
infoPtr
,
wParam
,
lParam
);
return
REBAR_InsertBand
T
(
infoPtr
,
wParam
,
lParam
,
FALSE
);
case
RB_INSERTBANDW
:
return
REBAR_InsertBand
W
(
infoPtr
,
wParam
,
lParam
);
return
REBAR_InsertBand
T
(
infoPtr
,
wParam
,
lParam
,
TRUE
);
case
RB_MAXIMIZEBAND
:
return
REBAR_MaximizeBand
(
infoPtr
,
wParam
,
lParam
);
...
...
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