https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f8c7bd6898ec15bb8420b…
commit f8c7bd6898ec15bb8420b7c7a2683759b67ddcd7
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Wed Mar 1 20:17:27 2023 +0900
Commit: GitHub <noreply(a)github.com>
CommitDate: Wed Mar 1 20:17:27 2023 +0900
[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
---
base/applications/notepad/dialog.c | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
diff --git a/base/applications/notepad/dialog.c b/base/applications/notepad/dialog.c
index 72bb17a88dd..0d4272b1bb5 100644
--- a/base/applications/notepad/dialog.c
+++ b/base/applications/notepad/dialog.c
@@ -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 */