summaryrefslogtreecommitdiff
path: root/fpdfsdk/formfiller/cffl_combobox.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/formfiller/cffl_combobox.cpp')
-rw-r--r--fpdfsdk/formfiller/cffl_combobox.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/fpdfsdk/formfiller/cffl_combobox.cpp b/fpdfsdk/formfiller/cffl_combobox.cpp
index c8438a3a28..7a6d497ad2 100644
--- a/fpdfsdk/formfiller/cffl_combobox.cpp
+++ b/fpdfsdk/formfiller/cffl_combobox.cpp
@@ -263,18 +263,18 @@ bool CFFL_ComboBox::IsFieldFull(CPDFSDK_PageView* pPageView) {
void CFFL_ComboBox::OnSetFocus(CPWL_Wnd* pWnd) {
ASSERT(m_pFormFillEnv);
- if (pWnd->GetClassName() == PWL_CLASSNAME_EDIT) {
- CPWL_Edit* pEdit = (CPWL_Edit*)pWnd;
- pEdit->SetCharSet(FXFONT_GB2312_CHARSET);
- pEdit->SetCodePage(936);
-
- pEdit->SetReadyToInput();
- CFX_WideString wsText = pEdit->GetText();
- int nCharacters = wsText.GetLength();
- CFX_ByteString bsUTFText = wsText.UTF16LE_Encode();
- unsigned short* pBuffer = (unsigned short*)bsUTFText.c_str();
- m_pFormFillEnv->OnSetFieldInputFocus(pBuffer, nCharacters, true);
- }
+ if (pWnd->GetClassName() != PWL_CLASSNAME_EDIT)
+ return;
+
+ CPWL_Edit* pEdit = (CPWL_Edit*)pWnd;
+ pEdit->SetCharSet(FXFONT_GB2312_CHARSET);
+ pEdit->SetReadyToInput();
+
+ CFX_WideString wsText = pEdit->GetText();
+ int nCharacters = wsText.GetLength();
+ CFX_ByteString bsUTFText = wsText.UTF16LE_Encode();
+ auto* pBuffer = reinterpret_cast<const unsigned short*>(bsUTFText.c_str());
+ m_pFormFillEnv->OnSetFieldInputFocus(pBuffer, nCharacters, true);
}
CFX_WideString CFFL_ComboBox::GetSelectExportText() {