mirror of
https://github.com/reactos/reactos.git
synced 2025-07-01 13:11:21 +00:00
Notepad: Fixed "Find Up"
svn path=/trunk/; revision=18726
This commit is contained in:
parent
fd37360789
commit
1184c4d49e
1 changed files with 33 additions and 21 deletions
|
@ -145,8 +145,8 @@ static BOOL NOTEPAD_FindNext(FINDREPLACE *pFindReplace, BOOL bReplace, BOOL bSho
|
||||||
|
|
||||||
iTargetLength = _tcslen(pFindReplace->lpstrFindWhat);
|
iTargetLength = _tcslen(pFindReplace->lpstrFindWhat);
|
||||||
|
|
||||||
|
/* Retrieve the window text */
|
||||||
iTextLength = GetWindowTextLength(Globals.hEdit);
|
iTextLength = GetWindowTextLength(Globals.hEdit);
|
||||||
|
|
||||||
if (iTextLength > 0)
|
if (iTextLength > 0)
|
||||||
{
|
{
|
||||||
pszText = (LPTSTR) HeapAlloc(GetProcessHeap(), 0, (iTextLength + 1) * sizeof(TCHAR));
|
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;
|
dwPosition = dwEnd;
|
||||||
while(dwPosition < iTextLength)
|
while(dwPosition < iTextLength)
|
||||||
{
|
{
|
||||||
bMatches = NOTEPAD_FindTextAt(pFindReplace, pszText, iTextLength, dwPosition);
|
bMatches = NOTEPAD_FindTextAt(pFindReplace, pszText, iTextLength, dwPosition);
|
||||||
if (bMatches)
|
if (bMatches)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (pFindReplace->Flags & FR_DOWN)
|
|
||||||
dwPosition++;
|
dwPosition++;
|
||||||
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
/* Find Up */
|
||||||
|
dwPosition = dwBegin;
|
||||||
|
while(dwPosition > 0)
|
||||||
|
{
|
||||||
dwPosition--;
|
dwPosition--;
|
||||||
|
bMatches = NOTEPAD_FindTextAt(pFindReplace, pszText, iTextLength, dwPosition);
|
||||||
|
if (bMatches)
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bMatches)
|
if (bMatches)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue