summaryrefslogtreecommitdiff
path: root/fpdfsdk
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-08-27 18:57:36 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-08-27 18:57:36 +0000
commit76525c4a9d2aa6d1f2685d8483e3d491fd361df1 (patch)
treed2c389924eaaebd1f8df7d78fd50a0e3fcf76ac2 /fpdfsdk
parent2e6d2b5ca1637242794bf13ad980317d39dd7790 (diff)
downloadpdfium-76525c4a9d2aa6d1f2685d8483e3d491fd361df1.tar.xz
Remove unnecessary ToArray() calls and locals in CPDF_Dest.chromium/3535
Rename GetObject() to GetArray() and remove more ToArray() calls. Change-Id: I754ca72b32c085e1801d3cedcd291ce4d2682359 Reviewed-on: https://pdfium-review.googlesource.com/41353 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fpdfsdk')
-rw-r--r--fpdfsdk/cpdfsdk_actionhandler.cpp2
-rw-r--r--fpdfsdk/fpdf_doc.cpp12
2 files changed, 7 insertions, 7 deletions
diff --git a/fpdfsdk/cpdfsdk_actionhandler.cpp b/fpdfsdk/cpdfsdk_actionhandler.cpp
index 64d82b93ba..f951bfb9fe 100644
--- a/fpdfsdk/cpdfsdk_actionhandler.cpp
+++ b/fpdfsdk/cpdfsdk_actionhandler.cpp
@@ -364,7 +364,7 @@ void CPDFSDK_ActionHandler::DoAction_GoTo(
CPDF_Dest MyDest = action.GetDest(pPDFDocument);
int nPageIndex = MyDest.GetDestPageIndex(pPDFDocument);
int nFitType = MyDest.GetZoomMode();
- const CPDF_Array* pMyArray = ToArray(MyDest.GetObject());
+ const CPDF_Array* pMyArray = MyDest.GetArray();
std::vector<float> posArray;
if (pMyArray) {
for (size_t i = 2; i < pMyArray->GetCount(); i++)
diff --git a/fpdfsdk/fpdf_doc.cpp b/fpdfsdk/fpdf_doc.cpp
index 1f0d4f27e0..d3c8e23818 100644
--- a/fpdfsdk/fpdf_doc.cpp
+++ b/fpdfsdk/fpdf_doc.cpp
@@ -121,14 +121,14 @@ FPDF_EXPORT FPDF_DEST FPDF_CALLCONV FPDFBookmark_GetDest(FPDF_DOCUMENT document,
return nullptr;
CPDF_Bookmark bookmark(CPDFDictionaryFromFPDFBookmark(pDict));
CPDF_Dest dest = bookmark.GetDest(pDoc);
- if (dest.GetObject())
- return FPDFDestFromCPDFArray(dest.GetObject());
+ if (dest.GetArray())
+ return FPDFDestFromCPDFArray(dest.GetArray());
// If this bookmark is not directly associated with a dest, we try to get
// action
CPDF_Action action = bookmark.GetAction();
if (!action.GetDict())
return nullptr;
- return FPDFDestFromCPDFArray(action.GetDest(pDoc).GetObject());
+ return FPDFDestFromCPDFArray(action.GetDest(pDoc).GetArray());
}
FPDF_EXPORT FPDF_ACTION FPDF_CALLCONV
@@ -167,7 +167,7 @@ FPDF_EXPORT FPDF_DEST FPDF_CALLCONV FPDFAction_GetDest(FPDF_DOCUMENT document,
if (!pDoc)
return nullptr;
CPDF_Action action(CPDFDictionaryFromFPDFAction(pDict));
- return FPDFDestFromCPDFArray(action.GetDest(pDoc).GetObject());
+ return FPDFDestFromCPDFArray(action.GetDest(pDoc).GetArray());
}
FPDF_EXPORT unsigned long FPDF_CALLCONV
@@ -302,14 +302,14 @@ FPDF_EXPORT FPDF_DEST FPDF_CALLCONV FPDFLink_GetDest(FPDF_DOCUMENT document,
if (!pDoc)
return nullptr;
CPDF_Link link(CPDFDictionaryFromFPDFLink(pDict));
- FPDF_DEST dest = FPDFDestFromCPDFArray(link.GetDest(pDoc).GetObject());
+ FPDF_DEST dest = FPDFDestFromCPDFArray(link.GetDest(pDoc).GetArray());
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.GetDict())
return nullptr;
- return FPDFDestFromCPDFArray(action.GetDest(pDoc).GetObject());
+ return FPDFDestFromCPDFArray(action.GetDest(pDoc).GetArray());
}
FPDF_EXPORT FPDF_ACTION FPDF_CALLCONV FPDFLink_GetAction(FPDF_LINK pDict) {