Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(91)

Unified Diff: fpdfsdk/src/fsdk_actionhandler.cpp

Issue 1419643005: Merge to XFA: Add type cast definitions for CPDF_Array. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « fpdfsdk/src/fpdfview.cpp ('k') | fpdfsdk/src/fsdk_mgr.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/src/fsdk_actionhandler.cpp
diff --git a/fpdfsdk/src/fsdk_actionhandler.cpp b/fpdfsdk/src/fsdk_actionhandler.cpp
index feb9a85137f536b7b39e5b82a52c8ea89f810556..9d510b74c26e86e74b1fbec64c696b061fb9c6d9 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();
dsinclair 2015/10/22 13:39:29 Merge conflict: master branch: pDocument->GetDocu
- 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;
}
« no previous file with comments | « fpdfsdk/src/fpdfview.cpp ('k') | fpdfsdk/src/fsdk_mgr.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698