diff options
author | Lei Zhang <thestig@chromium.org> | 2018-02-05 18:28:38 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-02-05 18:28:38 +0000 |
commit | a21d593e202cbef9a0641d0123917ac3b8d73ee6 (patch) | |
tree | d72c9134cdbac10de2fca436b056c596b3aa3adf /fpdfsdk/fpdfedit_embeddertest.cpp | |
parent | 2896cfaff519136d7d770ca048b448e6b3ad9324 (diff) | |
download | pdfium-a21d593e202cbef9a0641d0123917ac3b8d73ee6.tar.xz |
Add FPDFAnnotationDeleter for use with std::unique_ptr.
Use it in existing code where appropriate.
BUG=chromium:808269
Change-Id: I55b67db05267f4f05a98c9bf8bbd43f6524cbc65
Reviewed-on: https://pdfium-review.googlesource.com/25210
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'fpdfsdk/fpdfedit_embeddertest.cpp')
-rw-r--r-- | fpdfsdk/fpdfedit_embeddertest.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/fpdfsdk/fpdfedit_embeddertest.cpp b/fpdfsdk/fpdfedit_embeddertest.cpp index 070c51e3b6..c0ddd77cda 100644 --- a/fpdfsdk/fpdfedit_embeddertest.cpp +++ b/fpdfsdk/fpdfedit_embeddertest.cpp @@ -928,15 +928,16 @@ TEST_F(FPDFEditEmbeddertest, TransformAnnot) { FPDF_PAGE page = FPDF_LoadPage(document(), 0); ASSERT_TRUE(page); - // Add an underline annotation to the page without specifying its rectangle. - FPDF_ANNOTATION annot = FPDFPage_CreateAnnot(page, FPDF_ANNOT_UNDERLINE); - ASSERT_TRUE(annot); - - // FPDFPage_TransformAnnots() should run without errors when modifying - // annotation rectangles. - FPDFPage_TransformAnnots(page, 1, 2, 3, 4, 5, 6); - - FPDFPage_CloseAnnot(annot); + { + // Add an underline annotation to the page without specifying its rectangle. + std::unique_ptr<void, FPDFAnnotationDeleter> annot( + FPDFPage_CreateAnnot(page, FPDF_ANNOT_UNDERLINE)); + ASSERT_TRUE(annot); + + // FPDFPage_TransformAnnots() should run without errors when modifying + // annotation rectangles. + FPDFPage_TransformAnnots(page, 1, 2, 3, 4, 5, 6); + } UnloadPage(page); } |