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/include/formfiller/FFL_CBA_Fontmap.h" | 7 #include "fpdfsdk/include/formfiller/FFL_CBA_Fontmap.h" |
8 #include "fpdfsdk/include/formfiller/FFL_TextField.h" | 8 #include "fpdfsdk/include/formfiller/FFL_TextField.h" |
9 | 9 |
10 /* ------------------------------- CFFL_TextField | 10 /* ------------------------------- CFFL_TextField |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 } | 269 } |
270 | 270 |
271 #ifdef PDF_ENABLE_XFA | 271 #ifdef PDF_ENABLE_XFA |
272 FX_BOOL CFFL_TextField::IsFieldFull(CPDFSDK_PageView* pPageView) { | 272 FX_BOOL CFFL_TextField::IsFieldFull(CPDFSDK_PageView* pPageView) { |
273 if (CPWL_Edit* pWnd = (CPWL_Edit*)GetPDFWindow(pPageView, FALSE)) { | 273 if (CPWL_Edit* pWnd = (CPWL_Edit*)GetPDFWindow(pPageView, FALSE)) { |
274 return pWnd->IsTextFull(); | 274 return pWnd->IsTextFull(); |
275 } | 275 } |
276 | 276 |
277 return FALSE; | 277 return FALSE; |
278 } | 278 } |
| 279 #endif // PDF_ENABLE_XFA |
279 | 280 |
280 #endif | |
281 void CFFL_TextField::OnSetFocus(CPWL_Wnd* pWnd) { | 281 void CFFL_TextField::OnSetFocus(CPWL_Wnd* pWnd) { |
282 ASSERT(m_pApp != NULL); | 282 ASSERT(m_pApp != NULL); |
283 | 283 |
284 ASSERT(pWnd != NULL); | 284 ASSERT(pWnd != NULL); |
285 | 285 |
286 if (pWnd->GetClassName() == PWL_CLASSNAME_EDIT) { | 286 if (pWnd->GetClassName() == PWL_CLASSNAME_EDIT) { |
287 CPWL_Edit* pEdit = (CPWL_Edit*)pWnd; | 287 CPWL_Edit* pEdit = (CPWL_Edit*)pWnd; |
288 pEdit->SetCharSet(134); | 288 pEdit->SetCharSet(134); |
289 pEdit->SetCodePage(936); | 289 pEdit->SetCodePage(936); |
290 | 290 |
291 pEdit->SetReadyToInput(); | 291 pEdit->SetReadyToInput(); |
292 CFX_WideString wsText = pEdit->GetText(); | 292 CFX_WideString wsText = pEdit->GetText(); |
293 int nCharacters = wsText.GetLength(); | 293 int nCharacters = wsText.GetLength(); |
294 CFX_ByteString bsUTFText = wsText.UTF16LE_Encode(); | 294 CFX_ByteString bsUTFText = wsText.UTF16LE_Encode(); |
295 unsigned short* pBuffer = (unsigned short*)bsUTFText.c_str(); | 295 unsigned short* pBuffer = (unsigned short*)bsUTFText.c_str(); |
296 m_pApp->FFI_OnSetFieldInputFocus(m_pWidget->GetFormField(), pBuffer, | 296 m_pApp->FFI_OnSetFieldInputFocus(m_pWidget->GetFormField(), pBuffer, |
297 nCharacters, TRUE); | 297 nCharacters, TRUE); |
298 | 298 |
299 pEdit->SetEditNotify(this); | 299 pEdit->SetEditNotify(this); |
300 } | 300 } |
301 } | 301 } |
302 | 302 |
303 void CFFL_TextField::OnKillFocus(CPWL_Wnd* pWnd) {} | 303 void CFFL_TextField::OnKillFocus(CPWL_Wnd* pWnd) {} |
304 | 304 |
305 void CFFL_TextField::OnAddUndo(CPWL_Edit* pEdit) {} | 305 void CFFL_TextField::OnAddUndo(CPWL_Edit* pEdit) {} |
OLD | NEW |