Commit 18a8dab1 authored by Lei Zhang's avatar Lei Zhang Committed by Commit Bot

Use PDFium scopers in more places.

Change-Id: I042880a6b33e52f88f31f2b4c1dce44ad71677f1
Reviewed-on: https://chromium-review.googlesource.com/1043653Reviewed-by: default avatarHenrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#556108}
parent 93d64d4d
This diff is collapsed.
......@@ -19,6 +19,7 @@
#include "pdf/pdfium/pdfium_api_string_buffer_adapter.h"
#include "pdf/pdfium/pdfium_engine.h"
#include "printing/units.h"
#include "third_party/pdfium/public/cpp/fpdf_scopers.h"
#include "third_party/pdfium/public/fpdf_annot.h"
using printing::ConvertUnitDouble;
......@@ -602,10 +603,9 @@ const PDFEngine::PageFeatures* PDFiumPage::GetPageFeatures() {
page_features_.index = index_;
int annotation_count = FPDFPage_GetAnnotCount(page);
for (int i = 0; i < annotation_count; ++i) {
FPDF_ANNOTATION annotation = FPDFPage_GetAnnot(page, i);
FPDF_ANNOTATION_SUBTYPE subtype = FPDFAnnot_GetSubtype(annotation);
ScopedFPDFAnnotation annotation(FPDFPage_GetAnnot(page, i));
FPDF_ANNOTATION_SUBTYPE subtype = FPDFAnnot_GetSubtype(annotation.get());
page_features_.annotation_types.insert(subtype);
FPDFPage_CloseAnnot(annotation);
}
return &page_features_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment