Thanks for the input... I guess I've got a lot of fixing up to do. So, all of the responses I have received, I guess mean that they need to be redone before being accepted? If they don't get a response like "Accepted", they're not accepted?
<br><br>Maybe my strategy of making a bunch of changes and sending them all at once wasn't too good of an idea. :)<br><br>I'll work on them and re-submit later.<br><br><div><span class="gmail_quote">On 6/8/06, <b class="gmail_sendername">
Vitaliy Margolen</b> &lt;<a href="mailto:wine-devel@kievinfo.com">wine-devel@kievinfo.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Thursday, June 8, 2006, 6:40:33 PM, Anoni Moose wrote:<br>&gt; This is my first patch to an open source project... if anyone has any comments/suggestions, please tell me. :)<br><br>&gt; These patches add full search, search next, replace, and goto line functionality to notepad. Too bad I missed the 
0.9.15 release!<br><br>&gt; Changelog:<br><br>&gt; * programs/notepad/main.c, programs/notepad/dialog.c,<br>&gt; programs/notepad/main.h, programs/notepad/notepad_res.h,<br>&gt; programs/notepad/dialog.h:<br>&gt; notepad: Add/call functions to load/save globals settings (including font info) to registry.
<br>&gt; -Added full Search/Search Next functionality.<br>&gt; -Added full Replace functionality.<br>&gt; -Added full Goto Line functionality.<br>&gt; -Load/Save to registry whether we want to wrap long lines or not.<br><br>
<br>Please one patch per email. You should combine all of your changes into one patch<br>if that's one logical change and can be applied by itself. Of course resultant code<br>should compile and work.<br><br>&gt; @@ -638,6 +641,8 @@
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Globals.hFont=CreateFontIndirect( &amp;lf );<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Globals.lfFont=lf;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SendMessage( Globals.hEdit, WM_SETFONT, (WPARAM)Globals.hFont, (LPARAM)TRUE );<br>&gt; +&nbsp;&nbsp;&nbsp;&nbsp; SETTINGS_SaveSettings();
<br>&gt; +<br>Please respect indentation. Don't just copy&amp;paste stuff all over the file.<br><br>&gt;&nbsp;&nbsp;VOID DIALOG_Search(VOID)<br>&gt;&nbsp;&nbsp;{<br>&gt; +<br>&gt; +&nbsp;&nbsp;&nbsp;&nbsp; if (Globals.find.hwndOwner == NULL) {<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ZeroMemory(&amp;Globals.find, sizeof(
Globals.find));<br>&gt; +&nbsp;&nbsp;&nbsp;&nbsp; }<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Globals.find.lStructSize&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= sizeof(Globals.find);<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Globals.find.hwndOwner&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= Globals.hMainWnd;<br>Pretty much the same here: don't just insert stuff, indent it properly.
<br>And please no extra blank lines nor needles curly brackets.<br><br>&gt; +&nbsp;&nbsp;&nbsp;&nbsp; if (Globals.replace.hwndOwner == NULL) {<br>&gt; +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ZeroMemory(&amp;Globals.replace, sizeof(Globals.replace));<br>&gt; +&nbsp;&nbsp;&nbsp;&nbsp; }<br>Respect indentation and style of the file you changing. In this case 4-spaces
<br>not 2.<br><br>&gt; +&nbsp;&nbsp;&nbsp;&nbsp; Globals.hFindReplaceDlg = ReplaceText(&amp;Globals.replace);<br>&gt; +&nbsp;&nbsp;&nbsp;&nbsp; assert(Globals.hFindReplaceDlg != 0);<br>&gt; +}<br>Please don't use assert. Do a proper error checking instead.<br><br>
&gt; +&nbsp;&nbsp;&nbsp;&nbsp; if (result == -1) {&nbsp;&nbsp;&nbsp;&nbsp; /* text not found. */<br>&gt; +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MessageBoxA(Globals.hEdit, &quot;Cannot find text.&quot;, NULL, MB_OK | MB_ICONINFORMATION);<br>&gt; +&nbsp;&nbsp;&nbsp;&nbsp; } else {<br>You should put all the text into resource files.
<br><br>&gt; +WCHAR *GrabWindowTextW(HWND hWnd, DWORD *nbytes) {<br>&gt; +<br>&gt; +&nbsp;&nbsp;&nbsp;&nbsp; static WCHAR *data = NULL;<br>&gt; +&nbsp;&nbsp;&nbsp;&nbsp; DWORD _nbytes = 0;<br>&gt; +<br>&gt; +&nbsp;&nbsp;&nbsp;&nbsp; if (nbytes == NULL) nbytes = &amp;_nbytes;<br>&gt; +
<br>&gt; +&nbsp;&nbsp;&nbsp;&nbsp; *nbytes = (*nbytes == 0 ? GetWindowTextLengthW(hWnd) + 1 : *nbytes);<br>&gt; +&nbsp;&nbsp;&nbsp;&nbsp; data = HeapAlloc(GetProcessHeap(), 0, (*nbytes) * sizeof(WCHAR));<br>&gt; +&nbsp;&nbsp;&nbsp;&nbsp; GetWindowTextW(hWnd, data, (*nbytes)+1);<br>
&gt; +&nbsp;&nbsp;&nbsp;&nbsp; return data;<br>&gt; +}<br>Why do you need static if you return allocated buffer?<br>nbytes is misleading - it should be nchars.<br>(*nbytes)+1 is incorrect. You allocated enough memory for *nbytes only.<br><br>
&gt; +int SearchText(HWND hWnd, LPFINDREPLACE find, int pos);<br>Please use windows types so they would work right on 64-bit platforms.<br><br>&gt; +&nbsp;&nbsp;&nbsp;&nbsp;&quot;^R&quot;, CMD_REPLACE<br>Native notepad has it as ctrl+H.<br><br>
Vitaliy Margolen<br><br><br><br></blockquote></div><br><br clear="all"><br>-- <br>- Anoni Moose