summaryrefslogtreecommitdiffstats
path: root/pdf/pdfium
diff options
context:
space:
mode:
authordeepak.m1 <deepak.m1@samsung.com>2014-09-28 21:38:40 -0700
committerCommit bot <commit-bot@chromium.org>2014-09-29 04:38:59 +0000
commit0c4d9f76e8e10ac411f3c1ffcf7beaafc12746d2 (patch)
treed2fb9708857e126e2efdbc1ba9536021da0ca130 /pdf/pdfium
parentaf8a4054eab230950711b506c096a69b5ed162e4 (diff)
downloadchromium_src-0c4d9f76e8e10ac411f3c1ffcf7beaafc12746d2.zip
chromium_src-0c4d9f76e8e10ac411f3c1ffcf7beaafc12746d2.tar.gz
chromium_src-0c4d9f76e8e10ac411f3c1ffcf7beaafc12746d2.tar.bz2
For loop is running un-nacessrily after match.
loop should break after match as values are getting reset to empty rect after match.Changes done so that loop breaks after match. BUG=417621 Review URL: https://codereview.chromium.org/603903002 Cr-Commit-Position: refs/heads/master@{#297138}
Diffstat (limited to 'pdf/pdfium')
-rw-r--r--pdf/pdfium/pdfium_engine.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/pdf/pdfium/pdfium_engine.cc b/pdf/pdfium/pdfium_engine.cc
index f3ff3cf..4231e22 100644
--- a/pdf/pdfium/pdfium_engine.cc
+++ b/pdf/pdfium/pdfium_engine.cc
@@ -2715,10 +2715,12 @@ PDFiumEngine::SelectionChangeInvalidator::~SelectionChangeInvalidator() {
GetVisibleSelectionsScreenRects(&new_selections);
for (size_t i = 0; i < new_selections.size(); ++i) {
for (size_t j = 0; j < old_selections_.size(); ++j) {
- if (new_selections[i] == old_selections_[j]) {
+ if (!old_selections_[j].IsEmpty() &&
+ new_selections[i] == old_selections_[j]) {
// Rectangle was selected before and after, so no need to invalidate it.
// Mark the rectangles by setting them to empty.
new_selections[i] = old_selections_[j] = pp::Rect();
+ break;
}
}
}