wordpad: Provide buffer for replace with text.

Dylan Smith dylan.ah.smith at gmail.com
Thu Jun 10 23:44:16 CDT 2010


Previously trying to replace or replace all would just delete the text
matching the search and not insert the replacement text.

On Windows I found the replace dialog failed to open at all.
---
 programs/wordpad/wordpad.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/programs/wordpad/wordpad.c b/programs/wordpad/wordpad.c
index 0bf5d0c..3b8b6bc 100644
--- a/programs/wordpad/wordpad.c
+++ b/programs/wordpad/wordpad.c
@@ -1302,6 +1302,7 @@ static LRESULT handle_findmsg(LPFINDREPLACEW pFr)
 static void dialog_find(LPFINDREPLACEW fr, BOOL replace)
 {
     static WCHAR findBuffer[MAX_STRING_LEN];
+    static WCHAR replaceBuffer[MAX_STRING_LEN];
 
     /* Allow only one search/replace dialog to open */
     if(hFindWnd != NULL)
@@ -1315,8 +1316,10 @@ static void dialog_find(LPFINDREPLACEW fr, BOOL replace)
     fr->hwndOwner = hMainWnd;
     fr->Flags = FR_HIDEUPDOWN;
     fr->lpstrFindWhat = findBuffer;
+    fr->lpstrReplaceWith = replaceBuffer;
     fr->lCustData = -1;
-    fr->wFindWhatLen = MAX_STRING_LEN*sizeof(WCHAR);
+    fr->wFindWhatLen = sizeof(findBuffer);
+    fr->wReplaceWithLen = sizeof(replaceBuffer);
 
     if(replace)
         hFindWnd = ReplaceTextW(fr);
-- 
1.7.0.4



More information about the wine-patches mailing list