John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1 | // Copyright 2014 PDFium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
Lei Zhang | a6d9f0e | 2015-06-13 00:48:38 -0700 | [diff] [blame] | 4 | |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 5 | // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | |
dan sinclair | 89e904b | 2016-03-23 19:29:15 -0400 | [diff] [blame] | 7 | #include "fpdfsdk/pdfwindow/PWL_Edit.h" |
Lei Zhang | c2fb35f | 2016-01-05 16:46:58 -0800 | [diff] [blame] | 8 | |
Dan Sinclair | 3ebd121 | 2016-03-09 09:59:23 -0500 | [diff] [blame] | 9 | #include <vector> |
| 10 | |
dan sinclair | 61b2fc7 | 2016-03-23 19:21:44 -0400 | [diff] [blame] | 11 | #include "core/fpdfapi/fpdf_font/include/cpdf_font.h" |
dsinclair | c7a7349 | 2016-04-05 12:01:42 -0700 | [diff] [blame] | 12 | #include "core/fpdfdoc/include/cpvt_word.h" |
Dan Sinclair | a8a28e0 | 2016-03-23 15:41:39 -0400 | [diff] [blame] | 13 | #include "core/fxcrt/include/fx_safe_types.h" |
| 14 | #include "core/fxcrt/include/fx_xml.h" |
dsinclair | 48baa5f | 2016-04-06 10:00:40 -0700 | [diff] [blame] | 15 | #include "core/fxge/include/fx_ge.h" |
dan sinclair | 89e904b | 2016-03-23 19:29:15 -0400 | [diff] [blame] | 16 | #include "fpdfsdk/pdfwindow/PWL_Caret.h" |
| 17 | #include "fpdfsdk/pdfwindow/PWL_EditCtrl.h" |
| 18 | #include "fpdfsdk/pdfwindow/PWL_FontMap.h" |
| 19 | #include "fpdfsdk/pdfwindow/PWL_ScrollBar.h" |
| 20 | #include "fpdfsdk/pdfwindow/PWL_Utils.h" |
| 21 | #include "fpdfsdk/pdfwindow/PWL_Wnd.h" |
Lei Zhang | c2fb35f | 2016-01-05 16:46:58 -0800 | [diff] [blame] | 22 | #include "public/fpdf_fwlevent.h" |
Tom Sepez | ab27768 | 2016-02-17 10:07:21 -0800 | [diff] [blame] | 23 | #include "third_party/base/stl_util.h" |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 24 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 25 | CPWL_Edit::CPWL_Edit() |
dsinclair | 8da140e | 2016-04-07 12:39:44 -0700 | [diff] [blame] | 26 | : m_pFillerNotify(nullptr), m_bFocus(FALSE), m_pFormFiller(nullptr) {} |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 27 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 28 | CPWL_Edit::~CPWL_Edit() { |
| 29 | ASSERT(m_bFocus == FALSE); |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 30 | } |
| 31 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 32 | CFX_ByteString CPWL_Edit::GetClassName() const { |
| 33 | return PWL_CLASSNAME_EDIT; |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 34 | } |
| 35 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 36 | void CPWL_Edit::OnDestroy() {} |
| 37 | |
| 38 | void CPWL_Edit::SetText(const FX_WCHAR* csText) { |
| 39 | CFX_WideString swText = csText; |
| 40 | |
| 41 | if (HasFlag(PES_RICH)) { |
| 42 | CFX_ByteString sValue = CFX_ByteString::FromUnicode(swText); |
| 43 | |
| 44 | if (CXML_Element* pXML = |
| 45 | CXML_Element::Parse(sValue.c_str(), sValue.GetLength())) { |
| 46 | int32_t nCount = pXML->CountChildren(); |
| 47 | FX_BOOL bFirst = TRUE; |
| 48 | |
tsepez | 774bdde | 2016-04-14 09:49:44 -0700 | [diff] [blame] | 49 | swText.clear(); |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 50 | |
| 51 | for (int32_t i = 0; i < nCount; i++) { |
| 52 | if (CXML_Element* pSubElement = pXML->GetElement(i)) { |
| 53 | CFX_ByteString tag = pSubElement->GetTagName(); |
| 54 | if (tag.EqualNoCase("p")) { |
| 55 | int nChild = pSubElement->CountChildren(); |
| 56 | CFX_WideString swSection; |
| 57 | for (int32_t j = 0; j < nChild; j++) { |
| 58 | swSection += pSubElement->GetContent(j); |
| 59 | } |
| 60 | |
| 61 | if (bFirst) |
| 62 | bFirst = FALSE; |
| 63 | else |
| 64 | swText += FWL_VKEY_Return; |
| 65 | swText += swSection; |
| 66 | } |
| 67 | } |
| 68 | } |
| 69 | |
| 70 | delete pXML; |
| 71 | } |
| 72 | } |
| 73 | |
| 74 | m_pEdit->SetText(swText.c_str()); |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 75 | } |
| 76 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 77 | void CPWL_Edit::RePosChildWnd() { |
| 78 | if (CPWL_ScrollBar* pVSB = GetVScrollBar()) { |
Tom Sepez | 281a9ea | 2016-02-26 14:24:28 -0800 | [diff] [blame] | 79 | CFX_FloatRect rcWindow = m_rcOldWindow; |
| 80 | CFX_FloatRect rcVScroll = |
| 81 | CFX_FloatRect(rcWindow.right, rcWindow.bottom, |
| 82 | rcWindow.right + PWL_SCROLLBAR_WIDTH, rcWindow.top); |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 83 | pVSB->Move(rcVScroll, TRUE, FALSE); |
| 84 | } |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 85 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 86 | if (m_pEditCaret && !HasFlag(PES_TEXTOVERFLOW)) |
| 87 | m_pEditCaret->SetClipRect(CPWL_Utils::InflateRect( |
Dan Sinclair | 50cce60 | 2016-02-24 09:51:16 -0500 | [diff] [blame] | 88 | GetClientRect(), 1.0f)); // +1 for caret beside border |
Lei Zhang | a6d9f0e | 2015-06-13 00:48:38 -0700 | [diff] [blame] | 89 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 90 | CPWL_EditCtrl::RePosChildWnd(); |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 91 | } |
| 92 | |
Tom Sepez | 281a9ea | 2016-02-26 14:24:28 -0800 | [diff] [blame] | 93 | CFX_FloatRect CPWL_Edit::GetClientRect() const { |
| 94 | CFX_FloatRect rcClient = CPWL_Utils::DeflateRect( |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 95 | GetWindowRect(), (FX_FLOAT)(GetBorderWidth() + GetInnerBorderWidth())); |
| 96 | |
| 97 | if (CPWL_ScrollBar* pVSB = GetVScrollBar()) { |
| 98 | if (pVSB->IsVisible()) { |
| 99 | rcClient.right -= PWL_SCROLLBAR_WIDTH; |
| 100 | } |
| 101 | } |
| 102 | |
| 103 | return rcClient; |
| 104 | } |
| 105 | |
| 106 | void CPWL_Edit::SetAlignFormatH(PWL_EDIT_ALIGNFORMAT_H nFormat, |
Lei Zhang | c2fb35f | 2016-01-05 16:46:58 -0800 | [diff] [blame] | 107 | FX_BOOL bPaint) { |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 108 | m_pEdit->SetAlignmentH((int32_t)nFormat, bPaint); |
| 109 | } |
| 110 | |
| 111 | void CPWL_Edit::SetAlignFormatV(PWL_EDIT_ALIGNFORMAT_V nFormat, |
Lei Zhang | c2fb35f | 2016-01-05 16:46:58 -0800 | [diff] [blame] | 112 | FX_BOOL bPaint) { |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 113 | m_pEdit->SetAlignmentV((int32_t)nFormat, bPaint); |
| 114 | } |
| 115 | |
| 116 | FX_BOOL CPWL_Edit::CanSelectAll() const { |
| 117 | return GetSelectWordRange() != m_pEdit->GetWholeWordRange(); |
| 118 | } |
| 119 | |
| 120 | FX_BOOL CPWL_Edit::CanClear() const { |
| 121 | return !IsReadOnly() && m_pEdit->IsSelected(); |
| 122 | } |
| 123 | |
| 124 | FX_BOOL CPWL_Edit::CanCopy() const { |
| 125 | return !HasFlag(PES_PASSWORD) && !HasFlag(PES_NOREAD) && |
| 126 | m_pEdit->IsSelected(); |
| 127 | } |
| 128 | |
| 129 | FX_BOOL CPWL_Edit::CanCut() const { |
| 130 | return CanCopy() && !IsReadOnly(); |
| 131 | } |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 132 | void CPWL_Edit::CutText() { |
| 133 | if (!CanCut()) |
| 134 | return; |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 135 | m_pEdit->Clear(); |
| 136 | } |
| 137 | |
| 138 | void CPWL_Edit::OnCreated() { |
| 139 | CPWL_EditCtrl::OnCreated(); |
| 140 | |
| 141 | if (CPWL_ScrollBar* pScroll = GetVScrollBar()) { |
| 142 | pScroll->RemoveFlag(PWS_AUTOTRANSPARENT); |
| 143 | pScroll->SetTransparency(255); |
| 144 | } |
| 145 | |
| 146 | SetParamByFlag(); |
| 147 | |
| 148 | m_rcOldWindow = GetWindowRect(); |
| 149 | |
| 150 | m_pEdit->SetOprNotify(this); |
| 151 | m_pEdit->EnableOprNotify(TRUE); |
| 152 | } |
| 153 | |
| 154 | void CPWL_Edit::SetParamByFlag() { |
| 155 | if (HasFlag(PES_RIGHT)) { |
| 156 | m_pEdit->SetAlignmentH(2, FALSE); |
| 157 | } else if (HasFlag(PES_MIDDLE)) { |
| 158 | m_pEdit->SetAlignmentH(1, FALSE); |
| 159 | } else { |
| 160 | m_pEdit->SetAlignmentH(0, FALSE); |
| 161 | } |
| 162 | |
| 163 | if (HasFlag(PES_BOTTOM)) { |
| 164 | m_pEdit->SetAlignmentV(2, FALSE); |
| 165 | } else if (HasFlag(PES_CENTER)) { |
| 166 | m_pEdit->SetAlignmentV(1, FALSE); |
| 167 | } else { |
| 168 | m_pEdit->SetAlignmentV(0, FALSE); |
| 169 | } |
| 170 | |
| 171 | if (HasFlag(PES_PASSWORD)) { |
| 172 | m_pEdit->SetPasswordChar('*', FALSE); |
| 173 | } |
| 174 | |
| 175 | m_pEdit->SetMultiLine(HasFlag(PES_MULTILINE), FALSE); |
| 176 | m_pEdit->SetAutoReturn(HasFlag(PES_AUTORETURN), FALSE); |
| 177 | m_pEdit->SetAutoFontSize(HasFlag(PWS_AUTOFONTSIZE), FALSE); |
| 178 | m_pEdit->SetAutoScroll(HasFlag(PES_AUTOSCROLL), FALSE); |
| 179 | m_pEdit->EnableUndo(HasFlag(PES_UNDO)); |
| 180 | |
| 181 | if (HasFlag(PES_TEXTOVERFLOW)) { |
Tom Sepez | 281a9ea | 2016-02-26 14:24:28 -0800 | [diff] [blame] | 182 | SetClipRect(CFX_FloatRect(0.0f, 0.0f, 0.0f, 0.0f)); |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 183 | m_pEdit->SetTextOverflow(TRUE, FALSE); |
| 184 | } else { |
| 185 | if (m_pEditCaret) { |
| 186 | m_pEditCaret->SetClipRect(CPWL_Utils::InflateRect( |
Dan Sinclair | 50cce60 | 2016-02-24 09:51:16 -0500 | [diff] [blame] | 187 | GetClientRect(), 1.0f)); // +1 for caret beside border |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 188 | } |
| 189 | } |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 190 | } |
| 191 | |
| 192 | void CPWL_Edit::GetThisAppearanceStream(CFX_ByteTextBuf& sAppStream) { |
| 193 | CPWL_Wnd::GetThisAppearanceStream(sAppStream); |
| 194 | |
Tom Sepez | 281a9ea | 2016-02-26 14:24:28 -0800 | [diff] [blame] | 195 | CFX_FloatRect rcClient = GetClientRect(); |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 196 | CFX_ByteTextBuf sLine; |
| 197 | |
| 198 | int32_t nCharArray = m_pEdit->GetCharArray(); |
| 199 | |
| 200 | if (nCharArray > 0) { |
| 201 | switch (GetBorderStyle()) { |
| 202 | case PBS_SOLID: { |
| 203 | sLine << "q\n" << GetBorderWidth() << " w\n" |
| 204 | << CPWL_Utils::GetColorAppStream(GetBorderColor(), FALSE) |
tsepez | 4c3debb | 2016-04-08 12:20:38 -0700 | [diff] [blame] | 205 | .AsStringC() |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 206 | << " 2 J 0 j\n"; |
| 207 | |
| 208 | for (int32_t i = 1; i < nCharArray; i++) { |
| 209 | sLine << rcClient.left + |
| 210 | ((rcClient.right - rcClient.left) / nCharArray) * i |
| 211 | << " " << rcClient.bottom << " m\n" |
| 212 | << rcClient.left + |
| 213 | ((rcClient.right - rcClient.left) / nCharArray) * i |
| 214 | << " " << rcClient.top << " l S\n"; |
| 215 | } |
| 216 | |
| 217 | sLine << "Q\n"; |
| 218 | } break; |
| 219 | case PBS_DASH: { |
| 220 | sLine << "q\n" << GetBorderWidth() << " w\n" |
| 221 | << CPWL_Utils::GetColorAppStream(GetBorderColor(), FALSE) |
tsepez | 4c3debb | 2016-04-08 12:20:38 -0700 | [diff] [blame] | 222 | .AsStringC() |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 223 | << " 2 J 0 j\n" |
| 224 | << "[" << GetBorderDash().nDash << " " << GetBorderDash().nGap |
| 225 | << "] " << GetBorderDash().nPhase << " d\n"; |
| 226 | |
| 227 | for (int32_t i = 1; i < nCharArray; i++) { |
| 228 | sLine << rcClient.left + |
| 229 | ((rcClient.right - rcClient.left) / nCharArray) * i |
| 230 | << " " << rcClient.bottom << " m\n" |
| 231 | << rcClient.left + |
| 232 | ((rcClient.right - rcClient.left) / nCharArray) * i |
| 233 | << " " << rcClient.top << " l S\n"; |
| 234 | } |
| 235 | |
| 236 | sLine << "Q\n"; |
| 237 | } break; |
| 238 | } |
| 239 | } |
| 240 | |
| 241 | sAppStream << sLine; |
| 242 | |
| 243 | CFX_ByteTextBuf sText; |
| 244 | |
Tom Sepez | 281a9ea | 2016-02-26 14:24:28 -0800 | [diff] [blame] | 245 | CFX_FloatPoint ptOffset = CFX_FloatPoint(0.0f, 0.0f); |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 246 | |
| 247 | CPVT_WordRange wrWhole = m_pEdit->GetWholeWordRange(); |
| 248 | CPVT_WordRange wrSelect = GetSelectWordRange(); |
| 249 | CPVT_WordRange wrVisible = |
| 250 | (HasFlag(PES_TEXTOVERFLOW) ? wrWhole : m_pEdit->GetVisibleWordRange()); |
| 251 | CPVT_WordRange wrSelBefore(wrWhole.BeginPos, wrSelect.BeginPos); |
| 252 | CPVT_WordRange wrSelAfter(wrSelect.EndPos, wrWhole.EndPos); |
| 253 | |
| 254 | CPVT_WordRange wrTemp = |
| 255 | CPWL_Utils::OverlapWordRange(GetSelectWordRange(), wrVisible); |
| 256 | CFX_ByteString sEditSel = |
| 257 | CPWL_Utils::GetEditSelAppStream(m_pEdit, ptOffset, &wrTemp); |
| 258 | |
| 259 | if (sEditSel.GetLength() > 0) |
tsepez | 4c3debb | 2016-04-08 12:20:38 -0700 | [diff] [blame] | 260 | sText << CPWL_Utils::GetColorAppStream(PWL_DEFAULT_SELBACKCOLOR).AsStringC() |
| 261 | << sEditSel.AsStringC(); |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 262 | |
| 263 | wrTemp = CPWL_Utils::OverlapWordRange(wrVisible, wrSelBefore); |
| 264 | CFX_ByteString sEditBefore = CPWL_Utils::GetEditAppStream( |
| 265 | m_pEdit, ptOffset, &wrTemp, !HasFlag(PES_CHARARRAY), |
| 266 | m_pEdit->GetPasswordChar()); |
| 267 | |
| 268 | if (sEditBefore.GetLength() > 0) |
tsepez | 4c3debb | 2016-04-08 12:20:38 -0700 | [diff] [blame] | 269 | sText << "BT\n" << CPWL_Utils::GetColorAppStream(GetTextColor()).AsStringC() |
| 270 | << sEditBefore.AsStringC() << "ET\n"; |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 271 | |
| 272 | wrTemp = CPWL_Utils::OverlapWordRange(wrVisible, wrSelect); |
| 273 | CFX_ByteString sEditMid = CPWL_Utils::GetEditAppStream( |
| 274 | m_pEdit, ptOffset, &wrTemp, !HasFlag(PES_CHARARRAY), |
| 275 | m_pEdit->GetPasswordChar()); |
| 276 | |
| 277 | if (sEditMid.GetLength() > 0) |
| 278 | sText << "BT\n" |
| 279 | << CPWL_Utils::GetColorAppStream(CPWL_Color(COLORTYPE_GRAY, 1)) |
tsepez | 4c3debb | 2016-04-08 12:20:38 -0700 | [diff] [blame] | 280 | .AsStringC() |
| 281 | << sEditMid.AsStringC() << "ET\n"; |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 282 | |
| 283 | wrTemp = CPWL_Utils::OverlapWordRange(wrVisible, wrSelAfter); |
| 284 | CFX_ByteString sEditAfter = CPWL_Utils::GetEditAppStream( |
| 285 | m_pEdit, ptOffset, &wrTemp, !HasFlag(PES_CHARARRAY), |
| 286 | m_pEdit->GetPasswordChar()); |
| 287 | |
| 288 | if (sEditAfter.GetLength() > 0) |
tsepez | 4c3debb | 2016-04-08 12:20:38 -0700 | [diff] [blame] | 289 | sText << "BT\n" << CPWL_Utils::GetColorAppStream(GetTextColor()).AsStringC() |
| 290 | << sEditAfter.AsStringC() << "ET\n"; |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 291 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 292 | if (sText.GetLength() > 0) { |
Tom Sepez | 281a9ea | 2016-02-26 14:24:28 -0800 | [diff] [blame] | 293 | CFX_FloatRect rcClient = GetClientRect(); |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 294 | sAppStream << "q\n/Tx BMC\n"; |
| 295 | |
| 296 | if (!HasFlag(PES_TEXTOVERFLOW)) |
| 297 | sAppStream << rcClient.left << " " << rcClient.bottom << " " |
| 298 | << rcClient.right - rcClient.left << " " |
| 299 | << rcClient.top - rcClient.bottom << " re W n\n"; |
| 300 | |
| 301 | sAppStream << sText; |
| 302 | |
| 303 | sAppStream << "EMC\nQ\n"; |
| 304 | } |
| 305 | } |
| 306 | |
| 307 | void CPWL_Edit::DrawThisAppearance(CFX_RenderDevice* pDevice, |
Tom Sepez | 60d909e | 2015-12-10 15:34:55 -0800 | [diff] [blame] | 308 | CFX_Matrix* pUser2Device) { |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 309 | CPWL_Wnd::DrawThisAppearance(pDevice, pUser2Device); |
| 310 | |
Tom Sepez | 281a9ea | 2016-02-26 14:24:28 -0800 | [diff] [blame] | 311 | CFX_FloatRect rcClient = GetClientRect(); |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 312 | CFX_ByteTextBuf sLine; |
| 313 | |
| 314 | int32_t nCharArray = m_pEdit->GetCharArray(); |
| 315 | FX_SAFE_INT32 nCharArraySafe = nCharArray; |
| 316 | nCharArraySafe -= 1; |
| 317 | nCharArraySafe *= 2; |
| 318 | |
| 319 | if (nCharArray > 0 && nCharArraySafe.IsValid()) { |
| 320 | switch (GetBorderStyle()) { |
| 321 | case PBS_SOLID: { |
| 322 | CFX_GraphStateData gsd; |
| 323 | gsd.m_LineWidth = (FX_FLOAT)GetBorderWidth(); |
| 324 | |
| 325 | CFX_PathData path; |
| 326 | path.SetPointCount(nCharArraySafe.ValueOrDie()); |
| 327 | |
| 328 | for (int32_t i = 0; i < nCharArray - 1; i++) { |
| 329 | path.SetPoint( |
| 330 | i * 2, |
| 331 | rcClient.left + |
| 332 | ((rcClient.right - rcClient.left) / nCharArray) * (i + 1), |
| 333 | rcClient.bottom, FXPT_MOVETO); |
| 334 | path.SetPoint( |
| 335 | i * 2 + 1, |
| 336 | rcClient.left + |
| 337 | ((rcClient.right - rcClient.left) / nCharArray) * (i + 1), |
| 338 | rcClient.top, FXPT_LINETO); |
| 339 | } |
| 340 | if (path.GetPointCount() > 0) |
| 341 | pDevice->DrawPath( |
| 342 | &path, pUser2Device, &gsd, 0, |
| 343 | CPWL_Utils::PWLColorToFXColor(GetBorderColor(), 255), |
| 344 | FXFILL_ALTERNATE); |
| 345 | } break; |
| 346 | case PBS_DASH: { |
| 347 | CFX_GraphStateData gsd; |
| 348 | gsd.m_LineWidth = (FX_FLOAT)GetBorderWidth(); |
| 349 | |
| 350 | gsd.SetDashCount(2); |
| 351 | gsd.m_DashArray[0] = (FX_FLOAT)GetBorderDash().nDash; |
| 352 | gsd.m_DashArray[1] = (FX_FLOAT)GetBorderDash().nGap; |
| 353 | gsd.m_DashPhase = (FX_FLOAT)GetBorderDash().nPhase; |
| 354 | |
| 355 | CFX_PathData path; |
| 356 | path.SetPointCount(nCharArraySafe.ValueOrDie()); |
| 357 | |
| 358 | for (int32_t i = 0; i < nCharArray - 1; i++) { |
| 359 | path.SetPoint( |
| 360 | i * 2, |
| 361 | rcClient.left + |
| 362 | ((rcClient.right - rcClient.left) / nCharArray) * (i + 1), |
| 363 | rcClient.bottom, FXPT_MOVETO); |
| 364 | path.SetPoint( |
| 365 | i * 2 + 1, |
| 366 | rcClient.left + |
| 367 | ((rcClient.right - rcClient.left) / nCharArray) * (i + 1), |
| 368 | rcClient.top, FXPT_LINETO); |
| 369 | } |
| 370 | if (path.GetPointCount() > 0) |
| 371 | pDevice->DrawPath( |
| 372 | &path, pUser2Device, &gsd, 0, |
| 373 | CPWL_Utils::PWLColorToFXColor(GetBorderColor(), 255), |
| 374 | FXFILL_ALTERNATE); |
| 375 | } break; |
| 376 | } |
| 377 | } |
| 378 | |
Tom Sepez | 281a9ea | 2016-02-26 14:24:28 -0800 | [diff] [blame] | 379 | CFX_FloatRect rcClip; |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 380 | CPVT_WordRange wrRange = m_pEdit->GetVisibleWordRange(); |
| 381 | CPVT_WordRange* pRange = NULL; |
| 382 | |
| 383 | if (!HasFlag(PES_TEXTOVERFLOW)) { |
| 384 | rcClip = GetClientRect(); |
| 385 | pRange = &wrRange; |
| 386 | } |
dsinclair | b959010 | 2016-04-27 06:38:59 -0700 | [diff] [blame] | 387 | CFX_SystemHandler* pSysHandler = GetSystemHandler(); |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 388 | IFX_Edit::DrawEdit( |
| 389 | pDevice, pUser2Device, m_pEdit, |
| 390 | CPWL_Utils::PWLColorToFXColor(GetTextColor(), GetTransparency()), |
| 391 | CPWL_Utils::PWLColorToFXColor(GetTextStrokeColor(), GetTransparency()), |
Tom Sepez | 281a9ea | 2016-02-26 14:24:28 -0800 | [diff] [blame] | 392 | rcClip, CFX_FloatPoint(0.0f, 0.0f), pRange, pSysHandler, m_pFormFiller); |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 393 | } |
| 394 | |
tsepez | c3255f5 | 2016-03-25 14:52:27 -0700 | [diff] [blame] | 395 | FX_BOOL CPWL_Edit::OnLButtonDown(const CFX_FloatPoint& point, uint32_t nFlag) { |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 396 | CPWL_Wnd::OnLButtonDown(point, nFlag); |
| 397 | |
| 398 | if (HasFlag(PES_TEXTOVERFLOW) || ClientHitTest(point)) { |
| 399 | if (m_bMouseDown) |
| 400 | InvalidateRect(); |
| 401 | |
| 402 | m_bMouseDown = TRUE; |
| 403 | SetCapture(); |
| 404 | |
| 405 | m_pEdit->OnMouseDown(point, IsSHIFTpressed(nFlag), IsCTRLpressed(nFlag)); |
| 406 | } |
| 407 | |
| 408 | return TRUE; |
| 409 | } |
| 410 | |
Tom Sepez | 281a9ea | 2016-02-26 14:24:28 -0800 | [diff] [blame] | 411 | FX_BOOL CPWL_Edit::OnLButtonDblClk(const CFX_FloatPoint& point, |
tsepez | c3255f5 | 2016-03-25 14:52:27 -0700 | [diff] [blame] | 412 | uint32_t nFlag) { |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 413 | CPWL_Wnd::OnLButtonDblClk(point, nFlag); |
| 414 | |
| 415 | if (HasFlag(PES_TEXTOVERFLOW) || ClientHitTest(point)) { |
| 416 | m_pEdit->SelectAll(); |
| 417 | } |
| 418 | |
| 419 | return TRUE; |
| 420 | } |
| 421 | |
tsepez | c3255f5 | 2016-03-25 14:52:27 -0700 | [diff] [blame] | 422 | FX_BOOL CPWL_Edit::OnRButtonUp(const CFX_FloatPoint& point, uint32_t nFlag) { |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 423 | if (m_bMouseDown) |
| 424 | return FALSE; |
| 425 | |
| 426 | CPWL_Wnd::OnRButtonUp(point, nFlag); |
| 427 | |
| 428 | if (!HasFlag(PES_TEXTOVERFLOW) && !ClientHitTest(point)) |
| 429 | return TRUE; |
| 430 | |
dsinclair | b959010 | 2016-04-27 06:38:59 -0700 | [diff] [blame] | 431 | CFX_SystemHandler* pSH = GetSystemHandler(); |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 432 | if (!pSH) |
| 433 | return FALSE; |
| 434 | |
| 435 | SetFocus(); |
| 436 | |
dsinclair | b959010 | 2016-04-27 06:38:59 -0700 | [diff] [blame] | 437 | return FALSE; |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 438 | } |
| 439 | |
| 440 | void CPWL_Edit::OnSetFocus() { |
| 441 | SetEditCaret(TRUE); |
| 442 | |
| 443 | if (!IsReadOnly()) { |
| 444 | if (IPWL_FocusHandler* pFocusHandler = GetFocusHandler()) |
| 445 | pFocusHandler->OnSetFocus(this); |
| 446 | } |
| 447 | |
| 448 | m_bFocus = TRUE; |
| 449 | } |
| 450 | |
| 451 | void CPWL_Edit::OnKillFocus() { |
| 452 | ShowVScrollBar(FALSE); |
| 453 | |
| 454 | m_pEdit->SelectNone(); |
Tom Sepez | 281a9ea | 2016-02-26 14:24:28 -0800 | [diff] [blame] | 455 | SetCaret(FALSE, CFX_FloatPoint(0.0f, 0.0f), CFX_FloatPoint(0.0f, 0.0f)); |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 456 | |
| 457 | SetCharSet(0); |
| 458 | |
| 459 | if (!IsReadOnly()) { |
| 460 | if (IPWL_FocusHandler* pFocusHandler = GetFocusHandler()) |
| 461 | pFocusHandler->OnKillFocus(this); |
| 462 | } |
| 463 | |
| 464 | m_bFocus = FALSE; |
| 465 | } |
| 466 | |
| 467 | void CPWL_Edit::SetHorzScale(int32_t nHorzScale, FX_BOOL bPaint /* = TRUE*/) { |
| 468 | m_pEdit->SetHorzScale(nHorzScale, bPaint); |
| 469 | } |
| 470 | |
| 471 | void CPWL_Edit::SetCharSpace(FX_FLOAT fCharSpace, FX_BOOL bPaint /* = TRUE*/) { |
| 472 | m_pEdit->SetCharSpace(fCharSpace, bPaint); |
| 473 | } |
| 474 | |
| 475 | void CPWL_Edit::SetLineLeading(FX_FLOAT fLineLeading, |
| 476 | FX_BOOL bPaint /* = TRUE*/) { |
| 477 | m_pEdit->SetLineLeading(fLineLeading, bPaint); |
| 478 | } |
| 479 | |
| 480 | CFX_ByteString CPWL_Edit::GetSelectAppearanceStream( |
Tom Sepez | 281a9ea | 2016-02-26 14:24:28 -0800 | [diff] [blame] | 481 | const CFX_FloatPoint& ptOffset) const { |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 482 | CPVT_WordRange wr = GetSelectWordRange(); |
| 483 | return CPWL_Utils::GetEditSelAppStream(m_pEdit, ptOffset, &wr); |
| 484 | } |
| 485 | |
| 486 | CPVT_WordRange CPWL_Edit::GetSelectWordRange() const { |
| 487 | if (m_pEdit->IsSelected()) { |
| 488 | int32_t nStart = -1; |
| 489 | int32_t nEnd = -1; |
| 490 | |
| 491 | m_pEdit->GetSel(nStart, nEnd); |
| 492 | |
| 493 | CPVT_WordPlace wpStart = m_pEdit->WordIndexToWordPlace(nStart); |
| 494 | CPVT_WordPlace wpEnd = m_pEdit->WordIndexToWordPlace(nEnd); |
| 495 | |
| 496 | return CPVT_WordRange(wpStart, wpEnd); |
| 497 | } |
| 498 | |
| 499 | return CPVT_WordRange(); |
| 500 | } |
| 501 | |
| 502 | CFX_ByteString CPWL_Edit::GetTextAppearanceStream( |
Tom Sepez | 281a9ea | 2016-02-26 14:24:28 -0800 | [diff] [blame] | 503 | const CFX_FloatPoint& ptOffset) const { |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 504 | CFX_ByteTextBuf sRet; |
| 505 | CFX_ByteString sEdit = CPWL_Utils::GetEditAppStream(m_pEdit, ptOffset); |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 506 | if (sEdit.GetLength() > 0) { |
tsepez | 4c3debb | 2016-04-08 12:20:38 -0700 | [diff] [blame] | 507 | sRet << "BT\n" << CPWL_Utils::GetColorAppStream(GetTextColor()).AsStringC() |
| 508 | << sEdit.AsStringC() << "ET\n"; |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 509 | } |
tsepez | 71a452f | 2016-05-13 17:51:27 -0700 | [diff] [blame^] | 510 | return sRet.MakeString(); |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 511 | } |
| 512 | |
| 513 | CFX_ByteString CPWL_Edit::GetCaretAppearanceStream( |
Tom Sepez | 281a9ea | 2016-02-26 14:24:28 -0800 | [diff] [blame] | 514 | const CFX_FloatPoint& ptOffset) const { |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 515 | if (m_pEditCaret) |
| 516 | return m_pEditCaret->GetCaretAppearanceStream(ptOffset); |
| 517 | |
| 518 | return CFX_ByteString(); |
| 519 | } |
| 520 | |
Tom Sepez | 281a9ea | 2016-02-26 14:24:28 -0800 | [diff] [blame] | 521 | CFX_FloatPoint CPWL_Edit::GetWordRightBottomPoint( |
| 522 | const CPVT_WordPlace& wpWord) { |
| 523 | CFX_FloatPoint pt(0.0f, 0.0f); |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 524 | |
thestig | 821d59e | 2016-05-11 12:59:22 -0700 | [diff] [blame] | 525 | IFX_Edit_Iterator* pIterator = m_pEdit->GetIterator(); |
| 526 | CPVT_WordPlace wpOld = pIterator->GetAt(); |
| 527 | pIterator->SetAt(wpWord); |
| 528 | CPVT_Word word; |
| 529 | if (pIterator->GetWord(word)) { |
| 530 | pt = CFX_FloatPoint(word.ptWord.x + word.fWidth, |
| 531 | word.ptWord.y + word.fDescent); |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 532 | } |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 533 | |
thestig | 821d59e | 2016-05-11 12:59:22 -0700 | [diff] [blame] | 534 | pIterator->SetAt(wpOld); |
| 535 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 536 | return pt; |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 537 | } |
| 538 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 539 | FX_BOOL CPWL_Edit::IsTextFull() const { |
| 540 | return m_pEdit->IsTextFull(); |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 541 | } |
| 542 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 543 | FX_FLOAT CPWL_Edit::GetCharArrayAutoFontSize(CPDF_Font* pFont, |
Tom Sepez | 281a9ea | 2016-02-26 14:24:28 -0800 | [diff] [blame] | 544 | const CFX_FloatRect& rcPlate, |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 545 | int32_t nCharArray) { |
| 546 | if (pFont && !pFont->IsStandardFont()) { |
| 547 | FX_RECT rcBBox; |
| 548 | pFont->GetFontBBox(rcBBox); |
| 549 | |
Tom Sepez | 281a9ea | 2016-02-26 14:24:28 -0800 | [diff] [blame] | 550 | CFX_FloatRect rcCell = rcPlate; |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 551 | FX_FLOAT xdiv = rcCell.Width() / nCharArray * 1000.0f / rcBBox.Width(); |
| 552 | FX_FLOAT ydiv = -rcCell.Height() * 1000.0f / rcBBox.Height(); |
| 553 | |
| 554 | return xdiv < ydiv ? xdiv : ydiv; |
| 555 | } |
| 556 | |
| 557 | return 0.0f; |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 558 | } |
| 559 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 560 | void CPWL_Edit::SetCharArray(int32_t nCharArray) { |
| 561 | if (HasFlag(PES_CHARARRAY) && nCharArray > 0) { |
| 562 | m_pEdit->SetCharArray(nCharArray); |
| 563 | m_pEdit->SetTextOverflow(TRUE); |
| 564 | |
| 565 | if (HasFlag(PWS_AUTOFONTSIZE)) { |
dsinclair | c7a7349 | 2016-04-05 12:01:42 -0700 | [diff] [blame] | 566 | if (IPVT_FontMap* pFontMap = GetFontMap()) { |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 567 | FX_FLOAT fFontSize = GetCharArrayAutoFontSize( |
| 568 | pFontMap->GetPDFFont(0), GetClientRect(), nCharArray); |
| 569 | if (fFontSize > 0.0f) { |
| 570 | m_pEdit->SetAutoFontSize(FALSE); |
| 571 | m_pEdit->SetFontSize(fFontSize); |
| 572 | } |
| 573 | } |
| 574 | } |
| 575 | } |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 576 | } |
| 577 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 578 | void CPWL_Edit::SetLimitChar(int32_t nLimitChar) { |
| 579 | m_pEdit->SetLimitChar(nLimitChar); |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 580 | } |
| 581 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 582 | void CPWL_Edit::ReplaceSel(const FX_WCHAR* csText) { |
| 583 | m_pEdit->Clear(); |
| 584 | m_pEdit->InsertText(csText); |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 585 | } |
| 586 | |
Tom Sepez | 281a9ea | 2016-02-26 14:24:28 -0800 | [diff] [blame] | 587 | CFX_FloatRect CPWL_Edit::GetFocusRect() const { |
| 588 | return CFX_FloatRect(); |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 589 | } |
| 590 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 591 | void CPWL_Edit::ShowVScrollBar(FX_BOOL bShow) { |
| 592 | if (CPWL_ScrollBar* pScroll = GetVScrollBar()) { |
| 593 | if (bShow) { |
| 594 | if (!pScroll->IsVisible()) { |
| 595 | pScroll->SetVisible(TRUE); |
Tom Sepez | 281a9ea | 2016-02-26 14:24:28 -0800 | [diff] [blame] | 596 | CFX_FloatRect rcWindow = GetWindowRect(); |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 597 | m_rcOldWindow = rcWindow; |
| 598 | rcWindow.right += PWL_SCROLLBAR_WIDTH; |
| 599 | Move(rcWindow, TRUE, TRUE); |
| 600 | } |
| 601 | } else { |
| 602 | if (pScroll->IsVisible()) { |
| 603 | pScroll->SetVisible(FALSE); |
| 604 | Move(m_rcOldWindow, TRUE, TRUE); |
| 605 | } |
| 606 | } |
| 607 | } |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 608 | } |
| 609 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 610 | FX_BOOL CPWL_Edit::IsVScrollBarVisible() const { |
| 611 | if (CPWL_ScrollBar* pScroll = GetVScrollBar()) { |
| 612 | return pScroll->IsVisible(); |
| 613 | } |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 614 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 615 | return FALSE; |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 616 | } |
| 617 | |
tsepez | c3255f5 | 2016-03-25 14:52:27 -0700 | [diff] [blame] | 618 | FX_BOOL CPWL_Edit::OnKeyDown(uint16_t nChar, uint32_t nFlag) { |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 619 | if (m_bMouseDown) |
| 620 | return TRUE; |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 621 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 622 | if (nChar == FWL_VKEY_Delete) { |
| 623 | if (m_pFillerNotify) { |
| 624 | FX_BOOL bRC = TRUE; |
| 625 | FX_BOOL bExit = FALSE; |
| 626 | CFX_WideString strChange; |
| 627 | CFX_WideString strChangeEx; |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 628 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 629 | int nSelStart = 0; |
| 630 | int nSelEnd = 0; |
| 631 | GetSel(nSelStart, nSelEnd); |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 632 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 633 | if (nSelStart == nSelEnd) |
| 634 | nSelEnd = nSelStart + 1; |
Lei Zhang | a5b4704 | 2015-10-19 14:32:16 -0700 | [diff] [blame] | 635 | m_pFillerNotify->OnBeforeKeyStroke(GetAttachedData(), strChange, |
| 636 | strChangeEx, nSelStart, nSelEnd, TRUE, |
| 637 | bRC, bExit, nFlag); |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 638 | if (!bRC) |
| 639 | return FALSE; |
| 640 | if (bExit) |
| 641 | return FALSE; |
| 642 | } |
| 643 | } |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 644 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 645 | FX_BOOL bRet = CPWL_EditCtrl::OnKeyDown(nChar, nFlag); |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 646 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 647 | // In case of implementation swallow the OnKeyDown event. |
| 648 | if (IsProceedtoOnChar(nChar, nFlag)) |
| 649 | return TRUE; |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 650 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 651 | return bRet; |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 652 | } |
| 653 | |
| 654 | /** |
Lei Zhang | a6d9f0e | 2015-06-13 00:48:38 -0700 | [diff] [blame] | 655 | *In case of implementation swallow the OnKeyDown event. |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 656 | *If the event is swallowed, implementation may do other unexpected things, which |
| 657 | *is not the control means to do. |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 658 | */ |
tsepez | c3255f5 | 2016-03-25 14:52:27 -0700 | [diff] [blame] | 659 | FX_BOOL CPWL_Edit::IsProceedtoOnChar(uint16_t nKeyCode, uint32_t nFlag) { |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 660 | FX_BOOL bCtrl = IsCTRLpressed(nFlag); |
| 661 | FX_BOOL bAlt = IsALTpressed(nFlag); |
| 662 | if (bCtrl && !bAlt) { |
| 663 | // hot keys for edit control. |
| 664 | switch (nKeyCode) { |
| 665 | case 'C': |
| 666 | case 'V': |
| 667 | case 'X': |
| 668 | case 'A': |
| 669 | case 'Z': |
| 670 | return TRUE; |
| 671 | default: |
| 672 | break; |
| 673 | } |
| 674 | } |
| 675 | // control characters. |
| 676 | switch (nKeyCode) { |
| 677 | case FWL_VKEY_Escape: |
| 678 | case FWL_VKEY_Back: |
| 679 | case FWL_VKEY_Return: |
| 680 | case FWL_VKEY_Space: |
| 681 | return TRUE; |
| 682 | default: |
Lei Zhang | a5b4704 | 2015-10-19 14:32:16 -0700 | [diff] [blame] | 683 | return FALSE; |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 684 | } |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 685 | } |
| 686 | |
tsepez | c3255f5 | 2016-03-25 14:52:27 -0700 | [diff] [blame] | 687 | FX_BOOL CPWL_Edit::OnChar(uint16_t nChar, uint32_t nFlag) { |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 688 | if (m_bMouseDown) |
| 689 | return TRUE; |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 690 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 691 | FX_BOOL bRC = TRUE; |
| 692 | FX_BOOL bExit = FALSE; |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 693 | |
Lei Zhang | a5b4704 | 2015-10-19 14:32:16 -0700 | [diff] [blame] | 694 | if (!IsCTRLpressed(nFlag)) { |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 695 | if (m_pFillerNotify) { |
| 696 | CFX_WideString swChange; |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 697 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 698 | int nSelStart = 0; |
| 699 | int nSelEnd = 0; |
| 700 | GetSel(nSelStart, nSelEnd); |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 701 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 702 | switch (nChar) { |
| 703 | case FWL_VKEY_Back: |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 704 | if (nSelStart == nSelEnd) |
| 705 | nSelStart = nSelEnd - 1; |
| 706 | break; |
| 707 | case FWL_VKEY_Return: |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 708 | break; |
| 709 | default: |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 710 | swChange += nChar; |
| 711 | break; |
| 712 | } |
Lei Zhang | a6d9f0e | 2015-06-13 00:48:38 -0700 | [diff] [blame] | 713 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 714 | CFX_WideString strChangeEx; |
Lei Zhang | a5b4704 | 2015-10-19 14:32:16 -0700 | [diff] [blame] | 715 | m_pFillerNotify->OnBeforeKeyStroke(GetAttachedData(), swChange, |
| 716 | strChangeEx, nSelStart, nSelEnd, TRUE, |
| 717 | bRC, bExit, nFlag); |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 718 | } |
| 719 | } |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 720 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 721 | if (!bRC) |
| 722 | return TRUE; |
| 723 | if (bExit) |
| 724 | return FALSE; |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 725 | |
dsinclair | c7a7349 | 2016-04-05 12:01:42 -0700 | [diff] [blame] | 726 | if (IPVT_FontMap* pFontMap = GetFontMap()) { |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 727 | int32_t nOldCharSet = GetCharSet(); |
| 728 | int32_t nNewCharSet = pFontMap->CharSetFromUnicode(nChar, DEFAULT_CHARSET); |
| 729 | if (nOldCharSet != nNewCharSet) { |
| 730 | SetCharSet(nNewCharSet); |
| 731 | } |
| 732 | } |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 733 | |
Lei Zhang | a5b4704 | 2015-10-19 14:32:16 -0700 | [diff] [blame] | 734 | return CPWL_EditCtrl::OnChar(nChar, nFlag); |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 735 | } |
| 736 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 737 | FX_BOOL CPWL_Edit::OnMouseWheel(short zDelta, |
Tom Sepez | 281a9ea | 2016-02-26 14:24:28 -0800 | [diff] [blame] | 738 | const CFX_FloatPoint& point, |
tsepez | c3255f5 | 2016-03-25 14:52:27 -0700 | [diff] [blame] | 739 | uint32_t nFlag) { |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 740 | if (HasFlag(PES_MULTILINE)) { |
Tom Sepez | 281a9ea | 2016-02-26 14:24:28 -0800 | [diff] [blame] | 741 | CFX_FloatPoint ptScroll = GetScrollPos(); |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 742 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 743 | if (zDelta > 0) { |
| 744 | ptScroll.y += GetFontSize(); |
| 745 | } else { |
| 746 | ptScroll.y -= GetFontSize(); |
| 747 | } |
| 748 | SetScrollPos(ptScroll); |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 749 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 750 | return TRUE; |
| 751 | } |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 752 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 753 | return FALSE; |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 754 | } |
| 755 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 756 | void CPWL_Edit::OnInsertReturn(const CPVT_WordPlace& place, |
| 757 | const CPVT_WordPlace& oldplace) { |
| 758 | if (HasFlag(PES_SPELLCHECK)) { |
| 759 | m_pEdit->RefreshWordRange(CombineWordRange(GetLatinWordsRange(oldplace), |
| 760 | GetLatinWordsRange(place))); |
| 761 | } |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 762 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 763 | if (m_pEditNotify) { |
| 764 | m_pEditNotify->OnInsertReturn(place, oldplace); |
| 765 | } |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 766 | } |
| 767 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 768 | void CPWL_Edit::OnBackSpace(const CPVT_WordPlace& place, |
| 769 | const CPVT_WordPlace& oldplace) { |
| 770 | if (HasFlag(PES_SPELLCHECK)) { |
| 771 | m_pEdit->RefreshWordRange(CombineWordRange(GetLatinWordsRange(oldplace), |
| 772 | GetLatinWordsRange(place))); |
| 773 | } |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 774 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 775 | if (m_pEditNotify) { |
| 776 | m_pEditNotify->OnBackSpace(place, oldplace); |
| 777 | } |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 778 | } |
| 779 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 780 | void CPWL_Edit::OnDelete(const CPVT_WordPlace& place, |
| 781 | const CPVT_WordPlace& oldplace) { |
| 782 | if (HasFlag(PES_SPELLCHECK)) { |
| 783 | m_pEdit->RefreshWordRange(CombineWordRange(GetLatinWordsRange(oldplace), |
| 784 | GetLatinWordsRange(place))); |
| 785 | } |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 786 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 787 | if (m_pEditNotify) { |
| 788 | m_pEditNotify->OnDelete(place, oldplace); |
| 789 | } |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 790 | } |
| 791 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 792 | void CPWL_Edit::OnClear(const CPVT_WordPlace& place, |
| 793 | const CPVT_WordPlace& oldplace) { |
| 794 | if (HasFlag(PES_SPELLCHECK)) { |
| 795 | m_pEdit->RefreshWordRange(CombineWordRange(GetLatinWordsRange(oldplace), |
| 796 | GetLatinWordsRange(place))); |
| 797 | } |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 798 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 799 | if (m_pEditNotify) { |
| 800 | m_pEditNotify->OnClear(place, oldplace); |
| 801 | } |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 802 | } |
| 803 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 804 | void CPWL_Edit::OnInsertWord(const CPVT_WordPlace& place, |
| 805 | const CPVT_WordPlace& oldplace) { |
| 806 | if (HasFlag(PES_SPELLCHECK)) { |
| 807 | m_pEdit->RefreshWordRange(CombineWordRange(GetLatinWordsRange(oldplace), |
| 808 | GetLatinWordsRange(place))); |
| 809 | } |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 810 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 811 | if (m_pEditNotify) { |
| 812 | m_pEditNotify->OnInsertWord(place, oldplace); |
| 813 | } |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 814 | } |
| 815 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 816 | void CPWL_Edit::OnSetText(const CPVT_WordPlace& place, |
| 817 | const CPVT_WordPlace& oldplace) {} |
| 818 | |
| 819 | void CPWL_Edit::OnInsertText(const CPVT_WordPlace& place, |
| 820 | const CPVT_WordPlace& oldplace) { |
| 821 | if (HasFlag(PES_SPELLCHECK)) { |
| 822 | m_pEdit->RefreshWordRange(CombineWordRange(GetLatinWordsRange(oldplace), |
| 823 | GetLatinWordsRange(place))); |
| 824 | } |
| 825 | |
| 826 | if (m_pEditNotify) { |
| 827 | m_pEditNotify->OnInsertText(place, oldplace); |
| 828 | } |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 829 | } |
| 830 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 831 | void CPWL_Edit::OnAddUndo(IFX_Edit_UndoItem* pUndoItem) { |
| 832 | if (m_pEditNotify) { |
| 833 | m_pEditNotify->OnAddUndo(this); |
| 834 | } |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 835 | } |
| 836 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 837 | CPVT_WordRange CPWL_Edit::CombineWordRange(const CPVT_WordRange& wr1, |
| 838 | const CPVT_WordRange& wr2) { |
| 839 | CPVT_WordRange wrRet; |
| 840 | |
| 841 | if (wr1.BeginPos.WordCmp(wr2.BeginPos) < 0) { |
| 842 | wrRet.BeginPos = wr1.BeginPos; |
| 843 | } else { |
| 844 | wrRet.BeginPos = wr2.BeginPos; |
| 845 | } |
| 846 | |
| 847 | if (wr1.EndPos.WordCmp(wr2.EndPos) < 0) { |
| 848 | wrRet.EndPos = wr2.EndPos; |
| 849 | } else { |
| 850 | wrRet.EndPos = wr1.EndPos; |
| 851 | } |
| 852 | |
| 853 | return wrRet; |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 854 | } |
| 855 | |
Tom Sepez | 281a9ea | 2016-02-26 14:24:28 -0800 | [diff] [blame] | 856 | CPVT_WordRange CPWL_Edit::GetLatinWordsRange( |
| 857 | const CFX_FloatPoint& point) const { |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 858 | return GetSameWordsRange(m_pEdit->SearchWordPlace(point), TRUE, FALSE); |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 859 | } |
| 860 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 861 | CPVT_WordRange CPWL_Edit::GetLatinWordsRange( |
| 862 | const CPVT_WordPlace& place) const { |
| 863 | return GetSameWordsRange(place, TRUE, FALSE); |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 864 | } |
| 865 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 866 | CPVT_WordRange CPWL_Edit::GetArabicWordsRange( |
| 867 | const CPVT_WordPlace& place) const { |
| 868 | return GetSameWordsRange(place, FALSE, TRUE); |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 869 | } |
| 870 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 871 | #define PWL_ISARABICWORD(word) \ |
| 872 | ((word >= 0x0600 && word <= 0x06FF) || (word >= 0xFB50 && word <= 0xFEFC)) |
| 873 | |
| 874 | CPVT_WordRange CPWL_Edit::GetSameWordsRange(const CPVT_WordPlace& place, |
| 875 | FX_BOOL bLatin, |
| 876 | FX_BOOL bArabic) const { |
| 877 | CPVT_WordRange range; |
| 878 | |
thestig | 821d59e | 2016-05-11 12:59:22 -0700 | [diff] [blame] | 879 | IFX_Edit_Iterator* pIterator = m_pEdit->GetIterator(); |
| 880 | CPVT_Word wordinfo; |
| 881 | CPVT_WordPlace wpStart(place), wpEnd(place); |
| 882 | pIterator->SetAt(place); |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 883 | |
thestig | 821d59e | 2016-05-11 12:59:22 -0700 | [diff] [blame] | 884 | if (bLatin) { |
| 885 | while (pIterator->NextWord()) { |
| 886 | if (!pIterator->GetWord(wordinfo) || |
| 887 | !FX_EDIT_ISLATINWORD(wordinfo.Word)) { |
| 888 | break; |
Lei Zhang | c2fb35f | 2016-01-05 16:46:58 -0800 | [diff] [blame] | 889 | } |
Lei Zhang | c2fb35f | 2016-01-05 16:46:58 -0800 | [diff] [blame] | 890 | |
thestig | 821d59e | 2016-05-11 12:59:22 -0700 | [diff] [blame] | 891 | wpEnd = pIterator->GetAt(); |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 892 | } |
thestig | 821d59e | 2016-05-11 12:59:22 -0700 | [diff] [blame] | 893 | } else if (bArabic) { |
| 894 | while (pIterator->NextWord()) { |
| 895 | if (!pIterator->GetWord(wordinfo) || !PWL_ISARABICWORD(wordinfo.Word)) |
| 896 | break; |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 897 | |
thestig | 821d59e | 2016-05-11 12:59:22 -0700 | [diff] [blame] | 898 | wpEnd = pIterator->GetAt(); |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 899 | } |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 900 | } |
| 901 | |
thestig | 821d59e | 2016-05-11 12:59:22 -0700 | [diff] [blame] | 902 | pIterator->SetAt(place); |
| 903 | |
| 904 | if (bLatin) { |
| 905 | do { |
| 906 | if (!pIterator->GetWord(wordinfo) || |
| 907 | !FX_EDIT_ISLATINWORD(wordinfo.Word)) { |
| 908 | break; |
| 909 | } |
| 910 | |
| 911 | wpStart = pIterator->GetAt(); |
| 912 | } while (pIterator->PrevWord()); |
| 913 | } else if (bArabic) { |
| 914 | do { |
| 915 | if (!pIterator->GetWord(wordinfo) || !PWL_ISARABICWORD(wordinfo.Word)) |
| 916 | break; |
| 917 | |
| 918 | wpStart = pIterator->GetAt(); |
| 919 | } while (pIterator->PrevWord()); |
| 920 | } |
| 921 | |
| 922 | range.Set(wpStart, wpEnd); |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 923 | return range; |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 924 | } |
| 925 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 926 | void CPWL_Edit::GeneratePageObjects( |
Tom Sepez | 2398d89 | 2016-02-17 16:46:26 -0800 | [diff] [blame] | 927 | CPDF_PageObjectHolder* pObjectHolder, |
Tom Sepez | 281a9ea | 2016-02-26 14:24:28 -0800 | [diff] [blame] | 928 | const CFX_FloatPoint& ptOffset, |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 929 | CFX_ArrayTemplate<CPDF_TextObject*>& ObjArray) { |
| 930 | IFX_Edit::GeneratePageObjects( |
Tom Sepez | 2398d89 | 2016-02-17 16:46:26 -0800 | [diff] [blame] | 931 | pObjectHolder, m_pEdit, ptOffset, NULL, |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 932 | CPWL_Utils::PWLColorToFXColor(GetTextColor(), GetTransparency()), |
| 933 | ObjArray); |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 934 | } |
| 935 | |
Tom Sepez | 2398d89 | 2016-02-17 16:46:26 -0800 | [diff] [blame] | 936 | void CPWL_Edit::GeneratePageObjects(CPDF_PageObjectHolder* pObjectHolder, |
Tom Sepez | 281a9ea | 2016-02-26 14:24:28 -0800 | [diff] [blame] | 937 | const CFX_FloatPoint& ptOffset) { |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 938 | CFX_ArrayTemplate<CPDF_TextObject*> ObjArray; |
| 939 | IFX_Edit::GeneratePageObjects( |
Tom Sepez | 2398d89 | 2016-02-17 16:46:26 -0800 | [diff] [blame] | 940 | pObjectHolder, m_pEdit, ptOffset, NULL, |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 941 | CPWL_Utils::PWLColorToFXColor(GetTextColor(), GetTransparency()), |
| 942 | ObjArray); |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 943 | } |