summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/fsdk_actionhandler.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2015-10-22 15:02:06 -0400
committerDan Sinclair <dsinclair@chromium.org>2015-10-22 15:02:06 -0400
commit2b11dc1220746d2f6f97a940fc9e4235c8ed4975 (patch)
treee25b2ba13112f4ead789260ee57fe5b40c13b83e /fpdfsdk/src/fsdk_actionhandler.cpp
parentbc6c6723c37772b02de9e6e43fa0fd9439874905 (diff)
downloadpdfium-2b11dc1220746d2f6f97a940fc9e4235c8ed4975.tar.xz
Merge to XFA: Add type cast definitions for CPDF_Array.
This Cl adds ToArray, CPDF_Object::AsArray and CPDF_Object::IsArray and updates the src to use them as needed. BUG=pdfium:201 R=thestig@chromium.org, tsepez@chromium.org Review URL: https://codereview.chromium.org/1417893003 . (cherry picked from commit c2bfc000e502c42c9a3017038fd9104c7997d126) Review URL: https://codereview.chromium.org/1419643005 .
Diffstat (limited to 'fpdfsdk/src/fsdk_actionhandler.cpp')
-rw-r--r--fpdfsdk/src/fsdk_actionhandler.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/fpdfsdk/src/fsdk_actionhandler.cpp b/fpdfsdk/src/fsdk_actionhandler.cpp
index feb9a85137..9d510b74c2 100644
--- a/fpdfsdk/src/fsdk_actionhandler.cpp
+++ b/fpdfsdk/src/fsdk_actionhandler.cpp
@@ -426,7 +426,7 @@ void CPDFSDK_ActionHandler::DoAction_NoJs(const CPDF_Action& action,
}
FX_BOOL CPDFSDK_ActionHandler::IsValidDocView(CPDFSDK_Document* pDocument) {
- ASSERT(pDocument != NULL);
+ ASSERT(pDocument);
return TRUE;
}
@@ -435,17 +435,15 @@ void CPDFSDK_ActionHandler::DoAction_GoTo(CPDFSDK_Document* pDocument,
ASSERT(action);
CPDF_Document* pPDFDocument = pDocument->GetDocument()->GetPDFDoc();
- ASSERT(pPDFDocument != NULL);
- CPDFDoc_Environment* pApp = pDocument->GetEnv();
- ASSERT(pApp != NULL);
+ ASSERT(pPDFDocument);
CPDF_Dest MyDest = action.GetDest(pPDFDocument);
int nPageIndex = MyDest.GetPageIndex(pPDFDocument);
int nFitType = MyDest.GetZoomMode();
- const CPDF_Array* pMyArray = (CPDF_Array*)MyDest.GetObject();
- float* pPosAry = NULL;
+ const CPDF_Array* pMyArray = ToArray(MyDest.GetObject());
+ float* pPosAry = nullptr;
int sizeOfAry = 0;
- if (pMyArray != NULL) {
+ if (pMyArray) {
pPosAry = new float[pMyArray->GetCount()];
int j = 0;
for (int i = 2; i < (int)pMyArray->GetCount(); i++) {
@@ -453,6 +451,8 @@ void CPDFSDK_ActionHandler::DoAction_GoTo(CPDFSDK_Document* pDocument,
}
sizeOfAry = j;
}
+
+ CPDFDoc_Environment* pApp = pDocument->GetEnv();
pApp->FFI_DoGoToAction(nPageIndex, nFitType, pPosAry, sizeOfAry);
delete[] pPosAry;
}