diff options
author | Tom Sepez <tsepez@chromium.org> | 2017-01-30 11:00:19 -0800 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-01-30 19:26:03 +0000 |
commit | 6db6df7735febef44a8b82ed2bd3ff038d4b8698 (patch) | |
tree | 16a0c6a98523563da91079d518b9b9265a980d48 /fpdfsdk/formfiller/cffl_listbox.cpp | |
parent | f716f0bd85cabfa02cea1d092890a0dea67ef0e3 (diff) | |
download | pdfium-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>
Diffstat (limited to 'fpdfsdk/formfiller/cffl_listbox.cpp')
-rw-r--r-- | fpdfsdk/formfiller/cffl_listbox.cpp | 25 |
1 files changed, 15 insertions, 10 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, |