From ac8d1e75645d783cc72d2cfd57554e48e3ed2999 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Fri, 6 Mar 2015 10:52:05 -0800 Subject: Merge to XFA: Make conversion between CPDF_Dest and its object explicit. Original Review URL: https://codereview.chromium.org/984703004 TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/984143002 --- fpdfsdk/src/fpdfdoc.cpp | 12 ++++++------ fpdfsdk/src/fsdk_actionhandler.cpp | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'fpdfsdk') diff --git a/fpdfsdk/src/fpdfdoc.cpp b/fpdfsdk/src/fpdfdoc.cpp index 9e4267ffc7..e89a7aa294 100644 --- a/fpdfsdk/src/fpdfdoc.cpp +++ b/fpdfsdk/src/fpdfdoc.cpp @@ -86,12 +86,12 @@ DLLEXPORT FPDF_DEST STDCALL FPDFBookmark_GetDest(FPDF_DOCUMENT document, FPDF_BO CPDF_Document* pDoc = ((CPDFXFA_Document*)document)->GetPDFDoc(); CPDF_Dest dest = bookmark.GetDest(pDoc); if (dest) - return dest; + return dest.GetObject(); // If this bookmark is not directly associated with a dest, we try to get action CPDF_Action action = bookmark.GetAction(); if (!action) return NULL; - return action.GetDest(pDoc); + return action.GetDest(pDoc).GetObject(); } DLLEXPORT FPDF_ACTION STDCALL FPDFBookmark_GetAction(FPDF_BOOKMARK pDict) @@ -131,7 +131,7 @@ DLLEXPORT FPDF_DEST STDCALL FPDFAction_GetDest(FPDF_DOCUMENT document, FPDF_ACTI return NULL; CPDF_Document* pDoc = ((CPDFXFA_Document*)document)->GetPDFDoc(); CPDF_Action action((CPDF_Dictionary*)pDict); - return action.GetDest(pDoc); + return action.GetDest(pDoc).GetObject(); } DLLEXPORT unsigned long STDCALL FPDFAction_GetURIPath(FPDF_DOCUMENT document, FPDF_ACTION pDict, @@ -157,7 +157,7 @@ DLLEXPORT unsigned long STDCALL FPDFDest_GetPageIndex(FPDF_DOCUMENT document, FP if (!pDict) return 0; CPDF_Document* pDoc = ((CPDFXFA_Document*)document)->GetPDFDoc(); - CPDF_Dest dest = (CPDF_Array*)pDict; + CPDF_Dest dest((CPDF_Array*)pDict); return dest.GetPageIndex(pDoc); } @@ -192,14 +192,14 @@ DLLEXPORT FPDF_DEST STDCALL FPDFLink_GetDest(FPDF_DOCUMENT document, FPDF_LINK p return NULL; CPDF_Link link = (CPDF_Dictionary*)pDict; - FPDF_DEST dest = link.GetDest(pDoc); + FPDF_DEST dest = link.GetDest(pDoc).GetObject(); if (dest) return dest; // If this link is not directly associated with a dest, we try to get action CPDF_Action action = link.GetAction(); if (!action) return NULL; - return action.GetDest(pDoc); + return action.GetDest(pDoc).GetObject(); } DLLEXPORT FPDF_ACTION STDCALL FPDFLink_GetAction(FPDF_LINK pDict) diff --git a/fpdfsdk/src/fsdk_actionhandler.cpp b/fpdfsdk/src/fsdk_actionhandler.cpp index 5fd6c54209..6f8ea0c60f 100644 --- a/fpdfsdk/src/fsdk_actionhandler.cpp +++ b/fpdfsdk/src/fsdk_actionhandler.cpp @@ -565,7 +565,7 @@ void CPDFSDK_ActionHandler::DoAction_GoTo(CPDFSDK_Document* pDocument, CPDF_Dest MyDest = action.GetDest(pPDFDocument); int nPageIndex = MyDest.GetPageIndex(pPDFDocument); int nFitType = MyDest.GetZoomMode(); - const CPDF_Array * pMyArray = (CPDF_Array*)MyDest.m_pObj; + const CPDF_Array * pMyArray = (CPDF_Array*)MyDest.GetObject(); float* pPosAry = NULL; int sizeOfAry = 0; if (pMyArray != NULL) -- cgit v1.2.3