mirror of
https://github.com/reactos/reactos.git
synced 2024-12-30 19:14:31 +00:00
Sync to Wine-20050830:
Michael Jung <mjung@iss.tu-darmstadt.de> - Check the GetPidlFromDataObject's doSelected parameter before calling a method on it. Alexandre Julliard <julliard@winehq.org> - Replace the _ICOM_THIS_From macros by inline functions the way it's already done in shelllink.c. Vincent Béron <vberon@mecano.gme.usherb.ca> - Uniformize DllMain TRACEing across dlls. Vitaly Lipatov <lav@etersoft.ru> - Restore paper orientation when pagesetupdlg is initializing. Troy Rollo <wine@troy.rollo.name> - Browse to the directory if a directory name is typed into the edit box of a file dialog and the confirmation button (or Enter key) is hit. Return any file name in the edit box if OFN_NOVALIDATE is set and OFN_FILEMUSTEXIST is not, even if that file name includes a path name or is the name of a folder. svn path=/trunk/; revision=17666
This commit is contained in:
parent
ce7e038415
commit
851ebece4a
6 changed files with 123 additions and 103 deletions
|
@ -73,7 +73,7 @@ static const char * GPA_string = "Failed to get entry point %s for hinst = 0x%08
|
||||||
|
|
||||||
BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD Reason, LPVOID Reserved)
|
BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD Reason, LPVOID Reserved)
|
||||||
{
|
{
|
||||||
TRACE("(%p, %08lx, %p)\n", hInstance, Reason, Reserved);
|
TRACE("(%p, %ld, %p)\n", hInstance, Reason, Reserved);
|
||||||
|
|
||||||
switch(Reason)
|
switch(Reason)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1711,8 +1711,9 @@ BOOL FILEDLG95_OnOpenMultipleFiles(HWND hwnd, LPWSTR lpstrFileList, UINT nFileCo
|
||||||
*
|
*
|
||||||
* If the function succeeds, the return value is nonzero.
|
* If the function succeeds, the return value is nonzero.
|
||||||
*/
|
*/
|
||||||
#define ONOPEN_OPEN 1
|
#define ONOPEN_BROWSE 1
|
||||||
#define ONOPEN_SEARCH 2
|
#define ONOPEN_OPEN 2
|
||||||
|
#define ONOPEN_SEARCH 3
|
||||||
static void FILEDLG95_OnOpenMessage(HWND hwnd, int idCaption, int idText)
|
static void FILEDLG95_OnOpenMessage(HWND hwnd, int idCaption, int idText)
|
||||||
{
|
{
|
||||||
WCHAR strMsgTitle[MAX_PATH];
|
WCHAR strMsgTitle[MAX_PATH];
|
||||||
|
@ -1739,15 +1740,15 @@ BOOL FILEDLG95_OnOpen(HWND hwnd)
|
||||||
|
|
||||||
TRACE("hwnd=%p\n", hwnd);
|
TRACE("hwnd=%p\n", hwnd);
|
||||||
|
|
||||||
if(BrowseSelectedFolder(hwnd))
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
/* get the files from the edit control */
|
/* get the files from the edit control */
|
||||||
nFileCount = FILEDLG95_FILENAME_GetFileNames(hwnd, &lpstrFileList, &sizeUsed, '\0');
|
nFileCount = FILEDLG95_FILENAME_GetFileNames(hwnd, &lpstrFileList, &sizeUsed, '\0');
|
||||||
|
|
||||||
/* try if the user selected a folder in the shellview */
|
/* try if the user selected a folder in the shellview */
|
||||||
if(nFileCount == 0)
|
if(nFileCount == 0)
|
||||||
|
{
|
||||||
|
BrowseSelectedFolder(hwnd);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
if(nFileCount > 1)
|
if(nFileCount > 1)
|
||||||
{
|
{
|
||||||
|
@ -1808,7 +1809,12 @@ BOOL FILEDLG95_OnOpen(HWND hwnd)
|
||||||
lpstrPathAndFile: cleaned up path
|
lpstrPathAndFile: cleaned up path
|
||||||
*/
|
*/
|
||||||
|
|
||||||
nOpenAction = ONOPEN_OPEN;
|
if (nFileCount &&
|
||||||
|
(fodInfos->ofnInfos->Flags & OFN_NOVALIDATE) &&
|
||||||
|
!(fodInfos->ofnInfos->Flags & OFN_FILEMUSTEXIST))
|
||||||
|
nOpenAction = ONOPEN_OPEN;
|
||||||
|
else
|
||||||
|
nOpenAction = ONOPEN_BROWSE;
|
||||||
|
|
||||||
/* don't apply any checks with OFN_NOVALIDATE */
|
/* don't apply any checks with OFN_NOVALIDATE */
|
||||||
{
|
{
|
||||||
|
@ -1842,7 +1848,8 @@ BOOL FILEDLG95_OnOpen(HWND hwnd)
|
||||||
*p = 0;
|
*p = 0;
|
||||||
lpszTemp = lpszTemp + strlenW(lpwstrTemp);
|
lpszTemp = lpszTemp + strlenW(lpwstrTemp);
|
||||||
|
|
||||||
if(*lpszTemp==0)
|
/* There are no wildcards when OFN_NOVALIDATE is set */
|
||||||
|
if(*lpszTemp==0 && !(fodInfos->ofnInfos->Flags & OFN_NOVALIDATE))
|
||||||
{
|
{
|
||||||
static const WCHAR wszWild[] = { '*', '?', 0 };
|
static const WCHAR wszWild[] = { '*', '?', 0 };
|
||||||
/* if the last element is a wildcard do a search */
|
/* if the last element is a wildcard do a search */
|
||||||
|
@ -1941,7 +1948,6 @@ BOOL FILEDLG95_OnOpen(HWND hwnd)
|
||||||
int iPos;
|
int iPos;
|
||||||
LPWSTR lpszTemp = PathFindFileNameW(lpstrPathAndFile);
|
LPWSTR lpszTemp = PathFindFileNameW(lpstrPathAndFile);
|
||||||
DWORD len;
|
DWORD len;
|
||||||
IPersistFolder2 * ppf2;
|
|
||||||
|
|
||||||
/* replace the current filter */
|
/* replace the current filter */
|
||||||
if(fodInfos->ShellInfos.lpstrCurrentFilter)
|
if(fodInfos->ShellInfos.lpstrCurrentFilter)
|
||||||
|
@ -1953,7 +1959,12 @@ BOOL FILEDLG95_OnOpen(HWND hwnd)
|
||||||
/* set the filter cb to the extension when possible */
|
/* set the filter cb to the extension when possible */
|
||||||
if(-1 < (iPos = FILEDLG95_FILETYPE_SearchExt(fodInfos->DlgInfos.hwndFileTypeCB, lpszTemp)))
|
if(-1 < (iPos = FILEDLG95_FILETYPE_SearchExt(fodInfos->DlgInfos.hwndFileTypeCB, lpszTemp)))
|
||||||
CBSetCurSel(fodInfos->DlgInfos.hwndFileTypeCB, iPos);
|
CBSetCurSel(fodInfos->DlgInfos.hwndFileTypeCB, iPos);
|
||||||
|
}
|
||||||
|
/* fall through */
|
||||||
|
case ONOPEN_BROWSE: /* browse to the highest folder we could bind to */
|
||||||
|
TRACE("ONOPEN_BROWSE\n");
|
||||||
|
{
|
||||||
|
IPersistFolder2 * ppf2;
|
||||||
if(SUCCEEDED(IShellFolder_QueryInterface( lpsf, &IID_IPersistFolder2, (LPVOID*)&ppf2)))
|
if(SUCCEEDED(IShellFolder_QueryInterface( lpsf, &IID_IPersistFolder2, (LPVOID*)&ppf2)))
|
||||||
{
|
{
|
||||||
LPITEMIDLIST pidlCurrent;
|
LPITEMIDLIST pidlCurrent;
|
||||||
|
@ -1963,11 +1974,10 @@ BOOL FILEDLG95_OnOpen(HWND hwnd)
|
||||||
{
|
{
|
||||||
IShellBrowser_BrowseObject(fodInfos->Shell.FOIShellBrowser, pidlCurrent, SBSP_ABSOLUTE);
|
IShellBrowser_BrowseObject(fodInfos->Shell.FOIShellBrowser, pidlCurrent, SBSP_ABSOLUTE);
|
||||||
}
|
}
|
||||||
else
|
else if( nOpenAction == ONOPEN_SEARCH )
|
||||||
{
|
{
|
||||||
IShellView_Refresh(fodInfos->Shell.FOIShellView);
|
IShellView_Refresh(fodInfos->Shell.FOIShellView);
|
||||||
}
|
}
|
||||||
SendCustomDlgNotificationMessage(hwnd, CDN_FOLDERCHANGE);
|
|
||||||
COMDLG32_SHFree(pidlCurrent);
|
COMDLG32_SHFree(pidlCurrent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1985,51 +1995,48 @@ BOOL FILEDLG95_OnOpen(HWND hwnd)
|
||||||
fodInfos->ofnInfos->Flags &= ~OFN_READONLY;
|
fodInfos->ofnInfos->Flags &= ~OFN_READONLY;
|
||||||
|
|
||||||
/* Attach the file extension with file name*/
|
/* Attach the file extension with file name*/
|
||||||
|
ext = PathFindExtensionW(lpstrPathAndFile);
|
||||||
if(!PathIsDirectoryW(lpstrPathAndFile))
|
if (! *ext)
|
||||||
{
|
{
|
||||||
if((ext = PathFindExtensionW(lpstrPathAndFile)) == NULL)
|
/* if no extension is specified with file name, then */
|
||||||
{
|
/* attach the extension from file filter or default one */
|
||||||
/* if no extension is specified with file name, then */
|
|
||||||
/* attach the extension from file filter or default one */
|
|
||||||
|
|
||||||
WCHAR *filterExt = NULL;
|
WCHAR *filterExt = NULL;
|
||||||
LPWSTR lpstrFilter = NULL;
|
LPWSTR lpstrFilter = NULL;
|
||||||
static const WCHAR szwDot[] = {'.',0};
|
static const WCHAR szwDot[] = {'.',0};
|
||||||
int PathLength = strlenW(lpstrPathAndFile);
|
int PathLength = strlenW(lpstrPathAndFile);
|
||||||
|
|
||||||
/* Attach the dot*/
|
/* Attach the dot*/
|
||||||
strcatW(lpstrPathAndFile, szwDot);
|
strcatW(lpstrPathAndFile, szwDot);
|
||||||
|
|
||||||
/*Get the file extension from file type filter*/
|
/*Get the file extension from file type filter*/
|
||||||
lpstrFilter = (LPWSTR) CBGetItemDataPtr(fodInfos->DlgInfos.hwndFileTypeCB,
|
lpstrFilter = (LPWSTR) CBGetItemDataPtr(fodInfos->DlgInfos.hwndFileTypeCB,
|
||||||
fodInfos->ofnInfos->nFilterIndex-1);
|
fodInfos->ofnInfos->nFilterIndex-1);
|
||||||
|
|
||||||
if (lpstrFilter != (LPWSTR)CB_ERR) /* control is not empty */
|
if (lpstrFilter != (LPWSTR)CB_ERR) /* control is not empty */
|
||||||
filterExt = PathFindExtensionW(lpstrFilter);
|
filterExt = PathFindExtensionW(lpstrFilter);
|
||||||
|
|
||||||
if ( filterExt && *filterExt ) /* attach the file extension from file type filter*/
|
if ( filterExt && *filterExt ) /* attach the file extension from file type filter*/
|
||||||
strcatW(lpstrPathAndFile, filterExt + 1);
|
strcatW(lpstrPathAndFile, filterExt + 1);
|
||||||
else if ( fodInfos->defext ) /* attach the default file extension*/
|
else if ( fodInfos->defext ) /* attach the default file extension*/
|
||||||
strcatW(lpstrPathAndFile, fodInfos->defext);
|
strcatW(lpstrPathAndFile, fodInfos->defext);
|
||||||
|
|
||||||
/* In Open dialog: if file does not exist try without extension */
|
/* In Open dialog: if file does not exist try without extension */
|
||||||
if (!(fodInfos->DlgInfos.dwDlgProp & FODPROP_SAVEDLG) && !PathFileExistsW(lpstrPathAndFile))
|
if (!(fodInfos->DlgInfos.dwDlgProp & FODPROP_SAVEDLG) && !PathFileExistsW(lpstrPathAndFile))
|
||||||
lpstrPathAndFile[PathLength] = '\0';
|
lpstrPathAndFile[PathLength] = '\0';
|
||||||
}
|
|
||||||
|
|
||||||
if (fodInfos->defext) /* add default extension */
|
|
||||||
{
|
|
||||||
/* Set/clear the output OFN_EXTENSIONDIFFERENT flag */
|
|
||||||
if (*ext)
|
|
||||||
ext++;
|
|
||||||
if (!lstrcmpiW(fodInfos->defext, ext))
|
|
||||||
fodInfos->ofnInfos->Flags &= ~OFN_EXTENSIONDIFFERENT;
|
|
||||||
else
|
|
||||||
fodInfos->ofnInfos->Flags |= OFN_EXTENSIONDIFFERENT;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (fodInfos->defext) /* add default extension */
|
||||||
|
{
|
||||||
|
/* Set/clear the output OFN_EXTENSIONDIFFERENT flag */
|
||||||
|
if (*ext)
|
||||||
|
ext++;
|
||||||
|
if (!lstrcmpiW(fodInfos->defext, ext))
|
||||||
|
fodInfos->ofnInfos->Flags &= ~OFN_EXTENSIONDIFFERENT;
|
||||||
|
else
|
||||||
|
fodInfos->ofnInfos->Flags |= OFN_EXTENSIONDIFFERENT;
|
||||||
|
}
|
||||||
|
|
||||||
/* In Save dialog: check if the file already exists */
|
/* In Save dialog: check if the file already exists */
|
||||||
if (fodInfos->DlgInfos.dwDlgProp & FODPROP_SAVEDLG
|
if (fodInfos->DlgInfos.dwDlgProp & FODPROP_SAVEDLG
|
||||||
&& fodInfos->ofnInfos->Flags & OFN_OVERWRITEPROMPT
|
&& fodInfos->ofnInfos->Flags & OFN_OVERWRITEPROMPT
|
||||||
|
@ -3201,6 +3208,9 @@ LPITEMIDLIST GetPidlFromDataObject ( IDataObject *doSelected, UINT nPidlIndex)
|
||||||
|
|
||||||
TRACE("sv=%p index=%u\n", doSelected, nPidlIndex);
|
TRACE("sv=%p index=%u\n", doSelected, nPidlIndex);
|
||||||
|
|
||||||
|
if (!doSelected)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
/* Set the FORMATETC structure*/
|
/* Set the FORMATETC structure*/
|
||||||
SETDefFormatEtc(formatetc, RegisterClipboardFormatA(CFSTR_SHELLIDLIST), TYMED_HGLOBAL);
|
SETDefFormatEtc(formatetc, RegisterClipboardFormatA(CFSTR_SHELLIDLIST), TYMED_HGLOBAL);
|
||||||
|
|
||||||
|
|
|
@ -55,6 +55,16 @@ typedef struct
|
||||||
|
|
||||||
} IShellBrowserImpl;
|
} IShellBrowserImpl;
|
||||||
|
|
||||||
|
static inline IShellBrowserImpl *impl_from_ICommDlgBrowser( ICommDlgBrowser *iface )
|
||||||
|
{
|
||||||
|
return (IShellBrowserImpl *)((char*)iface - FIELD_OFFSET(IShellBrowserImpl, lpVtblCommDlgBrowser));
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline IShellBrowserImpl *impl_from_IServiceProvider( IServiceProvider *iface )
|
||||||
|
{
|
||||||
|
return (IShellBrowserImpl *)((char*)iface - FIELD_OFFSET(IShellBrowserImpl, lpVtblServiceProvider));
|
||||||
|
}
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* vtable
|
* vtable
|
||||||
*/
|
*/
|
||||||
|
@ -728,11 +738,11 @@ static HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_QueryInterface(
|
||||||
REFIID riid,
|
REFIID riid,
|
||||||
LPVOID *ppvObj)
|
LPVOID *ppvObj)
|
||||||
{
|
{
|
||||||
_ICOM_THIS_FromICommDlgBrowser(IShellBrowser,iface);
|
IShellBrowserImpl *This = impl_from_ICommDlgBrowser(iface);
|
||||||
|
|
||||||
TRACE("(%p)\n", This);
|
TRACE("(%p)\n", This);
|
||||||
|
|
||||||
return IShellBrowserImpl_QueryInterface(This,riid,ppvObj);
|
return IShellBrowserImpl_QueryInterface((IShellBrowser *)This,riid,ppvObj);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
|
@ -740,11 +750,11 @@ static HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_QueryInterface(
|
||||||
*/
|
*/
|
||||||
static ULONG WINAPI IShellBrowserImpl_ICommDlgBrowser_AddRef(ICommDlgBrowser * iface)
|
static ULONG WINAPI IShellBrowserImpl_ICommDlgBrowser_AddRef(ICommDlgBrowser * iface)
|
||||||
{
|
{
|
||||||
_ICOM_THIS_FromICommDlgBrowser(IShellBrowser,iface);
|
IShellBrowserImpl *This = impl_from_ICommDlgBrowser(iface);
|
||||||
|
|
||||||
TRACE("(%p)\n", This);
|
TRACE("(%p)\n", This);
|
||||||
|
|
||||||
return IShellBrowserImpl_AddRef(This);
|
return IShellBrowserImpl_AddRef((IShellBrowser *)This);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
|
@ -752,11 +762,11 @@ static ULONG WINAPI IShellBrowserImpl_ICommDlgBrowser_AddRef(ICommDlgBrowser * i
|
||||||
*/
|
*/
|
||||||
static ULONG WINAPI IShellBrowserImpl_ICommDlgBrowser_Release(ICommDlgBrowser * iface)
|
static ULONG WINAPI IShellBrowserImpl_ICommDlgBrowser_Release(ICommDlgBrowser * iface)
|
||||||
{
|
{
|
||||||
_ICOM_THIS_FromICommDlgBrowser(IShellBrowser,iface);
|
IShellBrowserImpl *This = impl_from_ICommDlgBrowser(iface);
|
||||||
|
|
||||||
TRACE("(%p)\n", This);
|
TRACE("(%p)\n", This);
|
||||||
|
|
||||||
return IShellBrowserImpl_Release(This);
|
return IShellBrowserImpl_Release((IShellBrowser *)This);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
|
@ -770,7 +780,7 @@ static HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_OnDefaultCommand(ICommDl
|
||||||
LPITEMIDLIST pidl;
|
LPITEMIDLIST pidl;
|
||||||
FileOpenDlgInfos *fodInfos;
|
FileOpenDlgInfos *fodInfos;
|
||||||
|
|
||||||
_ICOM_THIS_FromICommDlgBrowser(IShellBrowserImpl,iface);
|
IShellBrowserImpl *This = impl_from_ICommDlgBrowser(iface);
|
||||||
|
|
||||||
TRACE("(%p)\n", This);
|
TRACE("(%p)\n", This);
|
||||||
|
|
||||||
|
@ -812,7 +822,7 @@ static HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_OnStateChange(ICommDlgBr
|
||||||
ULONG uChange)
|
ULONG uChange)
|
||||||
{
|
{
|
||||||
|
|
||||||
_ICOM_THIS_FromICommDlgBrowser(IShellBrowserImpl,iface);
|
IShellBrowserImpl *This = impl_from_ICommDlgBrowser(iface);
|
||||||
|
|
||||||
TRACE("(%p shv=%p)\n", This, ppshv);
|
TRACE("(%p shv=%p)\n", This, ppshv);
|
||||||
|
|
||||||
|
@ -855,7 +865,7 @@ static HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_IncludeObject(ICommDlgBr
|
||||||
STRRET str;
|
STRRET str;
|
||||||
WCHAR szPathW[MAX_PATH];
|
WCHAR szPathW[MAX_PATH];
|
||||||
|
|
||||||
_ICOM_THIS_FromICommDlgBrowser(IShellBrowserImpl,iface);
|
IShellBrowserImpl *This = impl_from_ICommDlgBrowser(iface);
|
||||||
|
|
||||||
TRACE("(%p)\n", This);
|
TRACE("(%p)\n", This);
|
||||||
|
|
||||||
|
@ -895,7 +905,7 @@ static HRESULT IShellBrowserImpl_ICommDlgBrowser_OnSelChange(ICommDlgBrowser *if
|
||||||
{
|
{
|
||||||
FileOpenDlgInfos *fodInfos;
|
FileOpenDlgInfos *fodInfos;
|
||||||
|
|
||||||
_ICOM_THIS_FromICommDlgBrowser(IShellBrowserImpl,iface);
|
IShellBrowserImpl *This = impl_from_ICommDlgBrowser(iface);
|
||||||
|
|
||||||
fodInfos = (FileOpenDlgInfos *) GetPropA(This->hwndOwner,FileOpenDlgInfosStr);
|
fodInfos = (FileOpenDlgInfos *) GetPropA(This->hwndOwner,FileOpenDlgInfosStr);
|
||||||
TRACE("(%p do=%p view=%p)\n", This, fodInfos->Shell.FOIDataObject, fodInfos->Shell.FOIShellView);
|
TRACE("(%p do=%p view=%p)\n", This, fodInfos->Shell.FOIDataObject, fodInfos->Shell.FOIShellView);
|
||||||
|
@ -942,11 +952,11 @@ static HRESULT WINAPI IShellBrowserImpl_IServiceProvider_QueryInterface(
|
||||||
REFIID riid,
|
REFIID riid,
|
||||||
LPVOID *ppvObj)
|
LPVOID *ppvObj)
|
||||||
{
|
{
|
||||||
_ICOM_THIS_FromIServiceProvider(IShellBrowser,iface);
|
IShellBrowserImpl *This = impl_from_IServiceProvider(iface);
|
||||||
|
|
||||||
FIXME("(%p)\n", This);
|
FIXME("(%p)\n", This);
|
||||||
|
|
||||||
return IShellBrowserImpl_QueryInterface(This,riid,ppvObj);
|
return IShellBrowserImpl_QueryInterface((IShellBrowser *)This,riid,ppvObj);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
|
@ -954,11 +964,11 @@ static HRESULT WINAPI IShellBrowserImpl_IServiceProvider_QueryInterface(
|
||||||
*/
|
*/
|
||||||
static ULONG WINAPI IShellBrowserImpl_IServiceProvider_AddRef(IServiceProvider * iface)
|
static ULONG WINAPI IShellBrowserImpl_IServiceProvider_AddRef(IServiceProvider * iface)
|
||||||
{
|
{
|
||||||
_ICOM_THIS_FromIServiceProvider(IShellBrowser,iface);
|
IShellBrowserImpl *This = impl_from_IServiceProvider(iface);
|
||||||
|
|
||||||
FIXME("(%p)\n", This);
|
FIXME("(%p)\n", This);
|
||||||
|
|
||||||
return IShellBrowserImpl_AddRef(This);
|
return IShellBrowserImpl_AddRef((IShellBrowser *)This);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
|
@ -966,11 +976,11 @@ static ULONG WINAPI IShellBrowserImpl_IServiceProvider_AddRef(IServiceProvider *
|
||||||
*/
|
*/
|
||||||
static ULONG WINAPI IShellBrowserImpl_IServiceProvider_Release(IServiceProvider * iface)
|
static ULONG WINAPI IShellBrowserImpl_IServiceProvider_Release(IServiceProvider * iface)
|
||||||
{
|
{
|
||||||
_ICOM_THIS_FromIServiceProvider(IShellBrowser,iface);
|
IShellBrowserImpl *This = impl_from_IServiceProvider(iface);
|
||||||
|
|
||||||
FIXME("(%p)\n", This);
|
FIXME("(%p)\n", This);
|
||||||
|
|
||||||
return IShellBrowserImpl_Release(This);
|
return IShellBrowserImpl_Release((IShellBrowser *)This);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
|
@ -990,14 +1000,14 @@ static HRESULT WINAPI IShellBrowserImpl_IServiceProvider_QueryService(
|
||||||
REFIID riid,
|
REFIID riid,
|
||||||
void** ppv)
|
void** ppv)
|
||||||
{
|
{
|
||||||
_ICOM_THIS_FromIServiceProvider(IShellBrowser,iface);
|
IShellBrowserImpl *This = impl_from_IServiceProvider(iface);
|
||||||
|
|
||||||
FIXME("(%p)\n\t%s\n\t%s\n", This,debugstr_guid(guidService), debugstr_guid(riid) );
|
FIXME("(%p)\n\t%s\n\t%s\n", This,debugstr_guid(guidService), debugstr_guid(riid) );
|
||||||
|
|
||||||
*ppv = NULL;
|
*ppv = NULL;
|
||||||
if(guidService && IsEqualIID(guidService, &SID_STopLevelBrowser))
|
if(guidService && IsEqualIID(guidService, &SID_STopLevelBrowser))
|
||||||
{
|
{
|
||||||
return IShellBrowserImpl_QueryInterface(This,riid,ppv);
|
return IShellBrowserImpl_QueryInterface((IShellBrowser *)This,riid,ppv);
|
||||||
}
|
}
|
||||||
FIXME("(%p) unknown interface requested\n", This);
|
FIXME("(%p) unknown interface requested\n", This);
|
||||||
return E_NOINTERFACE;
|
return E_NOINTERFACE;
|
||||||
|
|
|
@ -37,11 +37,6 @@
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* Defines and global variables
|
* Defines and global variables
|
||||||
*/
|
*/
|
||||||
#define _ICommDlgBrowser_Offset ((int)(&(((IShellBrowserImpl*)0)->lpVtblCommDlgBrowser)))
|
|
||||||
#define _ICOM_THIS_FromICommDlgBrowser(class, name) class* This = (class*)(((char*)name)-_ICommDlgBrowser_Offset);
|
|
||||||
|
|
||||||
#define _IServiceProvider_Offset ((int)(&(((IShellBrowserImpl*)0)->lpVtblServiceProvider)))
|
|
||||||
#define _ICOM_THIS_FromIServiceProvider(class, name) class* This = (class*)(((char*)name)-_IServiceProvider_Offset);
|
|
||||||
|
|
||||||
/* dialog internal property */
|
/* dialog internal property */
|
||||||
|
|
||||||
|
|
|
@ -2968,7 +2968,7 @@ PRINTDLG_PagePaintProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
HDC hdc;
|
HDC hdc;
|
||||||
HBRUSH hbrush, holdbrush;
|
HBRUSH hbrush, holdbrush;
|
||||||
PageSetupDataA *pda;
|
PageSetupDataA *pda;
|
||||||
int papersize=0, orientation=0; /* FIXME: set this values */
|
int papersize=0, orientation=0; /* FIXME: set this values for user paint hook */
|
||||||
double scalx, scaly;
|
double scalx, scaly;
|
||||||
#define CALLPAINTHOOK(msg,lprc) PRINTDLG_DefaultPagePaintHook( hWnd, msg, (WPARAM)hdc, (LPARAM)lprc, pda)
|
#define CALLPAINTHOOK(msg,lprc) PRINTDLG_DefaultPagePaintHook( hWnd, msg, (WPARAM)hdc, (LPARAM)lprc, pda)
|
||||||
|
|
||||||
|
@ -3085,11 +3085,8 @@ PRINTDLG_PageDlgProcA(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
/* FIXME: Paint hook. Must it be at begin of initializtion or at end? */
|
/* FIXME: Paint hook. Must it be at begin of initializtion or at end? */
|
||||||
res = TRUE;
|
res = TRUE;
|
||||||
if (pda->dlga->Flags & PSD_ENABLEPAGESETUPHOOK) {
|
if (pda->dlga->Flags & PSD_ENABLEPAGESETUPHOOK) {
|
||||||
res = pda->dlga->lpfnPageSetupHook(hDlg,uMsg,wParam,(LPARAM)pda->dlga);
|
if (!pda->dlga->lpfnPageSetupHook(hDlg,uMsg,wParam,(LPARAM)pda->dlga))
|
||||||
if (!res) {
|
|
||||||
FIXME("Setup page hook failed?\n");
|
FIXME("Setup page hook failed?\n");
|
||||||
res = TRUE;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* if printer button disabled */
|
/* if printer button disabled */
|
||||||
|
@ -3102,11 +3099,14 @@ PRINTDLG_PageDlgProcA(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
EnableWindow(GetDlgItem(hDlg, edt6), FALSE);
|
EnableWindow(GetDlgItem(hDlg, edt6), FALSE);
|
||||||
EnableWindow(GetDlgItem(hDlg, edt7), FALSE);
|
EnableWindow(GetDlgItem(hDlg, edt7), FALSE);
|
||||||
}
|
}
|
||||||
/* width larger as height -> landscape */
|
/* Set orientation radiobutton properly */
|
||||||
if (pda->dlga->ptPaperSize.x > pda->dlga->ptPaperSize.y)
|
dm = GlobalLock(pda->dlga->hDevMode);
|
||||||
|
if (dm->u.s.dmOrientation == DMORIENT_LANDSCAPE)
|
||||||
CheckRadioButton(hDlg, rad1, rad2, rad2);
|
CheckRadioButton(hDlg, rad1, rad2, rad2);
|
||||||
else /* this is default if papersize is not set */
|
else /* this is default if papersize is not set */
|
||||||
CheckRadioButton(hDlg, rad1, rad2, rad1);
|
CheckRadioButton(hDlg, rad1, rad2, rad1);
|
||||||
|
GlobalUnlock(pda->dlga->hDevMode);
|
||||||
|
|
||||||
/* if orientation disabled */
|
/* if orientation disabled */
|
||||||
if (pda->dlga->Flags & PSD_DISABLEORIENTATION) {
|
if (pda->dlga->Flags & PSD_DISABLEORIENTATION) {
|
||||||
EnableWindow(GetDlgItem(hDlg,rad1),FALSE);
|
EnableWindow(GetDlgItem(hDlg,rad1),FALSE);
|
||||||
|
@ -3151,6 +3151,11 @@ PRINTDLG_PageDlgProcA(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
GlobalUnlock(pda->pdlg.hDevMode);
|
GlobalUnlock(pda->pdlg.hDevMode);
|
||||||
pda->curdlg.ptPaperSize.x = _c_10mm2size(pda->dlga, pda->curdlg.ptPaperSize.x);
|
pda->curdlg.ptPaperSize.x = _c_10mm2size(pda->dlga, pda->curdlg.ptPaperSize.x);
|
||||||
pda->curdlg.ptPaperSize.y = _c_10mm2size(pda->dlga, pda->curdlg.ptPaperSize.y);
|
pda->curdlg.ptPaperSize.y = _c_10mm2size(pda->dlga, pda->curdlg.ptPaperSize.y);
|
||||||
|
if (IsDlgButtonChecked(hDlg, rad2) == BST_CHECKED) { /* Landscape orientation */
|
||||||
|
DWORD tmp = pda->curdlg.ptPaperSize.y;
|
||||||
|
pda->curdlg.ptPaperSize.y = pda->curdlg.ptPaperSize.x;
|
||||||
|
pda->curdlg.ptPaperSize.x = tmp;
|
||||||
|
}
|
||||||
} else
|
} else
|
||||||
WARN("GlobalLock(pda->pdlg.hDevMode) fail? hDevMode=%ld", (DWORD)pda->pdlg.hDevMode);
|
WARN("GlobalLock(pda->pdlg.hDevMode) fail? hDevMode=%ld", (DWORD)pda->pdlg.hDevMode);
|
||||||
/* Drawing paper prev */
|
/* Drawing paper prev */
|
||||||
|
|
Loading…
Reference in a new issue