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/pdfwindow/PWL_Edit.h" | 7 #include "fpdfsdk/include/pdfwindow/PWL_Edit.h" |
8 | 8 |
9 #include "core/include/fxcrt/fx_safe_types.h" | 9 #include "core/include/fxcrt/fx_safe_types.h" |
10 #include "core/include/fxcrt/fx_xml.h" | 10 #include "core/include/fxcrt/fx_xml.h" |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 if (CPWL_ScrollBar* pVSB = GetVScrollBar()) { | 75 if (CPWL_ScrollBar* pVSB = GetVScrollBar()) { |
76 CPDF_Rect rcWindow = m_rcOldWindow; | 76 CPDF_Rect rcWindow = m_rcOldWindow; |
77 CPDF_Rect rcVScroll = | 77 CPDF_Rect rcVScroll = |
78 CPDF_Rect(rcWindow.right, rcWindow.bottom, | 78 CPDF_Rect(rcWindow.right, rcWindow.bottom, |
79 rcWindow.right + PWL_SCROLLBAR_WIDTH, rcWindow.top); | 79 rcWindow.right + PWL_SCROLLBAR_WIDTH, rcWindow.top); |
80 pVSB->Move(rcVScroll, TRUE, FALSE); | 80 pVSB->Move(rcVScroll, TRUE, FALSE); |
81 } | 81 } |
82 | 82 |
83 if (m_pEditCaret && !HasFlag(PES_TEXTOVERFLOW)) | 83 if (m_pEditCaret && !HasFlag(PES_TEXTOVERFLOW)) |
84 m_pEditCaret->SetClipRect(CPWL_Utils::InflateRect( | 84 m_pEditCaret->SetClipRect(CPWL_Utils::InflateRect( |
85 GetClientRect(), 1.0f)); //+1 for caret beside border | 85 GetClientRect(), 1.0f)); // +1 for caret beside border |
86 | 86 |
87 CPWL_EditCtrl::RePosChildWnd(); | 87 CPWL_EditCtrl::RePosChildWnd(); |
88 } | 88 } |
89 | 89 |
90 CPDF_Rect CPWL_Edit::GetClientRect() const { | 90 CPDF_Rect CPWL_Edit::GetClientRect() const { |
91 CPDF_Rect rcClient = CPWL_Utils::DeflateRect( | 91 CPDF_Rect rcClient = CPWL_Utils::DeflateRect( |
92 GetWindowRect(), (FX_FLOAT)(GetBorderWidth() + GetInnerBorderWidth())); | 92 GetWindowRect(), (FX_FLOAT)(GetBorderWidth() + GetInnerBorderWidth())); |
93 | 93 |
94 if (CPWL_ScrollBar* pVSB = GetVScrollBar()) { | 94 if (CPWL_ScrollBar* pVSB = GetVScrollBar()) { |
95 if (pVSB->IsVisible()) { | 95 if (pVSB->IsVisible()) { |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 m_pEdit->SetAutoFontSize(HasFlag(PWS_AUTOFONTSIZE), FALSE); | 232 m_pEdit->SetAutoFontSize(HasFlag(PWS_AUTOFONTSIZE), FALSE); |
233 m_pEdit->SetAutoScroll(HasFlag(PES_AUTOSCROLL), FALSE); | 233 m_pEdit->SetAutoScroll(HasFlag(PES_AUTOSCROLL), FALSE); |
234 m_pEdit->EnableUndo(HasFlag(PES_UNDO)); | 234 m_pEdit->EnableUndo(HasFlag(PES_UNDO)); |
235 | 235 |
236 if (HasFlag(PES_TEXTOVERFLOW)) { | 236 if (HasFlag(PES_TEXTOVERFLOW)) { |
237 SetClipRect(CPDF_Rect(0.0f, 0.0f, 0.0f, 0.0f)); | 237 SetClipRect(CPDF_Rect(0.0f, 0.0f, 0.0f, 0.0f)); |
238 m_pEdit->SetTextOverflow(TRUE, FALSE); | 238 m_pEdit->SetTextOverflow(TRUE, FALSE); |
239 } else { | 239 } else { |
240 if (m_pEditCaret) { | 240 if (m_pEditCaret) { |
241 m_pEditCaret->SetClipRect(CPWL_Utils::InflateRect( | 241 m_pEditCaret->SetClipRect(CPWL_Utils::InflateRect( |
242 GetClientRect(), 1.0f)); //+1 for caret beside border | 242 GetClientRect(), 1.0f)); // +1 for caret beside border |
243 } | 243 } |
244 } | 244 } |
245 | 245 |
246 if (HasFlag(PES_SPELLCHECK)) { | 246 if (HasFlag(PES_SPELLCHECK)) { |
247 m_pSpellCheck = GetCreationParam().pSpellCheck; | 247 m_pSpellCheck = GetCreationParam().pSpellCheck; |
248 } | 248 } |
249 } | 249 } |
250 | 250 |
251 void CPWL_Edit::GetThisAppearanceStream(CFX_ByteTextBuf& sAppStream) { | 251 void CPWL_Edit::GetThisAppearanceStream(CFX_ByteTextBuf& sAppStream) { |
252 CPWL_Wnd::GetThisAppearanceStream(sAppStream); | 252 CPWL_Wnd::GetThisAppearanceStream(sAppStream); |
(...skipping 923 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1176 } | 1176 } |
1177 | 1177 |
1178 void CPWL_Edit::GeneratePageObjects(CPDF_PageObjectHolder* pObjectHolder, | 1178 void CPWL_Edit::GeneratePageObjects(CPDF_PageObjectHolder* pObjectHolder, |
1179 const CPDF_Point& ptOffset) { | 1179 const CPDF_Point& ptOffset) { |
1180 CFX_ArrayTemplate<CPDF_TextObject*> ObjArray; | 1180 CFX_ArrayTemplate<CPDF_TextObject*> ObjArray; |
1181 IFX_Edit::GeneratePageObjects( | 1181 IFX_Edit::GeneratePageObjects( |
1182 pObjectHolder, m_pEdit, ptOffset, NULL, | 1182 pObjectHolder, m_pEdit, ptOffset, NULL, |
1183 CPWL_Utils::PWLColorToFXColor(GetTextColor(), GetTransparency()), | 1183 CPWL_Utils::PWLColorToFXColor(GetTextColor(), GetTransparency()), |
1184 ObjArray); | 1184 ObjArray); |
1185 } | 1185 } |
OLD | NEW |