[BUG_FIXED] Fix empty line count failure (RE).
git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@724 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
parent
aedc097094
commit
f2db20fc30
|
@ -1283,7 +1283,7 @@ bool FindReplaceDlg::processFindNext(const TCHAR *txt2find, const FindOption *op
|
|||
}
|
||||
}
|
||||
|
||||
int start = posFind;//int((*_ppEditView)->execute(SCI_GETTARGETSTART));
|
||||
int start = posFind;
|
||||
int end = int((*_ppEditView)->execute(SCI_GETTARGETEND));
|
||||
|
||||
// to make sure the found result is visible:
|
||||
|
@ -1458,7 +1458,7 @@ int FindReplaceDlg::processRange(ProcessOperation op, const TCHAR *txt2find, con
|
|||
int stringSizeFind = 0;
|
||||
int stringSizeReplace = 0;
|
||||
|
||||
TCHAR *pTextFind = NULL;//new TCHAR[stringSizeFind + 1];
|
||||
TCHAR *pTextFind = NULL;
|
||||
if (!txt2find)
|
||||
{
|
||||
HWND hFindCombo = ::GetDlgItem(_hSelf, IDFINDWHAT);
|
||||
|
@ -1544,11 +1544,13 @@ int FindReplaceDlg::processRange(ProcessOperation op, const TCHAR *txt2find, con
|
|||
int replaceDelta = 0;
|
||||
|
||||
// Search resulted in empty token, possible with RE
|
||||
/*
|
||||
if (!foundTextLen) {
|
||||
delete [] pTextFind;
|
||||
delete [] pTextReplace;
|
||||
return -1;
|
||||
}
|
||||
*/
|
||||
|
||||
switch (op)
|
||||
{
|
||||
|
@ -1660,12 +1662,14 @@ int FindReplaceDlg::processRange(ProcessOperation op, const TCHAR *txt2find, con
|
|||
|
||||
}
|
||||
|
||||
if (!foundTextLen && !replaceDelta)
|
||||
startRange = targetStart + foundTextLen + 1; // find a empty string so just step forword
|
||||
else
|
||||
startRange = targetStart + foundTextLen + replaceDelta; //search from result onwards
|
||||
endRange += replaceDelta; //adjust end of range in case of replace
|
||||
|
||||
nbProcessed++;
|
||||
|
||||
//::SendMessageA(_hParent, WM_SETTEXT, 0, (LPARAM)pTextFind);
|
||||
targetStart = (*_ppEditView)->searchInTarget(pTextFind, stringSizeFind, startRange, endRange);
|
||||
}
|
||||
delete [] pTextFind;
|
||||
|
|
|
@ -95,7 +95,9 @@ RECT TaskList::adjustSize()
|
|||
RECT rc;
|
||||
ListView_GetItemRect(_hSelf, 0, &rc, LVIR_ICON);
|
||||
const int imgWidth = rc.right - rc.left;
|
||||
const int marge = 30;
|
||||
const int leftMarge = 30;
|
||||
const int xpBottomMarge = 5;
|
||||
const int w7BottomMarge = 15;
|
||||
|
||||
// Temporary set "selected" font to get the worst case widths
|
||||
::SendMessage(_hSelf, WM_SETFONT, reinterpret_cast<WPARAM>(_hFontSelected), 0);
|
||||
|
@ -113,14 +115,13 @@ RECT TaskList::adjustSize()
|
|||
maxwidth = width;
|
||||
_rc.bottom += rc.bottom - rc.top;
|
||||
}
|
||||
_rc.right = maxwidth + imgWidth + marge;
|
||||
_rc.right = maxwidth + imgWidth + leftMarge;
|
||||
ListView_SetColumnWidth(_hSelf, 0, _rc.right);
|
||||
::SendMessage(_hSelf, WM_SETFONT, reinterpret_cast<WPARAM>(_hFont), 0);
|
||||
|
||||
reSizeTo(_rc);
|
||||
//_rc.right += marge;
|
||||
winVer ver = (NppParameters::getInstance())->getWinVersion();
|
||||
_rc.bottom += ver <= WV_XP?5:15;
|
||||
_rc.bottom += ver <= WV_XP?xpBottomMarge:w7BottomMarge;
|
||||
return _rc;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue