OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #include "fpdfsdk/formfiller/cffl_combobox.h" | 7 #include "fpdfsdk/formfiller/cffl_combobox.h" |
8 | 8 |
9 #include "fpdfsdk/formfiller/cba_fontmap.h" | 9 #include "fpdfsdk/formfiller/cba_fontmap.h" |
10 #include "fpdfsdk/formfiller/cffl_formfiller.h" | 10 #include "fpdfsdk/formfiller/cffl_formfiller.h" |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 } | 250 } |
251 return FALSE; | 251 return FALSE; |
252 } | 252 } |
253 #endif // PDF_ENABLE_XFA | 253 #endif // PDF_ENABLE_XFA |
254 | 254 |
255 void CFFL_ComboBox::OnSetFocus(CPWL_Wnd* pWnd) { | 255 void CFFL_ComboBox::OnSetFocus(CPWL_Wnd* pWnd) { |
256 ASSERT(m_pApp); | 256 ASSERT(m_pApp); |
257 | 257 |
258 if (pWnd->GetClassName() == PWL_CLASSNAME_EDIT) { | 258 if (pWnd->GetClassName() == PWL_CLASSNAME_EDIT) { |
259 CPWL_Edit* pEdit = (CPWL_Edit*)pWnd; | 259 CPWL_Edit* pEdit = (CPWL_Edit*)pWnd; |
260 pEdit->SetCharSet(134); | 260 pEdit->SetCharSet(FXFONT_GB2312_CHARSET); |
261 pEdit->SetCodePage(936); | 261 pEdit->SetCodePage(936); |
262 | 262 |
263 pEdit->SetReadyToInput(); | 263 pEdit->SetReadyToInput(); |
264 CFX_WideString wsText = pEdit->GetText(); | 264 CFX_WideString wsText = pEdit->GetText(); |
265 int nCharacters = wsText.GetLength(); | 265 int nCharacters = wsText.GetLength(); |
266 CFX_ByteString bsUTFText = wsText.UTF16LE_Encode(); | 266 CFX_ByteString bsUTFText = wsText.UTF16LE_Encode(); |
267 unsigned short* pBuffer = (unsigned short*)bsUTFText.c_str(); | 267 unsigned short* pBuffer = (unsigned short*)bsUTFText.c_str(); |
268 m_pApp->FFI_OnSetFieldInputFocus(m_pWidget->GetFormField(), pBuffer, | 268 m_pApp->FFI_OnSetFieldInputFocus(m_pWidget->GetFormField(), pBuffer, |
269 nCharacters, TRUE); | 269 nCharacters, TRUE); |
270 | 270 |
(...skipping 22 matching lines...) Expand all Loading... |
293 if (nExport >= 0) { | 293 if (nExport >= 0) { |
294 if (CPDF_FormField* pFormField = m_pWidget->GetFormField()) { | 294 if (CPDF_FormField* pFormField = m_pWidget->GetFormField()) { |
295 swRet = pFormField->GetOptionValue(nExport); | 295 swRet = pFormField->GetOptionValue(nExport); |
296 if (swRet.IsEmpty()) | 296 if (swRet.IsEmpty()) |
297 swRet = pFormField->GetOptionLabel(nExport); | 297 swRet = pFormField->GetOptionLabel(nExport); |
298 } | 298 } |
299 } | 299 } |
300 | 300 |
301 return swRet; | 301 return swRet; |
302 } | 302 } |
OLD | NEW |