summaryrefslogtreecommitdiff
path: root/fpdfsdk
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-03-06 12:28:34 -0800
committerTom Sepez <tsepez@chromium.org>2015-03-06 12:28:34 -0800
commit0700106e13b84781c86398bb5e2b5dd3ed894007 (patch)
tree4037c37f3bfb07279ec7547a009641a3e4754eb3 /fpdfsdk
parent8842c6214cf70fa4237d17684cc9f609536c0240 (diff)
downloadpdfium-0700106e13b84781c86398bb5e2b5dd3ed894007.tar.xz
Make conversions for CPDF_Link explicit.
Precursor to taking a second shot at cleaning up the FPDF_* APIs. A FPDF_LINK is a CPDF_Dictionary, and a CPDF_Link is a structure holding a FPDF_LINK. This goes against the convention that FPDF_ types get cast to CPDF_* types, so we want to make it clear where objects are getting constructed. R=thestig@chromium.org Review URL: https://codereview.chromium.org/985503005
Diffstat (limited to 'fpdfsdk')
-rw-r--r--fpdfsdk/src/fpdfdoc.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/fpdfsdk/src/fpdfdoc.cpp b/fpdfsdk/src/fpdfdoc.cpp
index ab3dd2c5b8..d1f741bca9 100644
--- a/fpdfsdk/src/fpdfdoc.cpp
+++ b/fpdfsdk/src/fpdfdoc.cpp
@@ -176,18 +176,17 @@ DLLEXPORT FPDF_LINK STDCALL FPDFLink_GetLinkAtPoint(FPDF_PAGE page, double x, do
pLinkList = FX_NEW CPDF_LinkList(pDoc);
pDoc->SetPrivateData(&THISMODULE, pLinkList, ReleaseLinkList);
}
- return pLinkList->GetLinkAtPoint(pPage, (FX_FLOAT)x, (FX_FLOAT)y);
+ return pLinkList->GetLinkAtPoint(pPage, (FX_FLOAT)x, (FX_FLOAT)y).GetDict();
}
DLLEXPORT FPDF_DEST STDCALL FPDFLink_GetDest(FPDF_DOCUMENT document, FPDF_LINK pDict)
{
if (!document)
return NULL;
- CPDF_Document* pDoc = (CPDF_Document*)document;
if (!pDict)
return NULL;
- CPDF_Link link = (CPDF_Dictionary*)pDict;
-
+ CPDF_Document* pDoc = (CPDF_Document*)document;
+ CPDF_Link link((CPDF_Dictionary*)pDict);
FPDF_DEST dest = link.GetDest(pDoc).GetObject();
if (dest)
return dest;
@@ -202,7 +201,7 @@ DLLEXPORT FPDF_ACTION STDCALL FPDFLink_GetAction(FPDF_LINK pDict)
{
if (!pDict)
return NULL;
- CPDF_Link link = (CPDF_Dictionary*)pDict;
+ CPDF_Link link((CPDF_Dictionary*)pDict);
return link.GetAction().GetDict();
}