summaryrefslogtreecommitdiff
path: root/fpdfsdk/formfiller
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2017-03-22 17:41:02 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-03-23 01:04:48 +0000
commita8c2b919f7adec510cbca49675ad4a0cd0d30fd9 (patch)
treeaf385e573c920ded6ca2e6488101477f626cab43 /fpdfsdk/formfiller
parentd9d20a47e2c9af8630536786d614eaed229056a8 (diff)
downloadpdfium-a8c2b919f7adec510cbca49675ad4a0cd0d30fd9.tar.xz
Remove dead CFX_Edit code and fix some typos.
Change-Id: Ieaac36e06db3d1e2b857d999a7d3d9cd5c5a9506 Reviewed-on: https://pdfium-review.googlesource.com/3118 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fpdfsdk/formfiller')
-rw-r--r--fpdfsdk/formfiller/cffl_combobox.cpp24
-rw-r--r--fpdfsdk/formfiller/cffl_textfield.cpp24
2 files changed, 24 insertions, 24 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() {
diff --git a/fpdfsdk/formfiller/cffl_textfield.cpp b/fpdfsdk/formfiller/cffl_textfield.cpp
index 91db0959db..19a87d04ae 100644
--- a/fpdfsdk/formfiller/cffl_textfield.cpp
+++ b/fpdfsdk/formfiller/cffl_textfield.cpp
@@ -271,16 +271,16 @@ bool CFFL_TextField::IsFieldFull(CPDFSDK_PageView* pPageView) {
void CFFL_TextField::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);
}