[NOTEPAD] Don't reset Find/Replace if lpstrFindWhat is set (#5104)

We don't want to reset the status of the checkboxes even if the Find/Replace dialog was closed. If lpstrFindWhat is set, do not reset the Find/Replace settings at DIALOG_SearchDialog. CORE-18837
This commit is contained in:
Katayama Hirofumi MZ 2023-03-01 20:17:27 +09:00 committed by GitHub
parent 8c7233e015
commit f8c7bd6898
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1048,15 +1048,17 @@ static VOID DIALOG_SearchDialog(FINDPROC pfnProc)
return;
}
ZeroMemory(&Globals.find, sizeof(Globals.find));
Globals.find.lStructSize = sizeof(Globals.find);
Globals.find.hwndOwner = Globals.hMainWnd;
Globals.find.hInstance = Globals.hInstance;
Globals.find.lpstrFindWhat = Globals.szFindText;
Globals.find.wFindWhatLen = ARRAY_SIZE(Globals.szFindText);
Globals.find.lpstrReplaceWith = Globals.szReplaceText;
Globals.find.wReplaceWithLen = ARRAY_SIZE(Globals.szReplaceText);
Globals.find.Flags = FR_DOWN;
if (!Globals.find.lpstrFindWhat)
{
ZeroMemory(&Globals.find, sizeof(Globals.find));
Globals.find.lStructSize = sizeof(Globals.find);
Globals.find.hwndOwner = Globals.hMainWnd;
Globals.find.lpstrFindWhat = Globals.szFindText;
Globals.find.wFindWhatLen = ARRAY_SIZE(Globals.szFindText);
Globals.find.lpstrReplaceWith = Globals.szReplaceText;
Globals.find.wReplaceWithLen = ARRAY_SIZE(Globals.szReplaceText);
Globals.find.Flags = FR_DOWN;
}
/* We only need to create the modal FindReplace dialog which will */
/* notify us of incoming events using hMainWnd Window Messages */