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 "../../include/pdfwindow/PDFWindow.h" | 7 #include "../../include/pdfwindow/PDFWindow.h" |
8 #include "../../include/pdfwindow/PWL_Wnd.h" | 8 #include "../../include/pdfwindow/PWL_Wnd.h" |
9 #include "../../include/pdfwindow/PWL_EditCtrl.h" | 9 #include "../../include/pdfwindow/PWL_EditCtrl.h" |
10 #include "../../include/pdfwindow/PWL_Edit.h" | 10 #include "../../include/pdfwindow/PWL_Edit.h" |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 swText += FWL_VKEY_Retur
n; | 71 swText += FWL_VKEY_Retur
n; |
72 swText += swSection; | 72 swText += swSection; |
73 } | 73 } |
74 } | 74 } |
75 } | 75 } |
76 | 76 |
77 delete pXML; | 77 delete pXML; |
78 } | 78 } |
79 } | 79 } |
80 | 80 |
81 » m_pEdit->SetText(swText); | 81 » m_pEdit->SetText(swText.c_str()); |
82 } | 82 } |
83 | 83 |
84 void CPWL_Edit::RePosChildWnd() | 84 void CPWL_Edit::RePosChildWnd() |
85 { | 85 { |
86 if (CPWL_ScrollBar * pVSB = this->GetVScrollBar()) | 86 if (CPWL_ScrollBar * pVSB = this->GetVScrollBar()) |
87 { | 87 { |
88 //if (pVSB->IsVisible()) | 88 //if (pVSB->IsVisible()) |
89 { | 89 { |
90 CPDF_Rect rcWindow = m_rcOldWindow; | 90 CPDF_Rect rcWindow = m_rcOldWindow; |
91 CPDF_Rect rcVScroll = CPDF_Rect(rcWindow.right, | 91 CPDF_Rect rcVScroll = CPDF_Rect(rcWindow.right, |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 int nSelEnd = 0; | 185 int nSelEnd = 0; |
186 GetSel(nSelStart, nSelEnd); | 186 GetSel(nSelStart, nSelEnd); |
187 m_pFillerNotify->OnBeforeKeyStroke(TRUE, GetAttachedData(), 0 ,
swClipboard, strChangeEx, nSelStart, nSelEnd, TRUE, bRC, bExit, 0); | 187 m_pFillerNotify->OnBeforeKeyStroke(TRUE, GetAttachedData(), 0 ,
swClipboard, strChangeEx, nSelStart, nSelEnd, TRUE, bRC, bExit, 0); |
188 if (!bRC) return; | 188 if (!bRC) return; |
189 if (bExit) return; | 189 if (bExit) return; |
190 } | 190 } |
191 | 191 |
192 if (swClipboard.GetLength() > 0) | 192 if (swClipboard.GetLength() > 0) |
193 { | 193 { |
194 Clear(); | 194 Clear(); |
195 » » InsertText(swClipboard); | 195 » » InsertText(swClipboard.c_str()); |
196 } | 196 } |
197 | 197 |
198 if (m_pFillerNotify) | 198 if (m_pFillerNotify) |
199 { | 199 { |
200 FX_BOOL bExit = FALSE; | 200 FX_BOOL bExit = FALSE; |
201 m_pFillerNotify->OnAfterKeyStroke(TRUE, GetAttachedData(), bExit
,0); | 201 m_pFillerNotify->OnAfterKeyStroke(TRUE, GetAttachedData(), bExit
,0); |
202 if (bExit) return; | 202 if (bExit) return; |
203 } | 203 } |
204 } | 204 } |
205 | 205 |
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
675 this->PasteText(); | 675 this->PasteText(); |
676 break; | 676 break; |
677 case WM_PWLEDIT_DELETE: | 677 case WM_PWLEDIT_DELETE: |
678 this->Clear(); | 678 this->Clear(); |
679 break; | 679 break; |
680 case WM_PWLEDIT_SELECTALL: | 680 case WM_PWLEDIT_SELECTALL: |
681 this->SelectAll(); | 681 this->SelectAll(); |
682 break; | 682 break; |
683 case WM_PWLEDIT_SUGGEST + 0: | 683 case WM_PWLEDIT_SUGGEST + 0: |
684 SetSel(m_pEdit->WordPlaceToWordIndex(wrLatin.BeginPos),m_pEdit->
WordPlaceToWordIndex(wrLatin.EndPos)); | 684 SetSel(m_pEdit->WordPlaceToWordIndex(wrLatin.BeginPos),m_pEdit->
WordPlaceToWordIndex(wrLatin.EndPos)); |
685 » » ReplaceSel(sSuggestWords[0].UTF8Decode()); | 685 » » ReplaceSel(sSuggestWords[0].UTF8Decode().c_str()); |
686 break; | 686 break; |
687 case WM_PWLEDIT_SUGGEST + 1: | 687 case WM_PWLEDIT_SUGGEST + 1: |
688 SetSel(m_pEdit->WordPlaceToWordIndex(wrLatin.BeginPos),m_pEdit->
WordPlaceToWordIndex(wrLatin.EndPos)); | 688 SetSel(m_pEdit->WordPlaceToWordIndex(wrLatin.BeginPos),m_pEdit->
WordPlaceToWordIndex(wrLatin.EndPos)); |
689 » » ReplaceSel(sSuggestWords[1].UTF8Decode()); | 689 » » ReplaceSel(sSuggestWords[1].UTF8Decode().c_str()); |
690 break; | 690 break; |
691 case WM_PWLEDIT_SUGGEST + 2: | 691 case WM_PWLEDIT_SUGGEST + 2: |
692 SetSel(m_pEdit->WordPlaceToWordIndex(wrLatin.BeginPos),m_pEdit->
WordPlaceToWordIndex(wrLatin.EndPos)); | 692 SetSel(m_pEdit->WordPlaceToWordIndex(wrLatin.BeginPos),m_pEdit->
WordPlaceToWordIndex(wrLatin.EndPos)); |
693 » » ReplaceSel(sSuggestWords[2].UTF8Decode()); | 693 » » ReplaceSel(sSuggestWords[2].UTF8Decode().c_str()); |
694 break; | 694 break; |
695 case WM_PWLEDIT_SUGGEST + 3: | 695 case WM_PWLEDIT_SUGGEST + 3: |
696 SetSel(m_pEdit->WordPlaceToWordIndex(wrLatin.BeginPos),m_pEdit->
WordPlaceToWordIndex(wrLatin.EndPos)); | 696 SetSel(m_pEdit->WordPlaceToWordIndex(wrLatin.BeginPos),m_pEdit->
WordPlaceToWordIndex(wrLatin.EndPos)); |
697 » » ReplaceSel(sSuggestWords[3].UTF8Decode()); | 697 » » ReplaceSel(sSuggestWords[3].UTF8Decode().c_str()); |
698 break; | 698 break; |
699 » case WM_PWLEDIT_SUGGEST + 4:» » | 699 » case WM_PWLEDIT_SUGGEST + 4: |
700 SetSel(m_pEdit->WordPlaceToWordIndex(wrLatin.BeginPos),m_pEdit->
WordPlaceToWordIndex(wrLatin.EndPos)); | 700 SetSel(m_pEdit->WordPlaceToWordIndex(wrLatin.BeginPos),m_pEdit->
WordPlaceToWordIndex(wrLatin.EndPos)); |
701 » » ReplaceSel(sSuggestWords[4].UTF8Decode()); | 701 » » ReplaceSel(sSuggestWords[4].UTF8Decode().c_str()); |
702 break; | 702 break; |
703 default: | 703 default: |
704 break; | 704 break; |
705 } | 705 } |
706 | 706 |
707 pSH->DestroyMenu(hPopup); | 707 pSH->DestroyMenu(hPopup); |
708 | 708 |
709 return TRUE; | 709 return TRUE; |
710 } | 710 } |
711 | 711 |
(...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1315 IFX_Edit::GeneratePageObjects(pPageObjects, m_pEdit, ptOffset, NULL, CPW
L_Utils::PWLColorToFXColor(GetTextColor(),GetTransparency()), ObjArray); | 1315 IFX_Edit::GeneratePageObjects(pPageObjects, m_pEdit, ptOffset, NULL, CPW
L_Utils::PWLColorToFXColor(GetTextColor(),GetTransparency()), ObjArray); |
1316 } | 1316 } |
1317 | 1317 |
1318 void CPWL_Edit::GeneratePageObjects(CPDF_PageObjects* pPageObjects, | 1318 void CPWL_Edit::GeneratePageObjects(CPDF_PageObjects* pPageObjects, |
1319 const CP
DF_Point& ptOffset) | 1319 const CP
DF_Point& ptOffset) |
1320 { | 1320 { |
1321 CFX_ArrayTemplate<CPDF_TextObject*> ObjArray; | 1321 CFX_ArrayTemplate<CPDF_TextObject*> ObjArray; |
1322 IFX_Edit::GeneratePageObjects(pPageObjects, m_pEdit, ptOffset, NULL, CPW
L_Utils::PWLColorToFXColor(GetTextColor(),GetTransparency()), ObjArray); | 1322 IFX_Edit::GeneratePageObjects(pPageObjects, m_pEdit, ptOffset, NULL, CPW
L_Utils::PWLColorToFXColor(GetTextColor(),GetTransparency()), ObjArray); |
1323 } | 1323 } |
1324 | 1324 |
OLD | NEW |