Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(859)

Unified Diff: pdf/pdfium/pdfium_engine.cc

Issue 823523005: PDF: Fix missing character when selecting backwards (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Patch improvement. Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pdf/pdfium/pdfium_engine.cc
diff --git a/pdf/pdfium/pdfium_engine.cc b/pdf/pdfium/pdfium_engine.cc
index 87f8d65dc90e3a09695495146564febe52b6ce6c..3b98ced26f5cb0292e65c9ff81b39f94c62accf8 100644
--- a/pdf/pdfium/pdfium_engine.cc
+++ b/pdf/pdfium/pdfium_engine.cc
@@ -1863,7 +1863,9 @@ bool PDFiumEngine::OnMouseMove(const pp::MouseInputEvent& event) {
selection_.push_back(PDFiumRange(pages_[page_index], 0, char_index));
} else {
// Selecting into the previous page.
- selection_[last].SetCharCount(-selection_[last].char_index());
+ // As char_index starts from 0 so char count should be set one more than
Lei Zhang 2015/01/16 07:01:23 I would write this as: The selection's char_index
Deepak 2015/01/16 07:10:39 Done.
+ // char_index.
+ selection_[last].SetCharCount(-(selection_[last].char_index() + 1));
// First make sure that there are no gaps in selection, i.e. if mousedown on
// page three but we only get mousemove over page one, we want page two.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698