Merge pull request #10223 from Snuffleupagus/find-reset-on-query-change
When the search query changes, regardless of the search command, always re-calculate matches (bug 1030622)
This commit is contained in:
commit
5706961452
@ -111,9 +111,12 @@ class PDFFindController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
executeCommand(cmd, state) {
|
executeCommand(cmd, state) {
|
||||||
|
if (!state) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
const pdfDocument = this._pdfDocument;
|
const pdfDocument = this._pdfDocument;
|
||||||
|
|
||||||
if (this._state === null || this._shouldDirtyMatch(cmd)) {
|
if (this._state === null || this._shouldDirtyMatch(cmd, state)) {
|
||||||
this._dirtyMatch = true;
|
this._dirtyMatch = true;
|
||||||
}
|
}
|
||||||
this._state = state;
|
this._state = state;
|
||||||
@ -198,7 +201,12 @@ class PDFFindController {
|
|||||||
return this._normalizedQuery;
|
return this._normalizedQuery;
|
||||||
}
|
}
|
||||||
|
|
||||||
_shouldDirtyMatch(cmd) {
|
_shouldDirtyMatch(cmd, state) {
|
||||||
|
// When the search query changes, regardless of the actual search command
|
||||||
|
// used, always re-calculate matches to avoid errors (fixes bug 1030622).
|
||||||
|
if (state.query !== this._state.query) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case 'findagain':
|
case 'findagain':
|
||||||
const pageNumber = this._selected.pageIdx + 1;
|
const pageNumber = this._selected.pageIdx + 1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user