summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdfannot.cpp
diff options
context:
space:
mode:
authorHenrique Nakashima <hnakashima@chromium.org>2018-03-26 20:37:40 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-03-26 20:37:40 +0000
commitac3e57eee888904d39a07b58ca7d57f8f8b0e51a (patch)
treec688e06925b2d6cb6ea5198cc67715a34c79d60d /fpdfsdk/fpdfannot.cpp
parent2c47fb2c9b3db7be3480cbc044fa90fda988b97f (diff)
downloadpdfium-ac3e57eee888904d39a07b58ca7d57f8f8b0e51a.tar.xz
Revert "Add FPDFAnnot_CountAttachmentPoints"
This reverts commit ca28cb636331de447125de476decbec333fe613b. Reason for revert: broke Windows embeddertests https://build.chromium.org/p/client.pdfium/builders/windows/builds/4622 I got it when landing my CL, which is unrelated. Since this CL passed the bot, I'm guessing it's a flaky test? Original change's description: > Add FPDFAnnot_CountAttachmentPoints > > This CL adds a function to the API that returns the number of quadpoint > sets. > > Change-Id: I999bc567a4c98f6c32e87810e7ecfbb634c7b677 > Reviewed-on: https://pdfium-review.googlesource.com/29130 > Reviewed-by: Lei Zhang <thestig@chromium.org> > Commit-Queue: Lei Zhang <thestig@chromium.org> TBR=thestig@chromium.org,dsinclair@chromium.org,ralf.sippl@gmail.com Change-Id: Id96b5d4e18be2184c9d24f77bda7499aad0ed211 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://pdfium-review.googlesource.com/29190 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Diffstat (limited to 'fpdfsdk/fpdfannot.cpp')
-rw-r--r--fpdfsdk/fpdfannot.cpp15
1 files changed, 2 insertions, 13 deletions
diff --git a/fpdfsdk/fpdfannot.cpp b/fpdfsdk/fpdfannot.cpp
index c52807148e..b5dccaade1 100644
--- a/fpdfsdk/fpdfannot.cpp
+++ b/fpdfsdk/fpdfannot.cpp
@@ -583,7 +583,7 @@ FPDFAnnot_HasAttachmentPoints(FPDF_ANNOTATION annot) {
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV
FPDFAnnot_SetAttachmentPoints(FPDF_ANNOTATION annot,
const FS_QUADPOINTSF* quad_points) {
- if (!FPDFAnnot_HasAttachmentPoints(annot) || !quad_points)
+ if (!annot || !quad_points || !FPDFAnnot_HasAttachmentPoints(annot))
return false;
CPDF_Dictionary* pAnnotDict =
@@ -621,21 +621,10 @@ FPDFAnnot_SetAttachmentPoints(FPDF_ANNOTATION annot,
return true;
}
-FPDF_EXPORT size_t FPDF_CALLCONV
-FPDFAnnot_CountAttachmentPoints(FPDF_ANNOTATION annot) {
- if (!FPDFAnnot_HasAttachmentPoints(annot))
- return 0;
-
- CPDF_Dictionary* pAnnotDict =
- CPDFAnnotContextFromFPDFAnnotation(annot)->GetAnnotDict();
- const CPDF_Array* pArray = GetQuadPointsArrayFromDictionary(pAnnotDict);
- return pArray ? pArray->GetCount() / 8 : 0;
-}
-
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV
FPDFAnnot_GetAttachmentPoints(FPDF_ANNOTATION annot,
FS_QUADPOINTSF* quad_points) {
- if (!FPDFAnnot_HasAttachmentPoints(annot) || !quad_points)
+ if (!annot || !quad_points || !FPDFAnnot_HasAttachmentPoints(annot))
return false;
return GetQuadPointsFromDictionary(