| 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/pdfwindow/PWL_EditCtrl.h" | 7 #include "fpdfsdk/pdfwindow/PWL_EditCtrl.h" |
| 8 | 8 |
| 9 #include "core/fpdfdoc/include/cpvt_section.h" | 9 #include "core/fpdfdoc/include/cpvt_section.h" |
| 10 #include "core/fpdfdoc/include/cpvt_word.h" | 10 #include "core/fpdfdoc/include/cpvt_word.h" |
| (...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 457 fFontSize = word.fFontSize; | 457 fFontSize = word.fFontSize; |
| 458 } else if (HasFlag(PES_RICH)) { | 458 } else if (HasFlag(PES_RICH)) { |
| 459 if (pIterator->GetSection(section)) { | 459 if (pIterator->GetSection(section)) { |
| 460 fFontSize = section.WordProps.fFontSize; | 460 fFontSize = section.WordProps.fFontSize; |
| 461 } | 461 } |
| 462 } | 462 } |
| 463 | 463 |
| 464 return fFontSize; | 464 return fFontSize; |
| 465 } | 465 } |
| 466 | 466 |
| 467 void CPWL_EditCtrl::SetText(const FX_WCHAR* csText) { | 467 void CPWL_EditCtrl::SetText(const CFX_WideString& wsText) { |
| 468 m_pEdit->SetText(csText); | 468 m_pEdit->SetText(wsText); |
| 469 } | 469 } |
| 470 | 470 |
| 471 void CPWL_EditCtrl::CopyText() {} | 471 void CPWL_EditCtrl::CopyText() {} |
| 472 | 472 |
| 473 void CPWL_EditCtrl::PasteText() {} | 473 void CPWL_EditCtrl::PasteText() {} |
| 474 | 474 |
| 475 void CPWL_EditCtrl::CutText() {} | 475 void CPWL_EditCtrl::CutText() {} |
| 476 | 476 |
| 477 void CPWL_EditCtrl::ShowVScrollBar(FX_BOOL bShow) {} | 477 void CPWL_EditCtrl::ShowVScrollBar(FX_BOOL bShow) {} |
| 478 | 478 |
| 479 void CPWL_EditCtrl::InsertText(const FX_WCHAR* csText) { | 479 void CPWL_EditCtrl::InsertText(const CFX_WideString& wsText) { |
| 480 if (!IsReadOnly()) | 480 if (!IsReadOnly()) |
| 481 m_pEdit->InsertText(csText, DEFAULT_CHARSET); | 481 m_pEdit->InsertText(wsText, DEFAULT_CHARSET); |
| 482 } | 482 } |
| 483 | 483 |
| 484 void CPWL_EditCtrl::InsertWord(uint16_t word, int32_t nCharset) { | 484 void CPWL_EditCtrl::InsertWord(uint16_t word, int32_t nCharset) { |
| 485 if (!IsReadOnly()) | 485 if (!IsReadOnly()) |
| 486 m_pEdit->InsertWord(word, nCharset); | 486 m_pEdit->InsertWord(word, nCharset); |
| 487 } | 487 } |
| 488 | 488 |
| 489 void CPWL_EditCtrl::InsertReturn() { | 489 void CPWL_EditCtrl::InsertReturn() { |
| 490 if (!IsReadOnly()) | 490 if (!IsReadOnly()) |
| 491 m_pEdit->InsertReturn(); | 491 m_pEdit->InsertReturn(); |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 587 CPVT_WordPlace wpEnd = m_pEdit->WordIndexToWordPlace(nEndChar); | 587 CPVT_WordPlace wpEnd = m_pEdit->WordIndexToWordPlace(nEndChar); |
| 588 return m_pEdit->GetRangeText(CPVT_WordRange(wpStart, wpEnd)); | 588 return m_pEdit->GetRangeText(CPVT_WordRange(wpStart, wpEnd)); |
| 589 } | 589 } |
| 590 | 590 |
| 591 void CPWL_EditCtrl::SetReadyToInput() { | 591 void CPWL_EditCtrl::SetReadyToInput() { |
| 592 if (m_bMouseDown) { | 592 if (m_bMouseDown) { |
| 593 ReleaseCapture(); | 593 ReleaseCapture(); |
| 594 m_bMouseDown = FALSE; | 594 m_bMouseDown = FALSE; |
| 595 } | 595 } |
| 596 } | 596 } |
| OLD | NEW |