mirror of
https://github.com/reactos/reactos.git
synced 2025-07-30 03:52:09 +00:00
[MSPAINT] Fix Copy-To-File feature (#5877)
The Copy-To-File feature had some bugs that the user couldn't save. - Modify SelectionModel::GetSelectionContents. - Delete SelectionModel::CopyBitmap, SelectionModel::LockBitmap, and SelectionModel::UnlockBitmap functions. CORE-19186
This commit is contained in:
parent
e627c3b00e
commit
d7ece626cb
8 changed files with 51 additions and 59 deletions
|
@ -7,6 +7,7 @@
|
|||
|
||||
#include "precomp.h"
|
||||
|
||||
#include <dlgs.h>
|
||||
#include <mapi.h>
|
||||
|
||||
POINT g_ptStart, g_ptEnd;
|
||||
|
@ -55,7 +56,7 @@ FileExtFromFilter(LPTSTR pExt, OPENFILENAME *pOFN)
|
|||
CharLower(pExt);
|
||||
return TRUE;
|
||||
}
|
||||
pch += lstrlen(pch) + 1;
|
||||
pch += wcslen(pch) + 1;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -66,6 +67,7 @@ OFNHookProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||
{
|
||||
HWND hParent;
|
||||
OFNOTIFY *pon;
|
||||
WCHAR Path[MAX_PATH];
|
||||
switch (uMsg)
|
||||
{
|
||||
case WM_NOTIFY:
|
||||
|
@ -73,11 +75,10 @@ OFNHookProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||
if (pon->hdr.code == CDN_TYPECHANGE)
|
||||
{
|
||||
hParent = GetParent(hwnd);
|
||||
TCHAR Path[MAX_PATH];
|
||||
SendMessage(hParent, CDM_GETFILEPATH, _countof(Path), (LPARAM)Path);
|
||||
FileExtFromFilter(PathFindExtension(Path), pon->lpOFN);
|
||||
SendMessage(hParent, CDM_SETCONTROLTEXT, 0x047c, (LPARAM)PathFindFileName(Path));
|
||||
lstrcpyn(pon->lpOFN->lpstrFile, Path, pon->lpOFN->nMaxFile);
|
||||
SendMessageW(hParent, CDM_GETFILEPATH, _countof(Path), (LPARAM)Path);
|
||||
FileExtFromFilter(PathFindExtensionW(Path), pon->lpOFN);
|
||||
SendMessageW(hParent, CDM_SETCONTROLTEXT, cmb13, (LPARAM)PathFindFileNameW(Path));
|
||||
StringCchCopyW(pon->lpOFN->lpstrFile, pon->lpOFN->nMaxFile, Path);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -251,7 +252,7 @@ BOOL CMainWindow::GetSaveFileName(IN OUT LPTSTR pszFile, INT cchMaxFile)
|
|||
if (*pchDotExt == UNICODE_NULL)
|
||||
{
|
||||
// Choose PNG
|
||||
wcscat(pszFile, L".png");
|
||||
StringCchCatW(pszFile, cchMaxFile, L".png");
|
||||
for (INT i = 0; i < aguidFileTypesE.GetSize(); ++i)
|
||||
{
|
||||
if (aguidFileTypesE[i] == Gdiplus::ImageFormatPNG)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue