summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/fpdfdoc.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-03-05 16:30:09 -0800
committerTom Sepez <tsepez@chromium.org>2015-03-05 16:30:09 -0800
commit624b6c1e0fc6a5b0467061ef37b6db6856681afb (patch)
tree8b1083b0b3f167da7fa7747ab530a9b37dab44b7 /fpdfsdk/src/fpdfdoc.cpp
parent61c25eebf5a0fcf44dd1a434c88f502a34073eac (diff)
downloadpdfium-624b6c1e0fc6a5b0467061ef37b6db6856681afb.tar.xz
Make conversion between CPDF_Action and its dictionary explicit.
Precursor to taking a second shot at cleaning up the FPDF_* APIs. A FPDF_Action is a CPDF_Dictionary, and a CPDF_Action is a structure holding a FPDF_Action. 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, etc. Also tidy fpdf_actionhandler.cpp because it bugs me. R=thestig@chromium.org Review URL: https://codereview.chromium.org/984773002
Diffstat (limited to 'fpdfsdk/src/fpdfdoc.cpp')
-rw-r--r--fpdfsdk/src/fpdfdoc.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/fpdfsdk/src/fpdfdoc.cpp b/fpdfsdk/src/fpdfdoc.cpp
index e1ed3bcbfa..f21d5cf938 100644
--- a/fpdfsdk/src/fpdfdoc.cpp
+++ b/fpdfsdk/src/fpdfdoc.cpp
@@ -97,14 +97,14 @@ DLLEXPORT FPDF_ACTION STDCALL FPDFBookmark_GetAction(FPDF_BOOKMARK pDict)
if (!pDict)
return NULL;
CPDF_Bookmark bookmark((CPDF_Dictionary*)pDict);
- return bookmark.GetAction();
+ return bookmark.GetAction().GetDict();
}
DLLEXPORT unsigned long STDCALL FPDFAction_GetType(FPDF_ACTION pDict)
{
if (!pDict)
return 0;
- CPDF_Action action = (CPDF_Dictionary*)pDict;
+ CPDF_Action action((CPDF_Dictionary*)pDict);
CPDF_Action::ActionType type = action.GetType();
switch (type) {
case CPDF_Action::GoTo:
@@ -128,7 +128,7 @@ DLLEXPORT FPDF_DEST STDCALL FPDFAction_GetDest(FPDF_DOCUMENT document, FPDF_ACTI
if (!pDict)
return NULL;
CPDF_Document* pDoc = (CPDF_Document*)document;
- CPDF_Action action = (CPDF_Dictionary*)pDict;
+ CPDF_Action action((CPDF_Dictionary*)pDict);
return action.GetDest(pDoc);
}
@@ -140,7 +140,7 @@ DLLEXPORT unsigned long STDCALL FPDFAction_GetURIPath(FPDF_DOCUMENT document, FP
if (!pDict)
return 0;
CPDF_Document* pDoc = (CPDF_Document*)document;
- CPDF_Action action = (CPDF_Dictionary*)pDict;
+ CPDF_Action action((CPDF_Dictionary*)pDict);
CFX_ByteString path = action.GetURI(pDoc);
unsigned long len = path.GetLength() + 1;
if (buffer != NULL && buflen >= len)
@@ -203,7 +203,7 @@ DLLEXPORT FPDF_ACTION STDCALL FPDFLink_GetAction(FPDF_LINK pDict)
if (!pDict)
return NULL;
CPDF_Link link = (CPDF_Dictionary*)pDict;
- return link.GetAction();
+ return link.GetAction().GetDict();
}
DLLEXPORT FPDF_BOOL STDCALL FPDFLink_Enumerate(FPDF_PAGE page, int* startPos, FPDF_LINK* linkAnnot)