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/formfiller/FFL_CheckBox.h" | 7 #include "fpdfsdk/include/formfiller/FFL_CheckBox.h" |
8 #include "fpdfsdk/include/formfiller/FFL_ComboBox.h" | 8 #include "fpdfsdk/include/formfiller/FFL_ComboBox.h" |
9 #include "fpdfsdk/include/formfiller/FFL_FormFiller.h" | 9 #include "fpdfsdk/include/formfiller/FFL_FormFiller.h" |
10 #include "fpdfsdk/include/formfiller/FFL_IFormFiller.h" | 10 #include "fpdfsdk/include/formfiller/FFL_IFormFiller.h" |
11 #include "fpdfsdk/include/formfiller/FFL_ListBox.h" | 11 #include "fpdfsdk/include/formfiller/FFL_ListBox.h" |
12 #include "fpdfsdk/include/formfiller/FFL_PushButton.h" | 12 #include "fpdfsdk/include/formfiller/FFL_PushButton.h" |
13 #include "fpdfsdk/include/formfiller/FFL_RadioButton.h" | 13 #include "fpdfsdk/include/formfiller/FFL_RadioButton.h" |
14 #include "fpdfsdk/include/formfiller/FFL_TextField.h" | 14 #include "fpdfsdk/include/formfiller/FFL_TextField.h" |
15 | 15 |
16 #define FFL_MAXLISTBOXHEIGHT 140.0f | 16 #define FFL_MAXLISTBOXHEIGHT 140.0f |
17 | 17 |
18 // HHOOK CFFL_IFormFiller::m_hookSheet = NULL; | |
19 // MSG CFFL_IFormFiller::g_Msg; | |
20 | |
21 /* ----------------------------- CFFL_IFormFiller ----------------------------- | |
22 */ | |
23 | |
24 CFFL_IFormFiller::CFFL_IFormFiller(CPDFDoc_Environment* pApp) | 18 CFFL_IFormFiller::CFFL_IFormFiller(CPDFDoc_Environment* pApp) |
25 : m_pApp(pApp), m_bNotifying(FALSE) {} | 19 : m_pApp(pApp), m_bNotifying(FALSE) {} |
26 | 20 |
27 CFFL_IFormFiller::~CFFL_IFormFiller() { | 21 CFFL_IFormFiller::~CFFL_IFormFiller() { |
28 for (auto& it : m_Maps) | 22 for (auto& it : m_Maps) |
29 delete it.second; | 23 delete it.second; |
30 m_Maps.clear(); | 24 m_Maps.clear(); |
31 } | 25 } |
32 | 26 |
33 FX_BOOL CFFL_IFormFiller::Annot_HitTest(CPDFSDK_PageView* pPageView, | 27 FX_BOOL CFFL_IFormFiller::Annot_HitTest(CPDFSDK_PageView* pPageView, |
34 CPDFSDK_Annot* pAnnot, | 28 CPDFSDK_Annot* pAnnot, |
35 CPDF_Point point) { | 29 CPDF_Point point) { |
36 CPDF_Rect rc = pAnnot->GetRect(); | 30 CPDF_Rect rc = pAnnot->GetRect(); |
37 if (rc.Contains(point.x, point.y)) | 31 if (rc.Contains(point.x, point.y)) |
38 return TRUE; | 32 return TRUE; |
39 return FALSE; | 33 return FALSE; |
40 } | 34 } |
41 | 35 |
42 FX_RECT CFFL_IFormFiller::GetViewBBox(CPDFSDK_PageView* pPageView, | 36 FX_RECT CFFL_IFormFiller::GetViewBBox(CPDFSDK_PageView* pPageView, |
43 CPDFSDK_Annot* pAnnot) { | 37 CPDFSDK_Annot* pAnnot) { |
44 if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) | 38 if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) |
45 return pFormFiller->GetViewBBox(pPageView, pAnnot); | 39 return pFormFiller->GetViewBBox(pPageView, pAnnot); |
46 | 40 |
47 ASSERT(pPageView != NULL); | 41 ASSERT(pPageView); |
48 | 42 |
49 CPDF_Annot* pPDFAnnot = pAnnot->GetPDFAnnot(); | 43 CPDF_Annot* pPDFAnnot = pAnnot->GetPDFAnnot(); |
50 CPDF_Rect rcAnnot; | 44 CPDF_Rect rcAnnot; |
51 pPDFAnnot->GetRect(rcAnnot); | 45 pPDFAnnot->GetRect(rcAnnot); |
52 | 46 |
53 CPDF_Rect rcWin = CPWL_Utils::InflateRect(rcAnnot, 1); | 47 CPDF_Rect rcWin = CPWL_Utils::InflateRect(rcAnnot, 1); |
54 return rcWin.GetOutterRect(); | 48 return rcWin.GetOutterRect(); |
55 } | 49 } |
56 | 50 |
57 void CFFL_IFormFiller::OnDraw(CPDFSDK_PageView* pPageView, | 51 void CFFL_IFormFiller::OnDraw(CPDFSDK_PageView* pPageView, |
58 /*HDC hDC,*/ CPDFSDK_Annot* pAnnot, | 52 CPDFSDK_Annot* pAnnot, |
59 CFX_RenderDevice* pDevice, | 53 CFX_RenderDevice* pDevice, |
60 CFX_Matrix* pUser2Device, | 54 CFX_Matrix* pUser2Device, |
61 /*const CRect& rcWindow,*/ FX_DWORD dwFlags) { | 55 FX_DWORD dwFlags) { |
62 ASSERT(pPageView != NULL); | 56 ASSERT(pPageView); |
63 CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot; | 57 CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot; |
64 | 58 |
65 if (IsVisible(pWidget)) { | 59 if (IsVisible(pWidget)) { |
66 if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) { | 60 if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) { |
67 if (pFormFiller->IsValid()) { | 61 if (pFormFiller->IsValid()) { |
68 pFormFiller->OnDraw(pPageView, pAnnot, pDevice, pUser2Device, dwFlags); | 62 pFormFiller->OnDraw(pPageView, pAnnot, pDevice, pUser2Device, dwFlags); |
69 pAnnot->GetPDFPage(); | 63 pAnnot->GetPDFPage(); |
70 | 64 |
71 CPDFSDK_Document* pDocument = m_pApp->GetSDKDocument(); | 65 CPDFSDK_Document* pDocument = m_pApp->GetSDKDocument(); |
72 if (pDocument->GetFocusAnnot() == pAnnot) { | 66 if (pDocument->GetFocusAnnot() == pAnnot) { |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) { | 114 if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) { |
121 pFormFiller->OnDelete(pAnnot); | 115 pFormFiller->OnDelete(pAnnot); |
122 } | 116 } |
123 | 117 |
124 UnRegisterFormFiller(pAnnot); | 118 UnRegisterFormFiller(pAnnot); |
125 } | 119 } |
126 | 120 |
127 void CFFL_IFormFiller::OnMouseEnter(CPDFSDK_PageView* pPageView, | 121 void CFFL_IFormFiller::OnMouseEnter(CPDFSDK_PageView* pPageView, |
128 CPDFSDK_Annot* pAnnot, | 122 CPDFSDK_Annot* pAnnot, |
129 FX_UINT nFlag) { | 123 FX_UINT nFlag) { |
130 ASSERT(pAnnot != NULL); | |
131 ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget"); | 124 ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget"); |
132 | 125 |
133 if (!m_bNotifying) { | 126 if (!m_bNotifying) { |
134 CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot; | 127 CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot; |
135 if (pWidget->GetAAction(CPDF_AAction::CursorEnter)) { | 128 if (pWidget->GetAAction(CPDF_AAction::CursorEnter)) { |
136 m_bNotifying = TRUE; | 129 m_bNotifying = TRUE; |
137 | 130 |
138 int nValueAge = pWidget->GetValueAge(); | 131 int nValueAge = pWidget->GetValueAge(); |
139 | 132 |
140 pWidget->ClearAppModified(); | 133 pWidget->ClearAppModified(); |
141 | 134 |
142 ASSERT(pPageView != NULL); | 135 ASSERT(pPageView); |
143 | 136 |
144 PDFSDK_FieldAction fa; | 137 PDFSDK_FieldAction fa; |
145 fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlag); | 138 fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlag); |
146 fa.bShift = m_pApp->FFI_IsSHIFTKeyDown(nFlag); | 139 fa.bShift = m_pApp->FFI_IsSHIFTKeyDown(nFlag); |
147 pWidget->OnAAction(CPDF_AAction::CursorEnter, fa, pPageView); | 140 pWidget->OnAAction(CPDF_AAction::CursorEnter, fa, pPageView); |
148 m_bNotifying = FALSE; | 141 m_bNotifying = FALSE; |
149 | 142 |
150 // if ( !IsValidAnnot(pPageView, pAnnot) ) return; | |
151 | |
152 if (pWidget->IsAppModified()) { | 143 if (pWidget->IsAppModified()) { |
153 if (CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, FALSE)) { | 144 if (CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, FALSE)) { |
154 pFormFiller->ResetPDFWindow(pPageView, | 145 pFormFiller->ResetPDFWindow(pPageView, |
155 pWidget->GetValueAge() == nValueAge); | 146 pWidget->GetValueAge() == nValueAge); |
156 } | 147 } |
157 } | 148 } |
158 } | 149 } |
159 } | 150 } |
160 | 151 |
161 if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, TRUE)) { | 152 if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, TRUE)) { |
162 pFormFiller->OnMouseEnter(pPageView, pAnnot); | 153 pFormFiller->OnMouseEnter(pPageView, pAnnot); |
163 } | 154 } |
164 } | 155 } |
165 | 156 |
166 void CFFL_IFormFiller::OnMouseExit(CPDFSDK_PageView* pPageView, | 157 void CFFL_IFormFiller::OnMouseExit(CPDFSDK_PageView* pPageView, |
167 CPDFSDK_Annot* pAnnot, | 158 CPDFSDK_Annot* pAnnot, |
168 FX_UINT nFlag) { | 159 FX_UINT nFlag) { |
169 ASSERT(pAnnot != NULL); | |
170 ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget"); | 160 ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget"); |
171 | 161 |
172 if (!m_bNotifying) { | 162 if (!m_bNotifying) { |
173 CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot; | 163 CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot; |
174 if (pWidget->GetAAction(CPDF_AAction::CursorExit)) { | 164 if (pWidget->GetAAction(CPDF_AAction::CursorExit)) { |
175 m_bNotifying = TRUE; | 165 m_bNotifying = TRUE; |
176 pWidget->GetAppearanceAge(); | 166 pWidget->GetAppearanceAge(); |
177 int nValueAge = pWidget->GetValueAge(); | 167 int nValueAge = pWidget->GetValueAge(); |
178 pWidget->ClearAppModified(); | 168 pWidget->ClearAppModified(); |
179 | 169 |
180 ASSERT(pPageView != NULL); | 170 ASSERT(pPageView); |
181 | 171 |
182 PDFSDK_FieldAction fa; | 172 PDFSDK_FieldAction fa; |
183 fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlag); | 173 fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlag); |
184 fa.bShift = m_pApp->FFI_IsSHIFTKeyDown(nFlag); | 174 fa.bShift = m_pApp->FFI_IsSHIFTKeyDown(nFlag); |
185 | 175 |
186 pWidget->OnAAction(CPDF_AAction::CursorExit, fa, pPageView); | 176 pWidget->OnAAction(CPDF_AAction::CursorExit, fa, pPageView); |
187 m_bNotifying = FALSE; | 177 m_bNotifying = FALSE; |
188 | 178 |
189 // if (!IsValidAnnot(pPageView, pAnnot)) return; | |
190 | |
191 if (pWidget->IsAppModified()) { | 179 if (pWidget->IsAppModified()) { |
192 if (CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, FALSE)) { | 180 if (CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, FALSE)) { |
193 pFormFiller->ResetPDFWindow(pPageView, | 181 pFormFiller->ResetPDFWindow(pPageView, |
194 nValueAge == pWidget->GetValueAge()); | 182 nValueAge == pWidget->GetValueAge()); |
195 } | 183 } |
196 } | 184 } |
197 } | 185 } |
198 } | 186 } |
199 | 187 |
200 if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) { | 188 if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) { |
201 pFormFiller->OnMouseExit(pPageView, pAnnot); | 189 pFormFiller->OnMouseExit(pPageView, pAnnot); |
202 } | 190 } |
203 } | 191 } |
204 | 192 |
205 FX_BOOL CFFL_IFormFiller::OnLButtonDown(CPDFSDK_PageView* pPageView, | 193 FX_BOOL CFFL_IFormFiller::OnLButtonDown(CPDFSDK_PageView* pPageView, |
206 CPDFSDK_Annot* pAnnot, | 194 CPDFSDK_Annot* pAnnot, |
207 FX_UINT nFlags, | 195 FX_UINT nFlags, |
208 const CPDF_Point& point) { | 196 const CPDF_Point& point) { |
209 ASSERT(pAnnot != NULL); | |
210 ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget"); | 197 ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget"); |
211 | 198 |
212 if (!m_bNotifying) { | 199 if (!m_bNotifying) { |
213 CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot; | 200 CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot; |
214 if (Annot_HitTest(pPageView, pAnnot, point) && | 201 if (Annot_HitTest(pPageView, pAnnot, point) && |
215 pWidget->GetAAction(CPDF_AAction::ButtonDown)) { | 202 pWidget->GetAAction(CPDF_AAction::ButtonDown)) { |
216 m_bNotifying = TRUE; | 203 m_bNotifying = TRUE; |
217 pWidget->GetAppearanceAge(); | 204 pWidget->GetAppearanceAge(); |
218 int nValueAge = pWidget->GetValueAge(); | 205 int nValueAge = pWidget->GetValueAge(); |
219 pWidget->ClearAppModified(); | 206 pWidget->ClearAppModified(); |
220 | 207 |
221 ASSERT(pPageView != NULL); | 208 ASSERT(pPageView); |
222 | 209 |
223 PDFSDK_FieldAction fa; | 210 PDFSDK_FieldAction fa; |
224 fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlags); | 211 fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlags); |
225 fa.bShift = m_pApp->FFI_IsSHIFTKeyDown(nFlags); | 212 fa.bShift = m_pApp->FFI_IsSHIFTKeyDown(nFlags); |
226 pWidget->OnAAction(CPDF_AAction::ButtonDown, fa, pPageView); | 213 pWidget->OnAAction(CPDF_AAction::ButtonDown, fa, pPageView); |
227 m_bNotifying = FALSE; | 214 m_bNotifying = FALSE; |
228 | 215 |
229 if (!IsValidAnnot(pPageView, pAnnot)) | 216 if (!IsValidAnnot(pPageView, pAnnot)) |
230 return TRUE; | 217 return TRUE; |
231 | 218 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 return TRUE; | 266 return TRUE; |
280 } | 267 } |
281 return bRet; | 268 return bRet; |
282 } | 269 } |
283 | 270 |
284 void CFFL_IFormFiller::OnButtonUp(CPDFSDK_Widget* pWidget, | 271 void CFFL_IFormFiller::OnButtonUp(CPDFSDK_Widget* pWidget, |
285 CPDFSDK_PageView* pPageView, | 272 CPDFSDK_PageView* pPageView, |
286 FX_BOOL& bReset, | 273 FX_BOOL& bReset, |
287 FX_BOOL& bExit, | 274 FX_BOOL& bExit, |
288 FX_UINT nFlag) { | 275 FX_UINT nFlag) { |
289 ASSERT(pWidget != NULL); | 276 ASSERT(pWidget); |
290 | 277 |
291 if (!m_bNotifying) { | 278 if (!m_bNotifying) { |
292 if (pWidget->GetAAction(CPDF_AAction::ButtonUp)) { | 279 if (pWidget->GetAAction(CPDF_AAction::ButtonUp)) { |
293 m_bNotifying = TRUE; | 280 m_bNotifying = TRUE; |
294 int nAge = pWidget->GetAppearanceAge(); | 281 int nAge = pWidget->GetAppearanceAge(); |
295 int nValueAge = pWidget->GetValueAge(); | 282 int nValueAge = pWidget->GetValueAge(); |
296 | 283 |
297 ASSERT(pPageView != NULL); | 284 ASSERT(pPageView); |
298 // CReader_DocView* pDocView = pPageView->GetDocView(); | |
299 // ASSERT(pDocView != NULL); | |
300 | 285 |
301 PDFSDK_FieldAction fa; | 286 PDFSDK_FieldAction fa; |
302 fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlag); | 287 fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlag); |
303 fa.bShift = m_pApp->FFI_IsSHIFTKeyDown(nFlag); | 288 fa.bShift = m_pApp->FFI_IsSHIFTKeyDown(nFlag); |
304 | 289 |
305 pWidget->OnAAction(CPDF_AAction::ButtonUp, fa, pPageView); | 290 pWidget->OnAAction(CPDF_AAction::ButtonUp, fa, pPageView); |
306 m_bNotifying = FALSE; | 291 m_bNotifying = FALSE; |
307 | 292 |
308 if (!IsValidAnnot(pPageView, pWidget)) { | 293 if (!IsValidAnnot(pPageView, pWidget)) { |
309 bExit = TRUE; | 294 bExit = TRUE; |
310 return; | 295 return; |
311 } | 296 } |
312 | 297 |
313 if (nAge != pWidget->GetAppearanceAge()) { | 298 if (nAge != pWidget->GetAppearanceAge()) { |
314 if (CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, FALSE)) { | 299 if (CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, FALSE)) { |
315 pFormFiller->ResetPDFWindow(pPageView, | 300 pFormFiller->ResetPDFWindow(pPageView, |
316 nValueAge == pWidget->GetValueAge()); | 301 nValueAge == pWidget->GetValueAge()); |
317 } | 302 } |
318 | 303 |
319 bReset = TRUE; | 304 bReset = TRUE; |
320 } | 305 } |
321 } | 306 } |
322 } | 307 } |
323 } | 308 } |
324 | 309 |
325 FX_BOOL CFFL_IFormFiller::OnLButtonDblClk(CPDFSDK_PageView* pPageView, | 310 FX_BOOL CFFL_IFormFiller::OnLButtonDblClk(CPDFSDK_PageView* pPageView, |
326 CPDFSDK_Annot* pAnnot, | 311 CPDFSDK_Annot* pAnnot, |
327 FX_UINT nFlags, | 312 FX_UINT nFlags, |
328 const CPDF_Point& point) { | 313 const CPDF_Point& point) { |
329 ASSERT(pAnnot != NULL); | |
330 ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget"); | 314 ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget"); |
331 | 315 |
332 if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) { | 316 if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) { |
333 return pFormFiller->OnLButtonDblClk(pPageView, pAnnot, nFlags, point); | 317 return pFormFiller->OnLButtonDblClk(pPageView, pAnnot, nFlags, point); |
334 } | 318 } |
335 | 319 |
336 return FALSE; | 320 return FALSE; |
337 } | 321 } |
338 | 322 |
339 FX_BOOL CFFL_IFormFiller::OnMouseMove(CPDFSDK_PageView* pPageView, | 323 FX_BOOL CFFL_IFormFiller::OnMouseMove(CPDFSDK_PageView* pPageView, |
340 CPDFSDK_Annot* pAnnot, | 324 CPDFSDK_Annot* pAnnot, |
341 FX_UINT nFlags, | 325 FX_UINT nFlags, |
342 const CPDF_Point& point) { | 326 const CPDF_Point& point) { |
343 ASSERT(pAnnot != NULL); | |
344 ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget"); | 327 ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget"); |
345 | 328 |
346 // change cursor | 329 // change cursor |
347 if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, TRUE)) { | 330 if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, TRUE)) { |
348 return pFormFiller->OnMouseMove(pPageView, pAnnot, nFlags, point); | 331 return pFormFiller->OnMouseMove(pPageView, pAnnot, nFlags, point); |
349 } | 332 } |
350 | 333 |
351 return FALSE; | 334 return FALSE; |
352 } | 335 } |
353 | 336 |
354 FX_BOOL CFFL_IFormFiller::OnMouseWheel(CPDFSDK_PageView* pPageView, | 337 FX_BOOL CFFL_IFormFiller::OnMouseWheel(CPDFSDK_PageView* pPageView, |
355 CPDFSDK_Annot* pAnnot, | 338 CPDFSDK_Annot* pAnnot, |
356 FX_UINT nFlags, | 339 FX_UINT nFlags, |
357 short zDelta, | 340 short zDelta, |
358 const CPDF_Point& point) { | 341 const CPDF_Point& point) { |
359 ASSERT(pAnnot != NULL); | |
360 ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget"); | 342 ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget"); |
361 | 343 |
362 if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) { | 344 if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) { |
363 return pFormFiller->OnMouseWheel(pPageView, pAnnot, nFlags, zDelta, point); | 345 return pFormFiller->OnMouseWheel(pPageView, pAnnot, nFlags, zDelta, point); |
364 } | 346 } |
365 | 347 |
366 return FALSE; | 348 return FALSE; |
367 } | 349 } |
368 | 350 |
369 FX_BOOL CFFL_IFormFiller::OnRButtonDown(CPDFSDK_PageView* pPageView, | 351 FX_BOOL CFFL_IFormFiller::OnRButtonDown(CPDFSDK_PageView* pPageView, |
370 CPDFSDK_Annot* pAnnot, | 352 CPDFSDK_Annot* pAnnot, |
371 FX_UINT nFlags, | 353 FX_UINT nFlags, |
372 const CPDF_Point& point) { | 354 const CPDF_Point& point) { |
373 ASSERT(pAnnot != NULL); | |
374 ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget"); | 355 ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget"); |
375 | 356 |
376 if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) { | 357 if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) { |
377 return pFormFiller->OnRButtonDown(pPageView, pAnnot, nFlags, point); | 358 return pFormFiller->OnRButtonDown(pPageView, pAnnot, nFlags, point); |
378 } | 359 } |
379 | 360 |
380 return FALSE; | 361 return FALSE; |
381 } | 362 } |
382 | 363 |
383 FX_BOOL CFFL_IFormFiller::OnRButtonUp(CPDFSDK_PageView* pPageView, | 364 FX_BOOL CFFL_IFormFiller::OnRButtonUp(CPDFSDK_PageView* pPageView, |
384 CPDFSDK_Annot* pAnnot, | 365 CPDFSDK_Annot* pAnnot, |
385 FX_UINT nFlags, | 366 FX_UINT nFlags, |
386 const CPDF_Point& point) { | 367 const CPDF_Point& point) { |
387 ASSERT(pAnnot != NULL); | |
388 ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget"); | 368 ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget"); |
389 | 369 |
390 if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) { | 370 if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) { |
391 return pFormFiller->OnRButtonUp(pPageView, pAnnot, nFlags, point); | 371 return pFormFiller->OnRButtonUp(pPageView, pAnnot, nFlags, point); |
392 } | 372 } |
393 | 373 |
394 return FALSE; | 374 return FALSE; |
395 } | 375 } |
396 | 376 |
397 FX_BOOL CFFL_IFormFiller::OnKeyDown(CPDFSDK_Annot* pAnnot, | 377 FX_BOOL CFFL_IFormFiller::OnKeyDown(CPDFSDK_Annot* pAnnot, |
398 FX_UINT nKeyCode, | 378 FX_UINT nKeyCode, |
399 FX_UINT nFlags) { | 379 FX_UINT nFlags) { |
400 ASSERT(pAnnot != NULL); | |
401 ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget"); | 380 ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget"); |
402 | 381 |
403 if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) { | 382 if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) { |
404 return pFormFiller->OnKeyDown(pAnnot, nKeyCode, nFlags); | 383 return pFormFiller->OnKeyDown(pAnnot, nKeyCode, nFlags); |
405 } | 384 } |
406 | 385 |
407 return FALSE; | 386 return FALSE; |
408 } | 387 } |
409 | 388 |
410 FX_BOOL CFFL_IFormFiller::OnChar(CPDFSDK_Annot* pAnnot, | 389 FX_BOOL CFFL_IFormFiller::OnChar(CPDFSDK_Annot* pAnnot, |
(...skipping 18 matching lines...) Expand all Loading... |
429 if (!m_bNotifying) { | 408 if (!m_bNotifying) { |
430 CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot; | 409 CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot; |
431 if (pWidget->GetAAction(CPDF_AAction::GetFocus)) { | 410 if (pWidget->GetAAction(CPDF_AAction::GetFocus)) { |
432 m_bNotifying = TRUE; | 411 m_bNotifying = TRUE; |
433 pWidget->GetAppearanceAge(); | 412 pWidget->GetAppearanceAge(); |
434 | 413 |
435 int nValueAge = pWidget->GetValueAge(); | 414 int nValueAge = pWidget->GetValueAge(); |
436 pWidget->ClearAppModified(); | 415 pWidget->ClearAppModified(); |
437 | 416 |
438 CPDFSDK_PageView* pPageView = pAnnot->GetPageView(); | 417 CPDFSDK_PageView* pPageView = pAnnot->GetPageView(); |
439 ASSERT(pPageView != NULL); | 418 ASSERT(pPageView); |
440 | 419 |
441 PDFSDK_FieldAction fa; | 420 PDFSDK_FieldAction fa; |
442 fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlag); | 421 fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlag); |
443 fa.bShift = m_pApp->FFI_IsSHIFTKeyDown(nFlag); | 422 fa.bShift = m_pApp->FFI_IsSHIFTKeyDown(nFlag); |
444 | 423 |
445 CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, TRUE); | 424 CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, TRUE); |
446 if (!pFormFiller) | 425 if (!pFormFiller) |
447 return FALSE; | 426 return FALSE; |
448 pFormFiller->GetActionData(pPageView, CPDF_AAction::GetFocus, fa); | 427 pFormFiller->GetActionData(pPageView, CPDF_AAction::GetFocus, fa); |
449 pWidget->OnAAction(CPDF_AAction::GetFocus, fa, pPageView); | 428 pWidget->OnAAction(CPDF_AAction::GetFocus, fa, pPageView); |
(...skipping 22 matching lines...) Expand all Loading... |
472 if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) { | 451 if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) { |
473 pFormFiller->KillFocusForAnnot(pAnnot, nFlag); | 452 pFormFiller->KillFocusForAnnot(pAnnot, nFlag); |
474 | 453 |
475 if (!m_bNotifying) { | 454 if (!m_bNotifying) { |
476 CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot; | 455 CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot; |
477 if (pWidget->GetAAction(CPDF_AAction::LoseFocus)) { | 456 if (pWidget->GetAAction(CPDF_AAction::LoseFocus)) { |
478 m_bNotifying = TRUE; | 457 m_bNotifying = TRUE; |
479 pWidget->ClearAppModified(); | 458 pWidget->ClearAppModified(); |
480 | 459 |
481 CPDFSDK_PageView* pPageView = pWidget->GetPageView(); | 460 CPDFSDK_PageView* pPageView = pWidget->GetPageView(); |
482 ASSERT(pPageView != NULL); | 461 ASSERT(pPageView); |
483 | 462 |
484 PDFSDK_FieldAction fa; | 463 PDFSDK_FieldAction fa; |
485 fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlag); | 464 fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlag); |
486 fa.bShift = m_pApp->FFI_IsSHIFTKeyDown(nFlag); | 465 fa.bShift = m_pApp->FFI_IsSHIFTKeyDown(nFlag); |
487 | 466 |
488 pFormFiller->GetActionData(pPageView, CPDF_AAction::LoseFocus, fa); | 467 pFormFiller->GetActionData(pPageView, CPDF_AAction::LoseFocus, fa); |
489 | 468 |
490 pWidget->OnAAction(CPDF_AAction::LoseFocus, fa, pPageView); | 469 pWidget->OnAAction(CPDF_AAction::LoseFocus, fa, pPageView); |
491 m_bNotifying = FALSE; | 470 m_bNotifying = FALSE; |
492 } | 471 } |
493 } | 472 } |
494 } | 473 } |
495 | 474 |
496 return TRUE; | 475 return TRUE; |
497 } | 476 } |
498 | 477 |
499 FX_BOOL CFFL_IFormFiller::IsVisible(CPDFSDK_Widget* pWidget) { | 478 FX_BOOL CFFL_IFormFiller::IsVisible(CPDFSDK_Widget* pWidget) { |
500 return pWidget->IsVisible(); | 479 return pWidget->IsVisible(); |
501 } | 480 } |
502 | 481 |
503 FX_BOOL CFFL_IFormFiller::IsReadOnly(CPDFSDK_Widget* pWidget) { | 482 FX_BOOL CFFL_IFormFiller::IsReadOnly(CPDFSDK_Widget* pWidget) { |
504 ASSERT(pWidget != NULL); | |
505 | |
506 int nFieldFlags = pWidget->GetFieldFlags(); | 483 int nFieldFlags = pWidget->GetFieldFlags(); |
507 | |
508 return (nFieldFlags & FIELDFLAG_READONLY) == FIELDFLAG_READONLY; | 484 return (nFieldFlags & FIELDFLAG_READONLY) == FIELDFLAG_READONLY; |
509 } | 485 } |
510 | 486 |
511 FX_BOOL CFFL_IFormFiller::IsFillingAllowed(CPDFSDK_Widget* pWidget) { | 487 FX_BOOL CFFL_IFormFiller::IsFillingAllowed(CPDFSDK_Widget* pWidget) { |
512 if (pWidget->GetFieldType() == FIELDTYPE_PUSHBUTTON) | 488 if (pWidget->GetFieldType() == FIELDTYPE_PUSHBUTTON) |
513 return TRUE; | 489 return TRUE; |
514 | 490 |
515 CPDF_Page* pPage = pWidget->GetPDFPage(); | 491 CPDF_Page* pPage = pWidget->GetPDFPage(); |
516 CPDF_Document* pDocument = pPage->m_pDocument; | 492 CPDF_Document* pDocument = pPage->m_pDocument; |
517 FX_DWORD dwPermissions = pDocument->GetUserPermissions(); | 493 FX_DWORD dwPermissions = pDocument->GetUserPermissions(); |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
577 | 553 |
578 delete it->second; | 554 delete it->second; |
579 m_Maps.erase(it); | 555 m_Maps.erase(it); |
580 } | 556 } |
581 | 557 |
582 void CFFL_IFormFiller::QueryWherePopup(void* pPrivateData, | 558 void CFFL_IFormFiller::QueryWherePopup(void* pPrivateData, |
583 FX_FLOAT fPopupMin, | 559 FX_FLOAT fPopupMin, |
584 FX_FLOAT fPopupMax, | 560 FX_FLOAT fPopupMax, |
585 int32_t& nRet, | 561 int32_t& nRet, |
586 FX_FLOAT& fPopupRet) { | 562 FX_FLOAT& fPopupRet) { |
587 ASSERT(pPrivateData != NULL); | |
588 | |
589 CFFL_PrivateData* pData = (CFFL_PrivateData*)pPrivateData; | 563 CFFL_PrivateData* pData = (CFFL_PrivateData*)pPrivateData; |
590 | 564 |
591 CPDF_Rect rcPageView(0, 0, 0, 0); | 565 CPDF_Rect rcPageView(0, 0, 0, 0); |
592 rcPageView.right = pData->pWidget->GetPDFPage()->GetPageWidth(); | 566 rcPageView.right = pData->pWidget->GetPDFPage()->GetPageWidth(); |
593 rcPageView.bottom = pData->pWidget->GetPDFPage()->GetPageHeight(); | 567 rcPageView.bottom = pData->pWidget->GetPDFPage()->GetPageHeight(); |
594 rcPageView.Normalize(); | 568 rcPageView.Normalize(); |
595 | 569 |
596 ASSERT(pData->pWidget != NULL); | |
597 CPDF_Rect rcAnnot = pData->pWidget->GetRect(); | 570 CPDF_Rect rcAnnot = pData->pWidget->GetRect(); |
598 | 571 |
599 FX_FLOAT fTop = 0.0f; | 572 FX_FLOAT fTop = 0.0f; |
600 FX_FLOAT fBottom = 0.0f; | 573 FX_FLOAT fBottom = 0.0f; |
601 | 574 |
602 CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pData->pWidget; | 575 CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pData->pWidget; |
603 switch (pWidget->GetRotate() / 90) { | 576 switch (pWidget->GetRotate() / 90) { |
604 default: | 577 default: |
605 case 0: | 578 case 0: |
606 fTop = rcPageView.top - rcAnnot.top; | 579 fTop = rcPageView.top - rcAnnot.top; |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
653 nRet = bBottom ? 0 : 1; | 626 nRet = bBottom ? 0 : 1; |
654 fPopupRet = fFactHeight; | 627 fPopupRet = fFactHeight; |
655 } | 628 } |
656 | 629 |
657 void CFFL_IFormFiller::OnKeyStrokeCommit(CPDFSDK_Widget* pWidget, | 630 void CFFL_IFormFiller::OnKeyStrokeCommit(CPDFSDK_Widget* pWidget, |
658 CPDFSDK_PageView* pPageView, | 631 CPDFSDK_PageView* pPageView, |
659 FX_BOOL& bRC, | 632 FX_BOOL& bRC, |
660 FX_BOOL& bExit, | 633 FX_BOOL& bExit, |
661 FX_DWORD nFlag) { | 634 FX_DWORD nFlag) { |
662 if (!m_bNotifying) { | 635 if (!m_bNotifying) { |
663 ASSERT(pWidget != NULL); | |
664 if (pWidget->GetAAction(CPDF_AAction::KeyStroke)) { | 636 if (pWidget->GetAAction(CPDF_AAction::KeyStroke)) { |
665 m_bNotifying = TRUE; | 637 m_bNotifying = TRUE; |
666 pWidget->ClearAppModified(); | 638 pWidget->ClearAppModified(); |
667 | 639 |
668 ASSERT(pPageView != NULL); | 640 ASSERT(pPageView); |
669 | 641 |
670 PDFSDK_FieldAction fa; | 642 PDFSDK_FieldAction fa; |
671 fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlag); | 643 fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlag); |
672 fa.bShift = m_pApp->FFI_IsSHIFTKeyDown(nFlag); | 644 fa.bShift = m_pApp->FFI_IsSHIFTKeyDown(nFlag); |
673 fa.bWillCommit = TRUE; | 645 fa.bWillCommit = TRUE; |
674 fa.bKeyDown = TRUE; | 646 fa.bKeyDown = TRUE; |
675 fa.bRC = TRUE; | 647 fa.bRC = TRUE; |
676 | 648 |
677 CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, FALSE); | 649 CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, FALSE); |
678 ASSERT(pFormFiller != NULL); | |
679 | |
680 pFormFiller->GetActionData(pPageView, CPDF_AAction::KeyStroke, fa); | 650 pFormFiller->GetActionData(pPageView, CPDF_AAction::KeyStroke, fa); |
681 pFormFiller->SaveState(pPageView); | 651 pFormFiller->SaveState(pPageView); |
682 | 652 |
683 PDFSDK_FieldAction faOld = fa; | 653 PDFSDK_FieldAction faOld = fa; |
684 pWidget->OnAAction(CPDF_AAction::KeyStroke, fa, pPageView); | 654 pWidget->OnAAction(CPDF_AAction::KeyStroke, fa, pPageView); |
685 | 655 |
686 bRC = fa.bRC; | 656 bRC = fa.bRC; |
687 // bExit = !IsValidAnnot(m_pApp, pDocument, pDocView, pPageView, | |
688 // pWidget); | |
689 | |
690 m_bNotifying = FALSE; | 657 m_bNotifying = FALSE; |
691 } | 658 } |
692 } | 659 } |
693 } | 660 } |
694 | 661 |
695 void CFFL_IFormFiller::OnValidate(CPDFSDK_Widget* pWidget, | 662 void CFFL_IFormFiller::OnValidate(CPDFSDK_Widget* pWidget, |
696 CPDFSDK_PageView* pPageView, | 663 CPDFSDK_PageView* pPageView, |
697 FX_BOOL& bRC, | 664 FX_BOOL& bRC, |
698 FX_BOOL& bExit, | 665 FX_BOOL& bExit, |
699 FX_DWORD nFlag) { | 666 FX_DWORD nFlag) { |
700 if (!m_bNotifying) { | 667 if (!m_bNotifying) { |
701 ASSERT(pWidget != NULL); | |
702 if (pWidget->GetAAction(CPDF_AAction::Validate)) { | 668 if (pWidget->GetAAction(CPDF_AAction::Validate)) { |
703 m_bNotifying = TRUE; | 669 m_bNotifying = TRUE; |
704 pWidget->ClearAppModified(); | 670 pWidget->ClearAppModified(); |
705 | 671 |
706 ASSERT(pPageView != NULL); | 672 ASSERT(pPageView); |
707 // CReader_DocView* pDocView = pPageView->GetDocView(); | |
708 // ASSERT(pDocView != NULL); | |
709 | 673 |
710 PDFSDK_FieldAction fa; | 674 PDFSDK_FieldAction fa; |
711 fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlag); | 675 fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlag); |
712 fa.bShift = m_pApp->FFI_IsSHIFTKeyDown(nFlag); | 676 fa.bShift = m_pApp->FFI_IsSHIFTKeyDown(nFlag); |
713 fa.bKeyDown = TRUE; | 677 fa.bKeyDown = TRUE; |
714 fa.bRC = TRUE; | 678 fa.bRC = TRUE; |
715 | 679 |
716 CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, FALSE); | 680 CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, FALSE); |
717 ASSERT(pFormFiller != NULL); | |
718 | |
719 pFormFiller->GetActionData(pPageView, CPDF_AAction::Validate, fa); | 681 pFormFiller->GetActionData(pPageView, CPDF_AAction::Validate, fa); |
720 pFormFiller->SaveState(pPageView); | 682 pFormFiller->SaveState(pPageView); |
721 | 683 |
722 PDFSDK_FieldAction faOld = fa; | 684 PDFSDK_FieldAction faOld = fa; |
723 pWidget->OnAAction(CPDF_AAction::Validate, fa, pPageView); | 685 pWidget->OnAAction(CPDF_AAction::Validate, fa, pPageView); |
724 | 686 |
725 bRC = fa.bRC; | 687 bRC = fa.bRC; |
726 // bExit = !IsValidAnnot(m_pApp, pDocument, pDocView, pPageView, | |
727 // pWidget); | |
728 | |
729 m_bNotifying = FALSE; | 688 m_bNotifying = FALSE; |
730 } | 689 } |
731 } | 690 } |
732 } | 691 } |
733 | 692 |
734 void CFFL_IFormFiller::OnCalculate(CPDFSDK_Widget* pWidget, | 693 void CFFL_IFormFiller::OnCalculate(CPDFSDK_Widget* pWidget, |
735 CPDFSDK_PageView* pPageView, | 694 CPDFSDK_PageView* pPageView, |
736 FX_BOOL& bExit, | 695 FX_BOOL& bExit, |
737 FX_DWORD nFlag) { | 696 FX_DWORD nFlag) { |
738 if (!m_bNotifying) { | 697 if (!m_bNotifying) { |
739 ASSERT(pWidget != NULL); | 698 ASSERT(pWidget); |
740 ASSERT(pPageView != NULL); | |
741 // CReader_DocView* pDocView = pPageView->GetDocView(); | |
742 // ASSERT(pDocView != NULL); | |
743 CPDFSDK_Document* pDocument = pPageView->GetSDKDocument(); | 699 CPDFSDK_Document* pDocument = pPageView->GetSDKDocument(); |
744 ASSERT(pDocument != NULL); | |
745 | |
746 CPDFSDK_InterForm* pInterForm = | 700 CPDFSDK_InterForm* pInterForm = |
747 (CPDFSDK_InterForm*)pDocument->GetInterForm(); | 701 (CPDFSDK_InterForm*)pDocument->GetInterForm(); |
748 ASSERT(pInterForm != NULL); | |
749 | |
750 pInterForm->OnCalculate(pWidget->GetFormField()); | 702 pInterForm->OnCalculate(pWidget->GetFormField()); |
751 | 703 |
752 // bExit = !IsValidAnnot(m_pApp, pDocument, pDocView, pPageView, | |
753 // pWidget); | |
754 | |
755 m_bNotifying = FALSE; | 704 m_bNotifying = FALSE; |
756 } | 705 } |
757 } | 706 } |
758 | 707 |
759 void CFFL_IFormFiller::OnFormat(CPDFSDK_Widget* pWidget, | 708 void CFFL_IFormFiller::OnFormat(CPDFSDK_Widget* pWidget, |
760 CPDFSDK_PageView* pPageView, | 709 CPDFSDK_PageView* pPageView, |
761 FX_BOOL& bExit, | 710 FX_BOOL& bExit, |
762 FX_DWORD nFlag) { | 711 FX_DWORD nFlag) { |
763 if (!m_bNotifying) { | 712 if (!m_bNotifying) { |
764 ASSERT(pWidget != NULL); | 713 ASSERT(pWidget); |
765 ASSERT(pPageView != NULL); | |
766 // CReader_DocView* pDocView = pPageView->GetDocView(); | |
767 // ASSERT(pDocView != NULL); | |
768 CPDFSDK_Document* pDocument = pPageView->GetSDKDocument(); | 714 CPDFSDK_Document* pDocument = pPageView->GetSDKDocument(); |
769 ASSERT(pDocument != NULL); | |
770 | |
771 CPDFSDK_InterForm* pInterForm = | 715 CPDFSDK_InterForm* pInterForm = |
772 (CPDFSDK_InterForm*)pDocument->GetInterForm(); | 716 (CPDFSDK_InterForm*)pDocument->GetInterForm(); |
773 ASSERT(pInterForm != NULL); | |
774 | 717 |
775 FX_BOOL bFormated = FALSE; | 718 FX_BOOL bFormated = FALSE; |
776 CFX_WideString sValue = | 719 CFX_WideString sValue = |
777 pInterForm->OnFormat(pWidget->GetFormField(), bFormated); | 720 pInterForm->OnFormat(pWidget->GetFormField(), bFormated); |
778 | 721 |
779 // bExit = !IsValidAnnot(m_pApp, pDocument, pDocView, pPageView, | |
780 // pWidget); | |
781 | |
782 if (bExit) | 722 if (bExit) |
783 return; | 723 return; |
784 | 724 |
785 if (bFormated) { | 725 if (bFormated) { |
786 pInterForm->ResetFieldAppearance(pWidget->GetFormField(), sValue.c_str(), | 726 pInterForm->ResetFieldAppearance(pWidget->GetFormField(), sValue.c_str(), |
787 TRUE); | 727 TRUE); |
788 pInterForm->UpdateField(pWidget->GetFormField()); | 728 pInterForm->UpdateField(pWidget->GetFormField()); |
789 } | 729 } |
790 | 730 |
791 m_bNotifying = FALSE; | 731 m_bNotifying = FALSE; |
(...skipping 10 matching lines...) Expand all Loading... |
802 | 742 |
803 void CFFL_IFormFiller::OnBeforeKeyStroke(void* pPrivateData, | 743 void CFFL_IFormFiller::OnBeforeKeyStroke(void* pPrivateData, |
804 CFX_WideString& strChange, | 744 CFX_WideString& strChange, |
805 const CFX_WideString& strChangeEx, | 745 const CFX_WideString& strChangeEx, |
806 int nSelStart, | 746 int nSelStart, |
807 int nSelEnd, | 747 int nSelEnd, |
808 FX_BOOL bKeyDown, | 748 FX_BOOL bKeyDown, |
809 FX_BOOL& bRC, | 749 FX_BOOL& bRC, |
810 FX_BOOL& bExit, | 750 FX_BOOL& bExit, |
811 FX_DWORD nFlag) { | 751 FX_DWORD nFlag) { |
812 ASSERT(pPrivateData != NULL); | |
813 CFFL_PrivateData* pData = (CFFL_PrivateData*)pPrivateData; | 752 CFFL_PrivateData* pData = (CFFL_PrivateData*)pPrivateData; |
814 ASSERT(pData->pWidget != NULL); | 753 ASSERT(pData->pWidget); |
815 | 754 |
816 CFFL_FormFiller* pFormFiller = GetFormFiller(pData->pWidget, FALSE); | 755 CFFL_FormFiller* pFormFiller = GetFormFiller(pData->pWidget, FALSE); |
817 ASSERT(pFormFiller != NULL); | |
818 | |
819 if (!m_bNotifying) { | 756 if (!m_bNotifying) { |
820 if (pData->pWidget->GetAAction(CPDF_AAction::KeyStroke)) { | 757 if (pData->pWidget->GetAAction(CPDF_AAction::KeyStroke)) { |
821 m_bNotifying = TRUE; | 758 m_bNotifying = TRUE; |
822 int nAge = pData->pWidget->GetAppearanceAge(); | 759 int nAge = pData->pWidget->GetAppearanceAge(); |
823 int nValueAge = pData->pWidget->GetValueAge(); | 760 int nValueAge = pData->pWidget->GetValueAge(); |
824 | 761 |
825 ASSERT(pData->pPageView != NULL); | |
826 CPDFSDK_Document* pDocument = pData->pPageView->GetSDKDocument(); | 762 CPDFSDK_Document* pDocument = pData->pPageView->GetSDKDocument(); |
827 | 763 |
828 PDFSDK_FieldAction fa; | 764 PDFSDK_FieldAction fa; |
829 fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlag); | 765 fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlag); |
830 fa.bShift = m_pApp->FFI_IsSHIFTKeyDown(nFlag); | 766 fa.bShift = m_pApp->FFI_IsSHIFTKeyDown(nFlag); |
831 fa.sChange = strChange; | 767 fa.sChange = strChange; |
832 fa.sChangeEx = strChangeEx; | 768 fa.sChangeEx = strChangeEx; |
833 fa.bKeyDown = bKeyDown; | 769 fa.bKeyDown = bKeyDown; |
834 fa.bWillCommit = FALSE; | 770 fa.bWillCommit = FALSE; |
835 fa.bRC = TRUE; | 771 fa.bRC = TRUE; |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
872 bExit = TRUE; | 808 bExit = TRUE; |
873 m_bNotifying = FALSE; | 809 m_bNotifying = FALSE; |
874 return; | 810 return; |
875 } | 811 } |
876 } | 812 } |
877 | 813 |
878 m_bNotifying = FALSE; | 814 m_bNotifying = FALSE; |
879 } | 815 } |
880 } | 816 } |
881 } | 817 } |
OLD | NEW |