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

Unified Diff: pdf/pdfium/pdfium_engine.cc

Issue 824363002: copying to clipboard should add a newline before the content of the next page. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 6cd9cae4f9974104ef0879c11b3732ba52a23964..5920af1ee5c5427ca6e5001b30b7ad7a38e560b4 100644
--- a/pdf/pdfium/pdfium_engine.cc
+++ b/pdf/pdfium/pdfium_engine.cc
@@ -2229,11 +2229,14 @@ void PDFiumEngine::InvalidateAllPages() {
std::string PDFiumEngine::GetSelectedText() {
base::string16 result;
+ base::string16 new_line_char = base::UTF8ToUTF16("\n");
for (size_t i = 0; i < selection_.size(); ++i) {
if (i > 0 &&
selection_[i - 1].page_index() > selection_[i].page_index()) {
- result = selection_[i].GetText() + result;
+ result = selection_[i].GetText() + new_line_char + result;
} else {
+ if (i > 0)
+ result.append(new_line_char);
result.append(selection_[i].GetText());
}
}
« 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