summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2017-01-30 11:00:19 -0800
committerChromium commit bot <commit-bot@chromium.org>2017-01-30 19:26:03 +0000
commit6db6df7735febef44a8b82ed2bd3ff038d4b8698 (patch)
tree16a0c6a98523563da91079d518b9b9265a980d48
parentf716f0bd85cabfa02cea1d092890a0dea67ef0e3 (diff)
downloadpdfium-6db6df7735febef44a8b82ed2bd3ff038d4b8698.tar.xz
Remove CFX_ArrayTemplate from CFFL_ListBox
Change-Id: Id7eac9163582d05bce3115408a66e63953d7093b Reviewed-on: https://pdfium-review.googlesource.com/2453 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
-rw-r--r--fpdfsdk/formfiller/cffl_listbox.cpp25
-rw-r--r--fpdfsdk/formfiller/cffl_listbox.h3
2 files changed, 17 insertions, 11 deletions
diff --git a/fpdfsdk/formfiller/cffl_listbox.cpp b/fpdfsdk/formfiller/cffl_listbox.cpp
index bc3bb6c4ab..556e0e17d7 100644
--- a/fpdfsdk/formfiller/cffl_listbox.cpp
+++ b/fpdfsdk/formfiller/cffl_listbox.cpp
@@ -167,20 +167,25 @@ void CFFL_ListBox::GetActionData(CPDFSDK_PageView* pPageView,
void CFFL_ListBox::SaveState(CPDFSDK_PageView* pPageView) {
ASSERT(pPageView);
- if (CPWL_ListBox* pListBox = (CPWL_ListBox*)GetPDFWindow(pPageView, false)) {
- for (int32_t i = 0, sz = pListBox->GetCount(); i < sz; i++) {
- if (pListBox->IsItemSelected(i)) {
- m_State.Add(i);
- }
- }
+ CPWL_ListBox* pListBox =
+ static_cast<CPWL_ListBox*>(GetPDFWindow(pPageView, false));
+ if (!pListBox)
+ return;
+
+ for (int32_t i = 0, sz = pListBox->GetCount(); i < sz; i++) {
+ if (pListBox->IsItemSelected(i))
+ m_State.push_back(i);
}
}
void CFFL_ListBox::RestoreState(CPDFSDK_PageView* pPageView) {
- if (CPWL_ListBox* pListBox = (CPWL_ListBox*)GetPDFWindow(pPageView, false)) {
- for (int i = 0, sz = m_State.GetSize(); i < sz; i++)
- pListBox->Select(m_State[i]);
- }
+ CPWL_ListBox* pListBox =
+ static_cast<CPWL_ListBox*>(GetPDFWindow(pPageView, false));
+ if (!pListBox)
+ return;
+
+ for (const auto& item : m_State)
+ pListBox->Select(item);
}
CPWL_Wnd* CFFL_ListBox::ResetPDFWindow(CPDFSDK_PageView* pPageView,
diff --git a/fpdfsdk/formfiller/cffl_listbox.h b/fpdfsdk/formfiller/cffl_listbox.h
index e97ede0deb..609f2c4809 100644
--- a/fpdfsdk/formfiller/cffl_listbox.h
+++ b/fpdfsdk/formfiller/cffl_listbox.h
@@ -9,6 +9,7 @@
#include <memory>
#include <set>
+#include <vector>
#include "fpdfsdk/formfiller/cffl_formfiller.h"
@@ -37,7 +38,7 @@ class CFFL_ListBox : public CFFL_FormFiller {
private:
std::unique_ptr<CBA_FontMap> m_pFontMap;
std::set<int> m_OriginSelections;
- CFX_ArrayTemplate<int> m_State;
+ std::vector<int> m_State;
};
#endif // FPDFSDK_FORMFILLER_CFFL_LISTBOX_H_