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
95c74f19
Commit
95c74f19
authored
Feb 05, 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 SetBandInfoA and SetBandInfoW.
parent
0f770967
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
79 deletions
+18
-79
rebar.c
dlls/comctl32/rebar.c
+18
-79
No files found.
dlls/comctl32/rebar.c
View file @
95c74f19
...
...
@@ -365,7 +365,7 @@ REBAR_FmtMask( UINT mask)
static
VOID
REBAR_DumpBandInfo
(
LPREBARBANDINFOA
pB
)
REBAR_DumpBandInfo
(
LPREBARBANDINFOW
pB
)
{
if
(
!
TRACE_ON
(
rebar
)
)
return
;
TRACE
(
"band info: "
);
...
...
@@ -2092,7 +2092,7 @@ REBAR_ValidateBand (REBAR_INFO *infoPtr, REBAR_BAND *lpBand)
}
static
BOOL
REBAR_CommonSetupBand
(
HWND
hwnd
,
LPREBARBANDINFOA
lprbbi
,
REBAR_BAND
*
lpBand
)
REBAR_CommonSetupBand
(
HWND
hwnd
,
LPREBARBANDINFOW
lprbbi
,
REBAR_BAND
*
lpBand
)
/* Function: This routine copies the supplied values from */
/* user input (lprbbi) to the internal band structure. */
/* It returns true if something changed and false if not. */
...
...
@@ -2831,7 +2831,7 @@ REBAR_GetBandInfoT(REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam, BOOL bUnic
lprbbi
->
cxHeader
=
lpBand
->
cxHeader
;
}
REBAR_DumpBandInfo
(
(
LPREBARBANDINFOA
)
lprbbi
);
REBAR_DumpBandInfo
(
lprbbi
);
return
TRUE
;
}
...
...
@@ -3042,7 +3042,7 @@ REBAR_InsertBandT(REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam, BOOL bUnico
/* trace the index as signed to see the -1 */
TRACE
(
"insert band at %d (bUnicode=%d)!
\n
"
,
(
INT
)
uIndex
,
bUnicode
);
REBAR_DumpBandInfo
(
(
LPREBARBANDINFOA
)
lprbbi
);
REBAR_DumpBandInfo
(
lprbbi
);
infoPtr
->
bands
=
ReAlloc
(
infoPtr
->
bands
,
(
infoPtr
->
uNumBands
+
1
)
*
sizeof
(
REBAR_BAND
));
if
(((
INT
)
uIndex
==
-
1
)
||
(
uIndex
>
infoPtr
->
uNumBands
))
...
...
@@ -3060,7 +3060,7 @@ REBAR_InsertBandT(REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam, BOOL bUnico
lpBand
->
clrBack
=
infoPtr
->
clrBk
;
lpBand
->
iImage
=
-
1
;
REBAR_CommonSetupBand
(
infoPtr
->
hwndSelf
,
(
LPREBARBANDINFOA
)
lprbbi
,
lpBand
);
REBAR_CommonSetupBand
(
infoPtr
->
hwndSelf
,
lprbbi
,
lpBand
);
if
((
lprbbi
->
fMask
&
RBBIM_TEXT
)
&&
(
lprbbi
->
lpText
))
{
if
(
bUnicode
)
Str_SetPtrW
(
&
lpBand
->
lpText
,
lprbbi
->
lpText
);
...
...
@@ -3325,9 +3325,9 @@ REBAR_strdifW( LPCWSTR a, LPCWSTR b )
}
static
LRESULT
REBAR_SetBandInfo
A
(
REBAR_INFO
*
infoPtr
,
WPARAM
wParam
,
LPARAM
lParam
)
REBAR_SetBandInfo
T
(
REBAR_INFO
*
infoPtr
,
WPARAM
wParam
,
LPARAM
lParam
,
BOOL
bUnicode
)
{
LPREBARBANDINFO
A
lprbbi
=
(
LPREBARBANDINFOA
)
lParam
;
LPREBARBANDINFO
W
lprbbi
=
(
LPREBARBANDINFOW
)
lParam
;
REBAR_BAND
*
lpBand
;
BOOL
bChanged
;
...
...
@@ -3347,29 +3347,18 @@ REBAR_SetBandInfoA (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
bChanged
=
REBAR_CommonSetupBand
(
infoPtr
->
hwndSelf
,
lprbbi
,
lpBand
);
if
(
lprbbi
->
fMask
&
RBBIM_TEXT
)
{
LPWSTR
wstr
=
NULL
;
if
(
bUnicode
)
Str_SetPtrW
(
&
wstr
,
lprbbi
->
lpText
);
else
Str_SetPtrAtoW
(
&
wstr
,
(
LPSTR
)
lprbbi
->
lpText
);
if
(
lprbbi
->
lpText
)
{
INT
len
;
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
lprbbi
->
lpText
,
-
1
,
NULL
,
0
);
if
(
len
>
1
)
wstr
=
(
LPWSTR
)
Alloc
(
len
*
sizeof
(
WCHAR
));
if
(
wstr
)
MultiByteToWideChar
(
CP_ACP
,
0
,
lprbbi
->
lpText
,
-
1
,
wstr
,
len
);
}
if
(
REBAR_strdifW
(
lpBand
->
lpText
,
wstr
))
{
if
(
lpBand
->
lpText
)
{
Free
(
lpBand
->
lpText
);
lpBand
->
lpText
=
NULL
;
}
if
(
wstr
)
{
lpBand
->
lpText
=
wstr
;
wstr
=
NULL
;
}
if
(
REBAR_strdifW
(
wstr
,
lprbbi
->
lpText
))
{
Free
(
lpBand
->
lpText
);
lpBand
->
lpText
=
wstr
;
bChanged
=
TRUE
;
}
if
(
wstr
)
Free
(
wstr
);
else
Free
(
wstr
);
}
REBAR_ValidateBand
(
infoPtr
,
lpBand
);
...
...
@@ -3384,56 +3373,6 @@ REBAR_SetBandInfoA (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
return
TRUE
;
}
static
LRESULT
REBAR_SetBandInfoW
(
REBAR_INFO
*
infoPtr
,
WPARAM
wParam
,
LPARAM
lParam
)
{
LPREBARBANDINFOW
lprbbi
=
(
LPREBARBANDINFOW
)
lParam
;
REBAR_BAND
*
lpBand
;
BOOL
bChanged
;
if
(
lprbbi
==
NULL
)
return
FALSE
;
if
(
lprbbi
->
cbSize
<
REBARBANDINFOW_V3_SIZE
)
return
FALSE
;
if
((
UINT
)
wParam
>=
infoPtr
->
uNumBands
)
return
FALSE
;
TRACE
(
"index %u
\n
"
,
(
UINT
)
wParam
);
REBAR_DumpBandInfo
((
LPREBARBANDINFOA
)
lprbbi
);
/* set band information */
lpBand
=
&
infoPtr
->
bands
[(
UINT
)
wParam
];
bChanged
=
REBAR_CommonSetupBand
(
infoPtr
->
hwndSelf
,
(
LPREBARBANDINFOA
)
lprbbi
,
lpBand
);
if
(
(
lprbbi
->
fMask
&
RBBIM_TEXT
)
&&
REBAR_strdifW
(
lpBand
->
lpText
,
lprbbi
->
lpText
)
)
{
if
(
lpBand
->
lpText
)
{
Free
(
lpBand
->
lpText
);
lpBand
->
lpText
=
NULL
;
}
if
(
lprbbi
->
lpText
)
{
INT
len
=
lstrlenW
(
lprbbi
->
lpText
);
if
(
len
>
0
)
{
lpBand
->
lpText
=
(
LPWSTR
)
Alloc
((
len
+
1
)
*
sizeof
(
WCHAR
));
strcpyW
(
lpBand
->
lpText
,
lprbbi
->
lpText
);
}
}
bChanged
=
TRUE
;
}
REBAR_ValidateBand
(
infoPtr
,
lpBand
);
REBAR_DumpBand
(
infoPtr
);
if
(
bChanged
&&
(
lprbbi
->
fMask
&
(
RBBIM_CHILDSIZE
|
RBBIM_SIZE
))
)
{
REBAR_Layout
(
infoPtr
,
NULL
,
TRUE
,
FALSE
);
InvalidateRect
(
infoPtr
->
hwndSelf
,
0
,
1
);
}
return
TRUE
;
}
static
LRESULT
REBAR_SetBarInfo
(
REBAR_INFO
*
infoPtr
,
WPARAM
wParam
,
LPARAM
lParam
)
...
...
@@ -4479,10 +4418,10 @@ REBAR_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return
REBAR_PushChevron
(
infoPtr
,
wParam
,
lParam
);
case
RB_SETBANDINFOA
:
return
REBAR_SetBandInfo
A
(
infoPtr
,
wParam
,
lParam
);
return
REBAR_SetBandInfo
T
(
infoPtr
,
wParam
,
lParam
,
FALSE
);
case
RB_SETBANDINFOW
:
return
REBAR_SetBandInfo
W
(
infoPtr
,
wParam
,
lParam
);
return
REBAR_SetBandInfo
T
(
infoPtr
,
wParam
,
lParam
,
TRUE
);
case
RB_SETBARINFO
:
return
REBAR_SetBarInfo
(
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