From 2fd5d36ea6e134647aae0fbd35195500723851c3 Mon Sep 17 00:00:00 2001 From: "edisonn@google.com" Date: Tue, 23 Jul 2013 19:43:48 +0000 Subject: [PATCH] pdfviewer: fix type3 font, make SkPdfObject::get parameter const Review URL: https://codereview.chromium.org/19670019 git-svn-id: http://skia.googlecode.com/svn/trunk@10289 2bbb7eff-a529-9590-31e7-b0007b416f81 --- experimental/PdfViewer/SkPdfFont.h | 6 +++--- experimental/PdfViewer/pdfparser/native/SkPdfObject.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/experimental/PdfViewer/SkPdfFont.h b/experimental/PdfViewer/SkPdfFont.h index a7c4ce8cc6..247b3f5409 100644 --- a/experimental/PdfViewer/SkPdfFont.h +++ b/experimental/PdfViewer/SkPdfFont.h @@ -337,8 +337,8 @@ public: if (dict->isEncodingAName(parsed)) { fEncoding = SkPdfEncoding::fromName(dict->getEncodingAsName(parsed).c_str()); } else if (dict->isEncodingAEncodingdictionary(parsed)) { - // technically, there is no encoding. - fEncoding = SkPdfCIDToGIDMapIdentityEncoding::instance(); + // No encoding. + fEncoding = SkPdfDefaultEncoding::instance(); fEncodingDict = dict->getEncodingAsEncodingdictionary(parsed); } } @@ -381,7 +381,7 @@ public: if (j < fFirstChar || j > fLastChar) { printf("break; error 2\n"); } - fChars[j - fFirstChar].fObj = fCharProcs->get((*diffs)[i]->nameValue()); + fChars[j - fFirstChar].fObj = fCharProcs->get((*diffs)[i]); j++; } else { // err diff --git a/experimental/PdfViewer/pdfparser/native/SkPdfObject.h b/experimental/PdfViewer/pdfparser/native/SkPdfObject.h index f7171191c8..c670ac8dca 100644 --- a/experimental/PdfViewer/pdfparser/native/SkPdfObject.h +++ b/experimental/PdfViewer/pdfparser/native/SkPdfObject.h @@ -372,7 +372,7 @@ public: // which will be used in code // add function SkPdfFastNameKey key(const char* key); // TODO(edisonn): setting the same key twike, will make the value undefined! - bool set(SkPdfObject* key, SkPdfObject* value) { + bool set(const SkPdfObject* key, SkPdfObject* value) { SkASSERT(fObjectType == kDictionary_PdfObjectType); SkASSERT(key->fObjectType == kName_PdfObjectType); @@ -402,7 +402,7 @@ public: return fMap->set((const char*)key, len, value); } - SkPdfObject* get(SkPdfObject* key) { + SkPdfObject* get(const SkPdfObject* key) { SkASSERT(fObjectType == kDictionary_PdfObjectType); SkASSERT(key->fObjectType == kName_PdfObjectType); @@ -432,7 +432,7 @@ public: return ret; } - const SkPdfObject* get(SkPdfObject* key) const { + const SkPdfObject* get(const SkPdfObject* key) const { SkASSERT(fObjectType == kDictionary_PdfObjectType); SkASSERT(key->fObjectType == kName_PdfObjectType);