From f5181a496d79b0dbe4d96195157b25308437cf93 Mon Sep 17 00:00:00 2001 From: "vandebo@chromium.org" Date: Wed, 20 Jul 2011 00:33:53 +0000 Subject: [PATCH] [PDF] Fix substitute resources size calculation. Review URL: http://codereview.appspot.com/4803041 git-svn-id: http://skia.googlecode.com/svn/trunk@1908 2bbb7eff-a529-9590-31e7-b0007b416f81 --- include/pdf/SkPDFCatalog.h | 2 +- src/pdf/SkPDFCatalog.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/pdf/SkPDFCatalog.h b/include/pdf/SkPDFCatalog.h index 794bbb126c..4f8f8c1ece 100644 --- a/include/pdf/SkPDFCatalog.h +++ b/include/pdf/SkPDFCatalog.h @@ -82,7 +82,7 @@ public: /** Set file offsets for the resources of substitute objects. * @param fileOffset Accumulated offset of current document. * @param firstPage Indicate whether this is for the first page only. - * @return Accumulated offset of resources of substitute objects. + * @return Total size of resources of substitute objects. */ off_t setSubstituteResourcesOffsets(off_t fileOffset, bool firstPage); diff --git a/src/pdf/SkPDFCatalog.cpp b/src/pdf/SkPDFCatalog.cpp index 5e9d018a89..025c86d82f 100644 --- a/src/pdf/SkPDFCatalog.cpp +++ b/src/pdf/SkPDFCatalog.cpp @@ -193,7 +193,7 @@ off_t SkPDFCatalog::setSubstituteResourcesOffsets(off_t fileOffset, for (int i = 0; i < targetList->count(); ++i) { offsetSum += setFileOffset((*targetList)[i], offsetSum); } - return offsetSum; + return offsetSum - fileOffset; } void SkPDFCatalog::emitSubstituteResources(SkWStream *stream, bool firstPage) { @@ -206,4 +206,4 @@ void SkPDFCatalog::emitSubstituteResources(SkWStream *stream, bool firstPage) { SkTDArray* SkPDFCatalog::getSubstituteList(bool firstPage) { return firstPage ? &fSubstituteResourcesFirstPage : &fSubstituteResourcesRemaining; -} \ No newline at end of file +}