Fix the regression: "Replace all" and "Mark all" work partially

This commit is contained in:
Don HO 2019-05-16 01:59:17 +02:00
parent 2e25741a22
commit 1cd454a8d5
No known key found for this signature in database
GPG Key ID: 6C429F1D8D84F46E

View File

@ -1842,18 +1842,15 @@ int FindReplaceDlg::processAll(ProcessOperation op, const FindOption *opt, bool
}
//then adjust scope if the full document needs to be changed
if (op == ProcessCountAll)
if (op == ProcessCountAll && pOptions->_isInSelection)
{
if (pOptions->_isInSelection)
{
startPosition = cr.cpMin;
endPosition = cr.cpMax;
}
else if (pOptions->_isWrapAround || isEntire) //entire document needs to be scanned
{
startPosition = 0;
endPosition = docLength;
}
startPosition = cr.cpMin;
endPosition = cr.cpMax;
}
else if (pOptions->_isWrapAround || isEntire || op == ProcessCountAll) //entire document needs to be scanned
{
startPosition = 0;
endPosition = docLength;
}
//then readjust scope if the selection override is active and allowed