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
86a993ea
Commit
86a993ea
authored
Jul 06, 2016
by
Lauri Kenttä
Committed by
Alexandre Julliard
Jul 08, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comdlg32: Init clipboard format only once in filedlg.
Signed-off-by:
Lauri Kenttä
<
lauri.kentta@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
b6bb4c1b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
17 deletions
+21
-17
filedlg.c
dlls/comdlg32/filedlg.c
+21
-17
No files found.
dlls/comdlg32/filedlg.c
View file @
86a993ea
...
...
@@ -3620,6 +3620,25 @@ static void FILEDLG95_LOOKIN_Clean(HWND hwnd)
}
/***********************************************************************
* get_def_format
*
* Fill the FORMATETC used in the shell id list
*/
static
FORMATETC
get_def_format
(
void
)
{
static
CLIPFORMAT
cfFormat
;
FORMATETC
formatetc
;
if
(
!
cfFormat
)
cfFormat
=
RegisterClipboardFormatA
(
CFSTR_SHELLIDLISTA
);
formatetc
.
cfFormat
=
cfFormat
;
formatetc
.
ptd
=
0
;
formatetc
.
dwAspect
=
DVASPECT_CONTENT
;
formatetc
.
lindex
=
-
1
;
formatetc
.
tymed
=
TYMED_HGLOBAL
;
return
formatetc
;
}
/***********************************************************************
* FILEDLG95_FILENAME_FillFromSelection
*
* fills the edit box from the cached DataObject
...
...
@@ -3766,15 +3785,6 @@ static int FILEDLG95_FILENAME_GetFileNames (HWND hwnd, LPWSTR * lpstrFileList, U
return
nFileCount
;
}
#define SETDefFormatEtc(fe,cf,med) \
{ \
(fe).cfFormat = cf;\
(fe).dwAspect = DVASPECT_CONTENT; \
(fe).ptd =NULL;\
(fe).tymed = med;\
(fe).lindex = -1;\
};
/*
* DATAOBJECT Helper functions
*/
...
...
@@ -3808,16 +3818,13 @@ LPITEMIDLIST GetPidlFromDataObject ( IDataObject *doSelected, UINT nPidlIndex)
{
STGMEDIUM
medium
;
FORMATETC
formatetc
;
FORMATETC
formatetc
=
get_def_format
()
;
LPITEMIDLIST
pidl
=
NULL
;
TRACE
(
"sv=%p index=%u
\n
"
,
doSelected
,
nPidlIndex
);
if
(
!
doSelected
)
return
NULL
;
/* Set the FORMATETC structure*/
SETDefFormatEtc
(
formatetc
,
RegisterClipboardFormatA
(
CFSTR_SHELLIDLISTA
),
TYMED_HGLOBAL
);
/* Get the pidls from IDataObject */
if
(
SUCCEEDED
(
IDataObject_GetData
(
doSelected
,
&
formatetc
,
&
medium
)))
...
...
@@ -3842,15 +3849,12 @@ static UINT GetNumSelected( IDataObject *doSelected )
{
UINT
retVal
=
0
;
STGMEDIUM
medium
;
FORMATETC
formatetc
;
FORMATETC
formatetc
=
get_def_format
()
;
TRACE
(
"sv=%p
\n
"
,
doSelected
);
if
(
!
doSelected
)
return
0
;
/* Set the FORMATETC structure*/
SETDefFormatEtc
(
formatetc
,
RegisterClipboardFormatA
(
CFSTR_SHELLIDLISTA
),
TYMED_HGLOBAL
);
/* Get the pidls from IDataObject */
if
(
SUCCEEDED
(
IDataObject_GetData
(
doSelected
,
&
formatetc
,
&
medium
)))
{
...
...
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