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/fxedit/include/fx_edit.h" | 7 #include "fpdfsdk/fxedit/include/fx_edit.h" |
8 #include "fpdfsdk/pdfwindow/PWL_Label.h" | 8 #include "fpdfsdk/pdfwindow/PWL_Label.h" |
9 #include "fpdfsdk/pdfwindow/PWL_Utils.h" | 9 #include "fpdfsdk/pdfwindow/PWL_Utils.h" |
10 #include "fpdfsdk/pdfwindow/PWL_Wnd.h" | 10 #include "fpdfsdk/pdfwindow/PWL_Wnd.h" |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 } | 80 } |
81 | 81 |
82 void CPWL_Label::DrawThisAppearance(CFX_RenderDevice* pDevice, | 82 void CPWL_Label::DrawThisAppearance(CFX_RenderDevice* pDevice, |
83 CFX_Matrix* pUser2Device) { | 83 CFX_Matrix* pUser2Device) { |
84 CPWL_Wnd::DrawThisAppearance(pDevice, pUser2Device); | 84 CPWL_Wnd::DrawThisAppearance(pDevice, pUser2Device); |
85 | 85 |
86 GetClientRect(); | 86 GetClientRect(); |
87 | 87 |
88 CFX_FloatRect rcClip; | 88 CFX_FloatRect rcClip; |
89 CPVT_WordRange wrRange = m_pEdit->GetVisibleWordRange(); | 89 CPVT_WordRange wrRange = m_pEdit->GetVisibleWordRange(); |
90 CPVT_WordRange* pRange = NULL; | 90 CPVT_WordRange* pRange = nullptr; |
91 | 91 |
92 if (!HasFlag(PES_TEXTOVERFLOW)) { | 92 if (!HasFlag(PES_TEXTOVERFLOW)) { |
93 rcClip = GetClientRect(); | 93 rcClip = GetClientRect(); |
94 pRange = &wrRange; | 94 pRange = &wrRange; |
95 } | 95 } |
96 CFX_SystemHandler* pSysHandler = GetSystemHandler(); | 96 CFX_SystemHandler* pSysHandler = GetSystemHandler(); |
97 IFX_Edit::DrawEdit( | 97 IFX_Edit::DrawEdit( |
98 pDevice, pUser2Device, m_pEdit, | 98 pDevice, pUser2Device, m_pEdit, |
99 CPWL_Utils::PWLColorToFXColor(GetTextColor(), GetTransparency()), | 99 CPWL_Utils::PWLColorToFXColor(GetTextColor(), GetTransparency()), |
100 CPWL_Utils::PWLColorToFXColor(GetTextStrokeColor(), GetTransparency()), | 100 CPWL_Utils::PWLColorToFXColor(GetTextStrokeColor(), GetTransparency()), |
101 rcClip, CFX_FloatPoint(0.0f, 0.0f), pRange, pSysHandler, NULL); | 101 rcClip, CFX_FloatPoint(0.0f, 0.0f), pRange, pSysHandler, nullptr); |
102 } | 102 } |
103 | 103 |
104 void CPWL_Label::SetHorzScale(int32_t nHorzScale) { | 104 void CPWL_Label::SetHorzScale(int32_t nHorzScale) { |
105 m_pEdit->SetHorzScale(nHorzScale); | 105 m_pEdit->SetHorzScale(nHorzScale); |
106 } | 106 } |
107 | 107 |
108 void CPWL_Label::SetCharSpace(FX_FLOAT fCharSpace) { | 108 void CPWL_Label::SetCharSpace(FX_FLOAT fCharSpace) { |
109 m_pEdit->SetCharSpace(fCharSpace); | 109 m_pEdit->SetCharSpace(fCharSpace); |
110 } | 110 } |
111 | 111 |
(...skipping 22 matching lines...) Expand all Loading... |
134 return m_pEdit->GetText(); | 134 return m_pEdit->GetText(); |
135 } | 135 } |
136 | 136 |
137 void CPWL_Label::SetLimitChar(int32_t nLimitChar) { | 137 void CPWL_Label::SetLimitChar(int32_t nLimitChar) { |
138 m_pEdit->SetLimitChar(nLimitChar); | 138 m_pEdit->SetLimitChar(nLimitChar); |
139 } | 139 } |
140 | 140 |
141 int32_t CPWL_Label::GetTotalWords() { | 141 int32_t CPWL_Label::GetTotalWords() { |
142 return m_pEdit->GetTotalWords(); | 142 return m_pEdit->GetTotalWords(); |
143 } | 143 } |
OLD | NEW |