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

Unified Diff: pdf/pdfium/pdfium_engine.cc

Issue 830433002: Navigation to relative fragments does not work correctly for OOP pdf. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes after taking all nameddest at load time. 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
« pdf/pdf_engine.h ('K') | « pdf/pdfium/pdfium_engine.h ('k') | 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 de50c79ff5185b3015857693e3b2698f657eea48..b87ab7d7c49ce45faacb5fae25f77924dd8a347f 100644
--- a/pdf/pdfium/pdfium_engine.cc
+++ b/pdf/pdfium/pdfium_engine.cc
@@ -1188,6 +1188,29 @@ void PDFiumEngine::OnDocumentComplete() {
FinishLoadingDocument();
}
+unsigned long PDFiumEngine::GetNameDestCount() {
+ return FPDF_CountNamedDests(doc_);
+}
+
+void PDFiumEngine::GetNameDests(std::vector<std::string>* name_dest) {
+ unsigned long count = GetNameDestCount();
+ for (unsigned long i = 0; i < count; i++) {
+ wchar_t* name = NULL;
+ unsigned long len = 0;
+ FPDF_DEST dest = NULL;
+ dest = FPDF_GetNamedDest(doc_, i, name, len);
+ if (dest) {
+ name = new wchar_t[len];
+ FPDF_DEST dest = FPDF_GetNamedDest(doc_, i, name, len);
+ if (dest) {
+ name_dest->push_back(
+ base::UTF16ToUTF8(reinterpret_cast<const base::char16*>(name)));
+ }
+ delete[] name;
+ }
+ }
+}
+
void PDFiumEngine::FinishLoadingDocument() {
DCHECK(doc_loader_.IsDocumentComplete() && doc_);
if (called_do_document_action_)
« pdf/pdf_engine.h ('K') | « pdf/pdfium/pdfium_engine.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698