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
fc771c9f
Commit
fc771c9f
authored
Mar 30, 2011
by
David Hedberg
Committed by
Alexandre Julliard
Mar 30, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comdlg32: Implement SetFileTypes and GetFileTypeIndex/SetFileTypeIndex for the Item Dialog.
parent
f9a95150
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
59 additions
and
12 deletions
+59
-12
itemdlg.c
dlls/comdlg32/itemdlg.c
+59
-6
itemdlg.c
dlls/comdlg32/tests/itemdlg.c
+0
-6
No files found.
dlls/comdlg32/itemdlg.c
View file @
fc771c9f
...
...
@@ -28,6 +28,8 @@
#include "winbase.h"
#include "winuser.h"
#include "wingdi.h"
#include "winreg.h"
#include "shlwapi.h"
#include "commdlg.h"
#include "cdlg.h"
...
...
@@ -51,6 +53,9 @@ typedef struct FileDialogImpl {
LONG
ref
;
FILEOPENDIALOGOPTIONS
options
;
COMDLG_FILTERSPEC
*
filterspecs
;
UINT
filterspec_count
;
UINT
filetypeindex
;
}
FileDialogImpl
;
/**************************************************************************
...
...
@@ -111,7 +116,17 @@ static ULONG WINAPI IFileDialog2_fnRelease(IFileDialog2 *iface)
TRACE
(
"%p - ref %d
\n
"
,
This
,
ref
);
if
(
!
ref
)
{
UINT
i
;
for
(
i
=
0
;
i
<
This
->
filterspec_count
;
i
++
)
{
LocalFree
((
void
*
)
This
->
filterspecs
[
i
].
pszName
);
LocalFree
((
void
*
)
This
->
filterspecs
[
i
].
pszSpec
);
}
HeapFree
(
GetProcessHeap
(),
0
,
This
->
filterspecs
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
return
ref
;
}
...
...
@@ -127,22 +142,56 @@ static HRESULT WINAPI IFileDialog2_fnSetFileTypes(IFileDialog2 *iface, UINT cFil
const
COMDLG_FILTERSPEC
*
rgFilterSpec
)
{
FileDialogImpl
*
This
=
impl_from_IFileDialog2
(
iface
);
FIXME
(
"stub - %p (%d, %p)
\n
"
,
This
,
cFileTypes
,
rgFilterSpec
);
return
E_NOTIMPL
;
UINT
i
;
TRACE
(
"%p (%d, %p)
\n
"
,
This
,
cFileTypes
,
rgFilterSpec
);
if
(
This
->
filterspecs
)
return
E_UNEXPECTED
;
if
(
!
rgFilterSpec
)
return
E_INVALIDARG
;
if
(
!
cFileTypes
)
return
S_OK
;
This
->
filterspecs
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
COMDLG_FILTERSPEC
)
*
cFileTypes
);
for
(
i
=
0
;
i
<
cFileTypes
;
i
++
)
{
This
->
filterspecs
[
i
].
pszName
=
StrDupW
(
rgFilterSpec
[
i
].
pszName
);
This
->
filterspecs
[
i
].
pszSpec
=
StrDupW
(
rgFilterSpec
[
i
].
pszSpec
);
}
This
->
filterspec_count
=
cFileTypes
;
return
S_OK
;
}
static
HRESULT
WINAPI
IFileDialog2_fnSetFileTypeIndex
(
IFileDialog2
*
iface
,
UINT
iFileType
)
{
FileDialogImpl
*
This
=
impl_from_IFileDialog2
(
iface
);
FIXME
(
"stub - %p (%d)
\n
"
,
This
,
iFileType
);
return
E_NOTIMPL
;
TRACE
(
"%p (%d)
\n
"
,
This
,
iFileType
);
if
(
!
This
->
filterspecs
)
return
E_FAIL
;
if
(
iFileType
>=
This
->
filterspec_count
)
This
->
filetypeindex
=
This
->
filterspec_count
-
1
;
else
This
->
filetypeindex
=
iFileType
;
return
S_OK
;
}
static
HRESULT
WINAPI
IFileDialog2_fnGetFileTypeIndex
(
IFileDialog2
*
iface
,
UINT
*
piFileType
)
{
FileDialogImpl
*
This
=
impl_from_IFileDialog2
(
iface
);
FIXME
(
"stub - %p (%p)
\n
"
,
This
,
piFileType
);
return
E_NOTIMPL
;
TRACE
(
"%p (%p)
\n
"
,
This
,
piFileType
);
if
(
!
piFileType
)
return
E_INVALIDARG
;
*
piFileType
=
This
->
filetypeindex
;
return
S_OK
;
}
static
HRESULT
WINAPI
IFileDialog2_fnAdvise
(
IFileDialog2
*
iface
,
IFileDialogEvents
*
pfde
,
DWORD
*
pdwCookie
)
...
...
@@ -842,6 +891,10 @@ static HRESULT FileDialog_constructor(IUnknown *pUnkOuter, REFIID riid, void **p
fdimpl
->
options
=
FOS_OVERWRITEPROMPT
|
FOS_NOREADONLYRETURN
|
FOS_PATHMUSTEXIST
|
FOS_NOCHANGEDIR
;
}
fdimpl
->
filterspecs
=
NULL
;
fdimpl
->
filterspec_count
=
0
;
fdimpl
->
filetypeindex
=
0
;
hr
=
IUnknown_QueryInterface
((
IUnknown
*
)
fdimpl
,
riid
,
ppv
);
IUnknown_Release
((
IUnknown
*
)
fdimpl
);
return
hr
;
...
...
dlls/comdlg32/tests/itemdlg.c
View file @
fc771c9f
...
...
@@ -271,8 +271,6 @@ static void test_basics(void)
}
/* GetFileTypeIndex */
todo_wine
{
hr
=
IFileOpenDialog_GetFileTypeIndex
(
pfod
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x.
\n
"
,
hr
);
filetype
=
0x12345
;
...
...
@@ -285,11 +283,8 @@ static void test_basics(void)
hr
=
IFileSaveDialog_GetFileTypeIndex
(
pfsd
,
&
filetype
);
ok
(
hr
==
S_OK
,
"got 0x%08x.
\n
"
,
hr
);
ok
(
filetype
==
0
,
"got %d.
\n
"
,
filetype
);
}
/* SetFileTypes / SetFileTypeIndex */
todo_wine
{
hr
=
IFileOpenDialog_SetFileTypes
(
pfod
,
0
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x.
\n
"
,
hr
);
hr
=
IFileOpenDialog_SetFileTypes
(
pfod
,
0
,
filterspec
);
...
...
@@ -330,7 +325,6 @@ static void test_basics(void)
ok
(
hr
==
E_UNEXPECTED
,
"got 0x%08x.
\n
"
,
hr
);
hr
=
IFileSaveDialog_SetFileTypes
(
pfsd
,
1
,
&
filterspec
[
1
]);
ok
(
hr
==
E_UNEXPECTED
,
"got 0x%08x.
\n
"
,
hr
);
}
/* SetFilter */
todo_wine
...
...
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