From c3cffbedb5ff83afa4fde51e98509f915997ff4a Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Wed, 21 Mar 2018 13:37:46 +0000 Subject: Fix some param names in the public API. Also fix some comments. Change-Id: Ib42dcf04906139020bdbdfe86e6088faa1c31daa Reviewed-on: https://pdfium-review.googlesource.com/28830 Commit-Queue: dsinclair Reviewed-by: dsinclair --- fpdfsdk/fpdfannot.cpp | 40 ++++++++++++++++++------------------ fpdfsdk/fpdfdoc.cpp | 56 +++++++++++++++++++++++++-------------------------- public/fpdf_annot.h | 12 +++++------ public/fpdf_doc.h | 54 ++++++++++++++++++++++++------------------------- public/fpdf_text.h | 6 +++--- 5 files changed, 84 insertions(+), 84 deletions(-) diff --git a/fpdfsdk/fpdfannot.cpp b/fpdfsdk/fpdfannot.cpp index 84c6c03194..d2a15ce8c0 100644 --- a/fpdfsdk/fpdfannot.cpp +++ b/fpdfsdk/fpdfannot.cpp @@ -582,8 +582,8 @@ FPDFAnnot_HasAttachmentPoints(FPDF_ANNOTATION annot) { FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFAnnot_SetAttachmentPoints(FPDF_ANNOTATION annot, - const FS_QUADPOINTSF* quadPoints) { - if (!annot || !quadPoints || !FPDFAnnot_HasAttachmentPoints(annot)) + const FS_QUADPOINTSF* quad_points) { + if (!annot || !quad_points || !FPDFAnnot_HasAttachmentPoints(annot)) return false; CPDF_Dictionary* pAnnotDict = @@ -598,14 +598,14 @@ FPDFAnnot_SetAttachmentPoints(FPDF_ANNOTATION annot, else pQuadPoints = pAnnotDict->SetNewFor("QuadPoints"); - pQuadPoints->AddNew(quadPoints->x1); - pQuadPoints->AddNew(quadPoints->y1); - pQuadPoints->AddNew(quadPoints->x2); - pQuadPoints->AddNew(quadPoints->y2); - pQuadPoints->AddNew(quadPoints->x3); - pQuadPoints->AddNew(quadPoints->y3); - pQuadPoints->AddNew(quadPoints->x4); - pQuadPoints->AddNew(quadPoints->y4); + pQuadPoints->AddNew(quad_points->x1); + pQuadPoints->AddNew(quad_points->y1); + pQuadPoints->AddNew(quad_points->x2); + pQuadPoints->AddNew(quad_points->y2); + pQuadPoints->AddNew(quad_points->x3); + pQuadPoints->AddNew(quad_points->y3); + pQuadPoints->AddNew(quad_points->x4); + pQuadPoints->AddNew(quad_points->y4); // If the annotation's appearance stream is defined, and the new quadpoints // defines a bigger bounding box than the appearance stream currently @@ -623,8 +623,8 @@ FPDFAnnot_SetAttachmentPoints(FPDF_ANNOTATION annot, FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFAnnot_GetAttachmentPoints(FPDF_ANNOTATION annot, - FS_QUADPOINTSF* quadPoints) { - if (!annot || !FPDFAnnot_HasAttachmentPoints(annot) || !quadPoints) + FS_QUADPOINTSF* quad_points) { + if (!annot || !quad_points || !FPDFAnnot_HasAttachmentPoints(annot)) return false; CPDF_Dictionary* pAnnotDict = @@ -636,14 +636,14 @@ FPDFAnnot_GetAttachmentPoints(FPDF_ANNOTATION annot, if (!pArray) return false; - quadPoints->x1 = pArray->GetNumberAt(0); - quadPoints->y1 = pArray->GetNumberAt(1); - quadPoints->x2 = pArray->GetNumberAt(2); - quadPoints->y2 = pArray->GetNumberAt(3); - quadPoints->x3 = pArray->GetNumberAt(4); - quadPoints->y3 = pArray->GetNumberAt(5); - quadPoints->x4 = pArray->GetNumberAt(6); - quadPoints->y4 = pArray->GetNumberAt(7); + quad_points->x1 = pArray->GetNumberAt(0); + quad_points->y1 = pArray->GetNumberAt(1); + quad_points->x2 = pArray->GetNumberAt(2); + quad_points->y2 = pArray->GetNumberAt(3); + quad_points->x3 = pArray->GetNumberAt(4); + quad_points->y3 = pArray->GetNumberAt(5); + quad_points->x4 = pArray->GetNumberAt(6); + quad_points->y4 = pArray->GetNumberAt(7); return true; } diff --git a/fpdfsdk/fpdfdoc.cpp b/fpdfsdk/fpdfdoc.cpp index b8209cc972..88ba2464bc 100644 --- a/fpdfsdk/fpdfdoc.cpp +++ b/fpdfsdk/fpdfdoc.cpp @@ -332,9 +332,9 @@ FPDF_EXPORT FPDF_ACTION FPDF_CALLCONV FPDFLink_GetAction(FPDF_LINK pDict) { } FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFLink_Enumerate(FPDF_PAGE page, - int* startPos, - FPDF_LINK* linkAnnot) { - if (!startPos || !linkAnnot) + int* start_pos, + FPDF_LINK* link_annot) { + if (!start_pos || !link_annot) return false; CPDF_Page* pPage = CPDFPageFromFPDFPage(page); if (!pPage || !pPage->m_pFormDict) @@ -342,35 +342,35 @@ FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFLink_Enumerate(FPDF_PAGE page, CPDF_Array* pAnnots = pPage->m_pFormDict->GetArrayFor("Annots"); if (!pAnnots) return false; - for (size_t i = *startPos; i < pAnnots->GetCount(); i++) { + for (size_t i = *start_pos; i < pAnnots->GetCount(); i++) { CPDF_Dictionary* pDict = ToDictionary(static_cast(pAnnots->GetDirectObjectAt(i))); if (!pDict) continue; if (pDict->GetStringFor("Subtype") == "Link") { - *startPos = static_cast(i + 1); - *linkAnnot = static_cast(pDict); + *start_pos = static_cast(i + 1); + *link_annot = static_cast(pDict); return true; } } return false; } -FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFLink_GetAnnotRect(FPDF_LINK linkAnnot, +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFLink_GetAnnotRect(FPDF_LINK link_annot, FS_RECTF* rect) { - if (!linkAnnot || !rect) + if (!link_annot || !rect) return false; CPDF_Dictionary* pAnnotDict = - ToDictionary(static_cast(linkAnnot)); + ToDictionary(static_cast(link_annot)); FSRECTFFromCFXFloatRect(pAnnotDict->GetRectFor("Rect"), rect); return true; } -FPDF_EXPORT int FPDF_CALLCONV FPDFLink_CountQuadPoints(FPDF_LINK linkAnnot) { - if (!linkAnnot) +FPDF_EXPORT int FPDF_CALLCONV FPDFLink_CountQuadPoints(FPDF_LINK link_annot) { + if (!link_annot) return 0; CPDF_Dictionary* pAnnotDict = - ToDictionary(static_cast(linkAnnot)); + ToDictionary(static_cast(link_annot)); CPDF_Array* pArray = pAnnotDict->GetArrayFor("QuadPoints"); if (!pArray) return 0; @@ -378,31 +378,31 @@ FPDF_EXPORT int FPDF_CALLCONV FPDFLink_CountQuadPoints(FPDF_LINK linkAnnot) { } FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV -FPDFLink_GetQuadPoints(FPDF_LINK linkAnnot, - int quadIndex, - FS_QUADPOINTSF* quadPoints) { - if (!linkAnnot || !quadPoints) +FPDFLink_GetQuadPoints(FPDF_LINK link_annot, + int quad_index, + FS_QUADPOINTSF* quad_points) { + if (!link_annot || !quad_points) return false; CPDF_Dictionary* pAnnotDict = - ToDictionary(static_cast(linkAnnot)); + ToDictionary(static_cast(link_annot)); CPDF_Array* pArray = pAnnotDict->GetArrayFor("QuadPoints"); if (!pArray) return false; - if (quadIndex < 0 || - static_cast(quadIndex) >= pArray->GetCount() / 8 || - (static_cast(quadIndex * 8 + 7) >= pArray->GetCount())) { + if (quad_index < 0 || + static_cast(quad_index) >= pArray->GetCount() / 8 || + (static_cast(quad_index * 8 + 7) >= pArray->GetCount())) { return false; } - quadPoints->x1 = pArray->GetNumberAt(quadIndex * 8); - quadPoints->y1 = pArray->GetNumberAt(quadIndex * 8 + 1); - quadPoints->x2 = pArray->GetNumberAt(quadIndex * 8 + 2); - quadPoints->y2 = pArray->GetNumberAt(quadIndex * 8 + 3); - quadPoints->x3 = pArray->GetNumberAt(quadIndex * 8 + 4); - quadPoints->y3 = pArray->GetNumberAt(quadIndex * 8 + 5); - quadPoints->x4 = pArray->GetNumberAt(quadIndex * 8 + 6); - quadPoints->y4 = pArray->GetNumberAt(quadIndex * 8 + 7); + quad_points->x1 = pArray->GetNumberAt(quad_index * 8); + quad_points->y1 = pArray->GetNumberAt(quad_index * 8 + 1); + quad_points->x2 = pArray->GetNumberAt(quad_index * 8 + 2); + quad_points->y2 = pArray->GetNumberAt(quad_index * 8 + 3); + quad_points->x3 = pArray->GetNumberAt(quad_index * 8 + 4); + quad_points->y3 = pArray->GetNumberAt(quad_index * 8 + 5); + quad_points->x4 = pArray->GetNumberAt(quad_index * 8 + 6); + quad_points->y4 = pArray->GetNumberAt(quad_index * 8 + 7); return true; } diff --git a/public/fpdf_annot.h b/public/fpdf_annot.h index d5ef54cf3b..f4dc03a2c4 100644 --- a/public/fpdf_annot.h +++ b/public/fpdf_annot.h @@ -302,24 +302,24 @@ FPDFAnnot_HasAttachmentPoints(FPDF_ANNOTATION annot); // with quadpoints, then update the bounding box too if the new quadpoints // define a bigger one. // -// annot - handle to an annotation. -// quadPoints - the quadpoints to be set. +// annot - handle to an annotation. +// quad_points - the quadpoints to be set. // // Returns true if successful. FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFAnnot_SetAttachmentPoints(FPDF_ANNOTATION annot, - const FS_QUADPOINTSF* quadPoints); + const FS_QUADPOINTSF* quad_points); // Experimental API. // Get the attachment points (i.e. quadpoints) of an annotation. // -// annot - handle to an annotation. -// quadPoints - receives the quadpoints; must not be NULL. +// annot - handle to an annotation. +// quad_points - receives the quadpoints; must not be NULL. // // Returns true if successful. FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFAnnot_GetAttachmentPoints(FPDF_ANNOTATION annot, - FS_QUADPOINTSF* quadPoints); + FS_QUADPOINTSF* quad_points); // Experimental API. // Set the annotation rectangle defining the location of the annotation. If the diff --git a/public/fpdf_doc.h b/public/fpdf_doc.h index 9181cbc9e5..67a4108531 100644 --- a/public/fpdf_doc.h +++ b/public/fpdf_doc.h @@ -93,7 +93,7 @@ FPDFBookmark_GetTitle(FPDF_BOOKMARK bookmark, // // Returns the handle to the bookmark, or NULL if |title| can't be found. // -// |FPDFBookmark_Find| will always return the first bookmark found even if +// FPDFBookmark_Find() will always return the first bookmark found even if // multiple bookmarks have the same |title|. FPDF_EXPORT FPDF_BOOKMARK FPDF_CALLCONV FPDFBookmark_Find(FPDF_DOCUMENT document, FPDF_WIDESTRING title); @@ -113,7 +113,7 @@ FPDFBookmark_GetDest(FPDF_DOCUMENT document, FPDF_BOOKMARK bookmark); // bookmark - handle to the bookmark. // // Returns the handle to the action data, or NULL if no action is associated -// with |bookmark|. When NULL is returned, |FPDFBookmark_GetDest| should be +// with |bookmark|. When NULL is returned, FPDFBookmark_GetDest() should be // called to get the |bookmark| destination data. FPDF_EXPORT FPDF_ACTION FPDF_CALLCONV FPDFBookmark_GetAction(FPDF_BOOKMARK bookmark); @@ -139,8 +139,8 @@ FPDF_EXPORT unsigned long FPDF_CALLCONV FPDFAction_GetType(FPDF_ACTION action); // Returns a handle to the destination data. // // In the case of |PDFACTION_REMOTEGOTO|, you should first call -// |FPDFAction_GetFilePath| then load that document, the document handle from -// that document should pass as |document| to |FPDFAction_GetDest|. +// FPDFAction_GetFilePath() then load that document, the document handle from +// that document should pass as |document| to FPDFAction_GetDest(). FPDF_EXPORT FPDF_DEST FPDF_CALLCONV FPDFAction_GetDest(FPDF_DOCUMENT document, FPDF_ACTION action); @@ -243,7 +243,7 @@ FPDFDest_GetLocationInPage(FPDF_DEST dest, // Returns a handle to the link, or NULL if no link found at the given point. // // You can convert coordinates from screen coordinates to page coordinates using -// |FPDF_DeviceToPage|. +// FPDF_DeviceToPage(). FPDF_EXPORT FPDF_LINK FPDF_CALLCONV FPDFLink_GetLinkAtPoint(FPDF_PAGE page, double x, double y); @@ -258,7 +258,7 @@ FPDF_EXPORT FPDF_LINK FPDF_CALLCONV FPDFLink_GetLinkAtPoint(FPDF_PAGE page, // Larger Z-order numbers are closer to the front. // // You can convert coordinates from screen coordinates to page coordinates using -// |FPDF_DeviceToPage|. +// FPDF_DeviceToPage(). FPDF_EXPORT int FPDF_CALLCONV FPDFLink_GetLinkZOrderAtPoint(FPDF_PAGE page, double x, double y); @@ -269,7 +269,7 @@ FPDF_EXPORT int FPDF_CALLCONV FPDFLink_GetLinkZOrderAtPoint(FPDF_PAGE page, // link - handle to the link. // // Returns a handle to the destination, or NULL if there is no destination -// associated with the link. In this case, you should call |FPDFLink_GetAction| +// associated with the link. In this case, you should call FPDFLink_GetAction() // to retrieve the action associated with |link|. FPDF_EXPORT FPDF_DEST FPDF_CALLCONV FPDFLink_GetDest(FPDF_DOCUMENT document, FPDF_LINK link); @@ -283,43 +283,43 @@ FPDF_EXPORT FPDF_ACTION FPDF_CALLCONV FPDFLink_GetAction(FPDF_LINK link); // Enumerates all the link annotations in |page|. // -// page - handle to the page. -// startPos - the start position, should initially be 0 and is updated with -// the next start position on return. -// linkAnnot - the link handle for |startPos|. +// page - handle to the page. +// start_pos - the start position, should initially be 0 and is updated with +// the next start position on return. +// link_annot - the link handle for |startPos|. // // Returns TRUE on success. FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFLink_Enumerate(FPDF_PAGE page, - int* startPos, - FPDF_LINK* linkAnnot); + int* start_pos, + FPDF_LINK* link_annot); -// Get the rectangle for |linkAnnot|. +// Get the rectangle for |link_annot|. // -// linkAnnot - handle to the link annotation. -// rect - the annotation rectangle. +// link_annot - handle to the link annotation. +// rect - the annotation rectangle. // // Returns true on success. -FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFLink_GetAnnotRect(FPDF_LINK linkAnnot, +FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFLink_GetAnnotRect(FPDF_LINK link_annot, FS_RECTF* rect); -// Get the count of quadrilateral points to the |linkAnnot|. +// Get the count of quadrilateral points to the |link_annot|. // -// linkAnnot - handle to the link annotation. +// link_annot - handle to the link annotation. // // Returns the count of quadrilateral points. -FPDF_EXPORT int FPDF_CALLCONV FPDFLink_CountQuadPoints(FPDF_LINK linkAnnot); +FPDF_EXPORT int FPDF_CALLCONV FPDFLink_CountQuadPoints(FPDF_LINK link_annot); -// Get the quadrilateral points for the specified |quadIndex| in |linkAnnot|. +// Get the quadrilateral points for the specified |quad_index| in |link_annot|. // -// linkAnnot - handle to the link annotation. -// quadIndex - the specified quad point index. -// quadPoints - receives the quadrilateral points. +// link_annot - handle to the link annotation. +// quad_index - the specified quad point index. +// quad_points - receives the quadrilateral points. // // Returns true on success. FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV -FPDFLink_GetQuadPoints(FPDF_LINK linkAnnot, - int quadIndex, - FS_QUADPOINTSF* quadPoints); +FPDFLink_GetQuadPoints(FPDF_LINK link_annot, + int quad_index, + FS_QUADPOINTSF* quad_points); // Get meta-data |tag| content from |document|. // diff --git a/public/fpdf_text.h b/public/fpdf_text.h index 043dc169c9..3502337443 100644 --- a/public/fpdf_text.h +++ b/public/fpdf_text.h @@ -222,9 +222,9 @@ FPDF_EXPORT int FPDF_CALLCONV FPDFText_CountRects(FPDF_TEXTPAGE text_page, // bottom boundary. // Return Value: // On success, return TRUE and fill in |left|, |top|, |right|, and -// |bottom|. If |link_page| is invalid then return FALSE, and the out -// parameters remain unmodified. If |link_page| is valid but -// |link_index| is out of bounds, then return FALSE and set the out +// |bottom|. If |text_page| is invalid then return FALSE, and the out +// parameters remain unmodified. If |text_page| is valid but +// |rect_index| is out of bounds, then return FALSE and set the out // parameters to 0. // FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFText_GetRect(FPDF_TEXTPAGE text_page, -- cgit v1.2.3