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
905b598b
Commit
905b598b
authored
Oct 18, 2006
by
Huw Davies
Committed by
Alexandre Julliard
Oct 20, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oledlg: Initialize the paste list.
parent
284f07e4
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
72 additions
and
0 deletions
+72
-0
pastespl.c
dlls/oledlg/pastespl.c
+72
-0
No files found.
dlls/oledlg/pastespl.c
View file @
905b598b
...
...
@@ -19,6 +19,8 @@
*/
#define COM_NO_WINDOWS_H
#define COBJMACROS
#include <stdarg.h>
#include "windef.h"
...
...
@@ -116,6 +118,74 @@ static inline WCHAR *strdupAtoW(const char *str)
return
ret
;
}
static
BOOL
add_entry_to_lb
(
HWND
hdlg
,
UINT
id
,
OLEUIPASTEENTRYW
*
pe
)
{
HWND
hwnd
=
GetDlgItem
(
hdlg
,
id
);
BOOL
ret
=
FALSE
;
/* FIXME %s handling */
/* Note that this suffers from the same bug as native, in that if a new string
is a substring of an already added string, then the FINDSTRING will succeed
this is probably not what we want */
if
(
SendMessageW
(
hwnd
,
LB_FINDSTRING
,
0
,
(
LPARAM
)
pe
->
lpstrFormatName
)
==
-
1
)
{
LRESULT
pos
=
SendMessageW
(
hwnd
,
LB_ADDSTRING
,
0
,
(
LPARAM
)
pe
->
lpstrFormatName
);
SendMessageW
(
hwnd
,
LB_SETITEMDATA
,
pos
,
(
LPARAM
)
pe
);
ret
=
TRUE
;
}
return
ret
;
}
static
DWORD
init_pastelist
(
HWND
hdlg
,
OLEUIPASTESPECIALW
*
ps
)
{
IEnumFORMATETC
*
penum
;
HRESULT
hr
;
FORMATETC
fmts
[
20
];
DWORD
fetched
,
items_added
=
0
;
hr
=
IDataObject_EnumFormatEtc
(
ps
->
lpSrcDataObj
,
DATADIR_GET
,
&
penum
);
if
(
FAILED
(
hr
))
{
WARN
(
"Unable to create IEnumFORMATETC
\n
"
);
return
0
;
}
/* The native version grabs only the first 20 fmts and we do the same */
hr
=
IEnumFORMATETC_Next
(
penum
,
sizeof
(
fmts
)
/
sizeof
(
fmts
[
0
]),
fmts
,
&
fetched
);
TRACE
(
"got %d formats hr %08x
\n
"
,
fetched
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
DWORD
src_fmt
,
req_fmt
;
for
(
req_fmt
=
0
;
req_fmt
<
ps
->
cPasteEntries
;
req_fmt
++
)
{
/* This is used by update_struct() to set nSelectedIndex on exit */
ps
->
arrPasteEntries
[
req_fmt
].
dwScratchSpace
=
req_fmt
;
TRACE
(
"req_fmt %x
\n
"
,
ps
->
arrPasteEntries
[
req_fmt
].
fmtetc
.
cfFormat
);
for
(
src_fmt
=
0
;
src_fmt
<
fetched
;
src_fmt
++
)
{
TRACE
(
"
\t
enum'ed fmt %x
\n
"
,
fmts
[
src_fmt
].
cfFormat
);
if
(
ps
->
arrPasteEntries
[
req_fmt
].
fmtetc
.
cfFormat
==
fmts
[
src_fmt
].
cfFormat
)
{
add_entry_to_lb
(
hdlg
,
IDC_PS_PASTELIST
,
ps
->
arrPasteEntries
+
req_fmt
);
items_added
++
;
break
;
}
}
}
}
IEnumFORMATETC_Release
(
penum
);
EnableWindow
(
GetDlgItem
(
hdlg
,
IDC_PS_PASTE
),
items_added
?
TRUE
:
FALSE
);
return
items_added
;
}
static
void
init_lists
(
HWND
hdlg
,
ps_struct_t
*
ps_struct
)
{
init_pastelist
(
hdlg
,
ps_struct
->
ps
);
}
static
void
update_structure
(
HWND
hdlg
,
ps_struct_t
*
ps_struct
)
{
ps_struct
->
ps
->
dwFlags
=
ps_struct
->
flags
;
...
...
@@ -157,6 +227,8 @@ static INT_PTR CALLBACK ps_dlg_proc(HWND hdlg, UINT msg, WPARAM wp, LPARAM lp)
if
(
ps_struct
->
ps
->
lpszCaption
)
SetWindowTextW
(
hdlg
,
ps_struct
->
ps
->
lpszCaption
);
init_lists
(
hdlg
,
ps_struct
);
return
TRUE
;
/* use default focus */
}
case
WM_COMMAND
:
...
...
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