aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-07-20 00:33:53 +0000
committerGravatar vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-07-20 00:33:53 +0000
commitf5181a496d79b0dbe4d96195157b25308437cf93 (patch)
tree1ffb6fcbd8835d6bde4bc7cb043517a0dfb25d1a
parent422b67d745afc6e3b02c489dc6f0cd3ae856dd32 (diff)
[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
-rw-r--r--include/pdf/SkPDFCatalog.h2
-rw-r--r--src/pdf/SkPDFCatalog.cpp4
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<SkPDFObject*>* SkPDFCatalog::getSubstituteList(bool firstPage) {
return firstPage ? &fSubstituteResourcesFirstPage :
&fSubstituteResourcesRemaining;
-} \ No newline at end of file
+}