mirror of
https://github.com/reactos/reactos.git
synced 2024-10-05 17:06:29 +00:00
Notepad: Fixed "Find Up"
svn path=/trunk/; revision=18726
This commit is contained in:
parent
fd37360789
commit
1184c4d49e
|
@ -145,8 +145,8 @@ static BOOL NOTEPAD_FindNext(FINDREPLACE *pFindReplace, BOOL bReplace, BOOL bSho
|
|||
|
||||
iTargetLength = _tcslen(pFindReplace->lpstrFindWhat);
|
||||
|
||||
/* Retrieve the window text */
|
||||
iTextLength = GetWindowTextLength(Globals.hEdit);
|
||||
|
||||
if (iTextLength > 0)
|
||||
{
|
||||
pszText = (LPTSTR) HeapAlloc(GetProcessHeap(), 0, (iTextLength + 1) * sizeof(TCHAR));
|
||||
|
@ -166,17 +166,29 @@ static BOOL NOTEPAD_FindNext(FINDREPLACE *pFindReplace, BOOL bReplace, BOOL bSho
|
|||
}
|
||||
}
|
||||
|
||||
if (pFindReplace->Flags & FR_DOWN)
|
||||
{
|
||||
/* Find Down */
|
||||
dwPosition = dwEnd;
|
||||
while(dwPosition < iTextLength)
|
||||
{
|
||||
bMatches = NOTEPAD_FindTextAt(pFindReplace, pszText, iTextLength, dwPosition);
|
||||
if (bMatches)
|
||||
break;
|
||||
|
||||
if (pFindReplace->Flags & FR_DOWN)
|
||||
dwPosition++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Find Up */
|
||||
dwPosition = dwBegin;
|
||||
while(dwPosition > 0)
|
||||
{
|
||||
dwPosition--;
|
||||
bMatches = NOTEPAD_FindTextAt(pFindReplace, pszText, iTextLength, dwPosition);
|
||||
if (bMatches)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (bMatches)
|
||||
|
|
Loading…
Reference in a new issue