From 4f7bc04ed64edbf72f49b2189f85bb88f0b547c7 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Mon, 27 Apr 2015 12:06:58 -0700 Subject: Merge to XFA: Reduce usage of operator LPCWSTR from CFX_WideString(). Original Review URL: https://codereview.chromium.org/1101933003 TBR=brucedawson@chromium.org Review URL: https://codereview.chromium.org/1108903002 --- fpdfsdk/src/formfiller/FFL_ComboBox.cpp | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'fpdfsdk/src/formfiller/FFL_ComboBox.cpp') diff --git a/fpdfsdk/src/formfiller/FFL_ComboBox.cpp b/fpdfsdk/src/formfiller/FFL_ComboBox.cpp index 2607a76b5c..a86c2520b3 100644 --- a/fpdfsdk/src/formfiller/FFL_ComboBox.cpp +++ b/fpdfsdk/src/formfiller/FFL_ComboBox.cpp @@ -77,28 +77,23 @@ CPWL_Wnd* CFFL_ComboBox::NewPDFWindow(const PWL_CREATEPARAM& cp, CPDFSDK_PageVie pWnd->AttachFFLData(this); pWnd->Create(cp); - ASSERT(m_pApp != NULL); CFFL_IFormFiller* pFormFiller = m_pApp->GetIFormFiller(); pWnd->SetFillerNotify(pFormFiller); - ASSERT(m_pWidget != NULL); FX_INT32 nCurSel = m_pWidget->GetSelectedIndex(0); - CFX_WideString swText; - if (nCurSel < 0) swText = m_pWidget->GetValue(); else swText = m_pWidget->GetOptionLabel(nCurSel); - + for (FX_INT32 i=0,sz=m_pWidget->CountOptions(); iAddString(m_pWidget->GetOptionLabel(i)); + pWnd->AddString(m_pWidget->GetOptionLabel(i).c_str()); } - + pWnd->SetSelect(nCurSel); - pWnd->SetText(swText); - + pWnd->SetText(swText.c_str()); return pWnd; } @@ -245,7 +240,7 @@ void CFFL_ComboBox::SetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AAc if (CPWL_Edit* pEdit = (CPWL_Edit*)*pComboBox) { pEdit->SetSel(fa.nSelStart, fa.nSelEnd); - pEdit->ReplaceSel(fa.sChange); + pEdit->ReplaceSel(fa.sChange.c_str()); } } break; @@ -297,7 +292,7 @@ void CFFL_ComboBox::RestoreState(CPDFSDK_PageView* pPageView) { if (CPWL_Edit* pEdit = (CPWL_Edit*)*pComboBox) { - pEdit->SetText(m_State.sValue); + pEdit->SetText(m_State.sValue.c_str()); pEdit->SetSel(m_State.nStart, m_State.nEnd); } } -- cgit v1.2.3