diff options
Diffstat (limited to 'experimental/PdfViewer/pdfparser')
-rw-r--r-- | experimental/PdfViewer/pdfparser/native/SkNativeParsedPDF.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/experimental/PdfViewer/pdfparser/native/SkNativeParsedPDF.cpp b/experimental/PdfViewer/pdfparser/native/SkNativeParsedPDF.cpp index 2e7e670ce9..d9f680cc3e 100644 --- a/experimental/PdfViewer/pdfparser/native/SkNativeParsedPDF.cpp +++ b/experimental/PdfViewer/pdfparser/native/SkNativeParsedPDF.cpp @@ -207,6 +207,18 @@ void SkNativeParsedPDF::loadWithoutXRef() { current = skipPdfWhiteSpaces(0, current, end); } + // TODO(edisonn): hack, detect root catalog - we need to implement liniarized support, and remove this hack. + if (!fRootCatalogRef) { + for (unsigned int i = 0 ; i < objects(); i++) { + SkPdfObject* obj = object(i); + SkPdfObject* root = (obj && obj->isDictionary()) ? obj->get("Root") : NULL; + if (root && root->isReference()) { + fRootCatalogRef = root; + } + } + } + + if (fRootCatalogRef) { fRootCatalog = (SkPdfCatalogDictionary*)resolveReference(fRootCatalogRef); if (fRootCatalog->isDictionary() && fRootCatalog->valid()) { @@ -217,6 +229,7 @@ void SkNativeParsedPDF::loadWithoutXRef() { } } + } // TODO(edisonn): NYI |