diff options
author | Lei Zhang <thestig@chromium.org> | 2015-12-22 13:49:44 -0800 |
---|---|---|
committer | Lei Zhang <thestig@chromium.org> | 2015-12-22 13:49:44 -0800 |
commit | cd2bb30aba89a05c0bbd4d6973fa070205e3a1e8 (patch) | |
tree | 0eca7841e7be4b9392bbcd0ffb656a8495f64792 /fpdfsdk/src/fsdk_mgr.cpp | |
parent | bc75f1737f7eb8d45c5a2ebd3ad78203782c1642 (diff) | |
download | pdfium-cd2bb30aba89a05c0bbd4d6973fa070205e3a1e8.tar.xz |
Merge to XFA: Add ContainsKey() and ContainsValue() and use them where appropriate.
TBR=ochang@chromium.org
Review URL: https://codereview.chromium.org/1540263003 .
(cherry picked from commit 1fc92867ca53f0fba4272fbee3814d844f487495)
Review URL: https://codereview.chromium.org/1542193002 .
Diffstat (limited to 'fpdfsdk/src/fsdk_mgr.cpp')
-rw-r--r-- | fpdfsdk/src/fsdk_mgr.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/fpdfsdk/src/fsdk_mgr.cpp b/fpdfsdk/src/fsdk_mgr.cpp index 5e847b78e5..e27823bea2 100644 --- a/fpdfsdk/src/fsdk_mgr.cpp +++ b/fpdfsdk/src/fsdk_mgr.cpp @@ -13,6 +13,7 @@ #include "fpdfsdk/include/javascript/IJavaScript.h" #include "public/fpdf_ext.h" #include "third_party/base/nonstd_unique_ptr.h" +#include "third_party/base/stl_util.h" #ifdef PDF_ENABLE_XFA #include "../include/fpdfxfa/fpdfxfa_app.h" @@ -772,9 +773,7 @@ CPDFSDK_Annot* CPDFSDK_PageView::GetFXWidgetAtPoint(FX_FLOAT pageX, void CPDFSDK_PageView::KillFocusAnnotIfNeeded() { // if there is a focused annot on the page, we should kill the focus first. if (CPDFSDK_Annot* focusedAnnot = m_pSDKDoc->GetFocusAnnot()) { - auto it = - std::find(m_fxAnnotArray.begin(), m_fxAnnotArray.end(), focusedAnnot); - if (it != m_fxAnnotArray.end()) + if (pdfium::ContainsValue(m_fxAnnotArray, focusedAnnot)) KillFocusAnnot(); } } @@ -1154,7 +1153,7 @@ bool CPDFSDK_PageView::IsValidAnnot(const CPDF_Annot* p) const { return false; const auto& annots = m_pAnnotList->All(); - return std::find(annots.begin(), annots.end(), p) != annots.end(); + return pdfium::ContainsValue(annots, p); } CPDFSDK_Annot* CPDFSDK_PageView::GetFocusAnnot() { |