summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdfedit_embeddertest.cpp
diff options
context:
space:
mode:
authorJane Liu <janeliulwq@google.com>2017-06-26 11:28:36 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-06-27 18:13:48 +0000
commitd60e9ad5194e13475ccb21575a7c57de1e2e22c4 (patch)
tree040f7bcade94671b71e5148f716e18416cd06558 /fpdfsdk/fpdfedit_embeddertest.cpp
parent22eb7ae54e4351f70a5a01b0130c8b0dc713586c (diff)
downloadpdfium-d60e9ad5194e13475ccb21575a7c57de1e2e22c4.tar.xz
Changed the return type for annotation APIs
Before: When returning FPDF_ANNOTATION, the APIs would take in a FPDF_ANNTOATION* and write the handle of the annotation to it, while returning a boolean as status. This CL: This CL changes the APIs to directly return FPDF_ANNOTATION, which would be null on failure. Also adds more null checks within the annotation APIs. Bug=pdfium:737 Change-Id: I4f77dd1b16d43eab3f16c303598b76591da0dcab Reviewed-on: https://pdfium-review.googlesource.com/6952 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Jane Liu <janeliulwq@google.com>
Diffstat (limited to 'fpdfsdk/fpdfedit_embeddertest.cpp')
-rw-r--r--fpdfsdk/fpdfedit_embeddertest.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/fpdfsdk/fpdfedit_embeddertest.cpp b/fpdfsdk/fpdfedit_embeddertest.cpp
index fcf7e3903b..ad3e0d15a8 100644
--- a/fpdfsdk/fpdfedit_embeddertest.cpp
+++ b/fpdfsdk/fpdfedit_embeddertest.cpp
@@ -900,12 +900,14 @@ TEST_F(FPDFEditEmbeddertest, TransformAnnot) {
ASSERT_TRUE(page);
// Add an underline annotation to the page without specifying its rectangle.
- ASSERT_TRUE(FPDFPage_CreateAnnot(page, FPDF_ANNOT_UNDERLINE, nullptr));
+ 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);
UnloadPage(page);
}