summaryrefslogtreecommitdiff
path: root/core/src/fpdfdoc/doc_link.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-03-06 12:37:13 -0800
committerTom Sepez <tsepez@chromium.org>2015-03-06 12:37:13 -0800
commit4cc9acb6ca21590b68044d189d276985883373e4 (patch)
tree9588d94757649025a44194541d3d265b191b5357 /core/src/fpdfdoc/doc_link.cpp
parentac8d1e75645d783cc72d2cfd57554e48e3ed2999 (diff)
downloadpdfium-4cc9acb6ca21590b68044d189d276985883373e4.tar.xz
Merge to XFA: Make conversions for CPDF_Link explicit.
Original Review URL: https://codereview.chromium.org/985503005 TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/985153002
Diffstat (limited to 'core/src/fpdfdoc/doc_link.cpp')
-rw-r--r--core/src/fpdfdoc/doc_link.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/core/src/fpdfdoc/doc_link.cpp b/core/src/fpdfdoc/doc_link.cpp
index b7c640af5e..4a42e21388 100644
--- a/core/src/fpdfdoc/doc_link.cpp
+++ b/core/src/fpdfdoc/doc_link.cpp
@@ -44,26 +44,26 @@ int CPDF_LinkList::CountLinks(CPDF_Page* pPage)
CPDF_Link CPDF_LinkList::GetLink(CPDF_Page* pPage, int index)
{
CFX_PtrArray* pPageLinkList = GetPageLinks(pPage);
- if (pPageLinkList == NULL) {
- return NULL;
+ if (!pPageLinkList) {
+ return CPDF_Link();
}
- return (CPDF_Dictionary*)pPageLinkList->GetAt(index);
+ return CPDF_Link((CPDF_Dictionary*)pPageLinkList->GetAt(index));
}
CPDF_Link CPDF_LinkList::GetLinkAtPoint(CPDF_Page* pPage, FX_FLOAT pdf_x, FX_FLOAT pdf_y)
{
CFX_PtrArray* pPageLinkList = GetPageLinks(pPage);
- if (pPageLinkList == NULL) {
- return NULL;
+ if (!pPageLinkList) {
+ return CPDF_Link();
}
int size = pPageLinkList->GetSize();
for (int i = size - 1; i >= 0; --i) {
- CPDF_Link Link = (CPDF_Dictionary*)pPageLinkList->GetAt(i);
- CPDF_Rect rect = Link.GetRect();
+ CPDF_Link link((CPDF_Dictionary*)pPageLinkList->GetAt(i));
+ CPDF_Rect rect = link.GetRect();
if (rect.Contains(pdf_x, pdf_y)) {
- return Link;
+ return link;
}
}
- return NULL;
+ return CPDF_Link();
}
void CPDF_LinkList::LoadPageLinks(CPDF_Page* pPage, CFX_PtrArray* pList)
{