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.
4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
7 #include "fpdfsdk/formfiller/cffl_formfiller.h"
8
9 #include <utility>
10
11 #include "constants/form_flags.h"
12 #include "core/fpdfapi/page/cpdf_page.h"
13 #include "core/fxge/cfx_renderdevice.h"
14 #include "fpdfsdk/cpdfsdk_formfillenvironment.h"
15 #include "fpdfsdk/cpdfsdk_pageview.h"
16 #include "fpdfsdk/cpdfsdk_widget.h"
17
CFFL_FormFiller(CPDFSDK_FormFillEnvironment * pFormFillEnv,CPDFSDK_Widget * pWidget)18 CFFL_FormFiller::CFFL_FormFiller(CPDFSDK_FormFillEnvironment* pFormFillEnv,
19 CPDFSDK_Widget* pWidget)
20 : m_pFormFillEnv(pFormFillEnv), m_pWidget(pWidget) {
21 ASSERT(m_pFormFillEnv);
22 }
23
~CFFL_FormFiller()24 CFFL_FormFiller::~CFFL_FormFiller() {
25 DestroyWindows();
26 }
27
DestroyWindows()28 void CFFL_FormFiller::DestroyWindows() {
29 while (!m_Maps.empty()) {
30 auto it = m_Maps.begin();
31 std::unique_ptr<CPWL_Wnd> pWnd = std::move(it->second);
32 m_Maps.erase(it);
33 pWnd->InvalidateProvider(this);
34 pWnd->Destroy();
35 }
36 }
37
GetViewBBox(CPDFSDK_PageView * pPageView)38 FX_RECT CFFL_FormFiller::GetViewBBox(CPDFSDK_PageView* pPageView) {
39 CPWL_Wnd* pWnd = GetPWLWindow(pPageView, false);
40 CFX_FloatRect rcAnnot =
41 pWnd ? PWLtoFFL(pWnd->GetWindowRect()) : m_pWidget->GetRect();
42 CFX_FloatRect rcFocus = GetFocusBox(pPageView);
43
44 CFX_FloatRect rcWin = rcAnnot;
45 if (!rcFocus.IsEmpty())
46 rcWin.Union(rcFocus);
47 if (!rcWin.IsEmpty()) {
48 rcWin.Inflate(1, 1);
49 rcWin.Normalize();
50 }
51
52 return rcWin.GetOuterRect();
53 }
54
OnDraw(CPDFSDK_PageView * pPageView,CPDFSDK_Annot * pAnnot,CFX_RenderDevice * pDevice,const CFX_Matrix & mtUser2Device)55 void CFFL_FormFiller::OnDraw(CPDFSDK_PageView* pPageView,
56 CPDFSDK_Annot* pAnnot,
57 CFX_RenderDevice* pDevice,
58 const CFX_Matrix& mtUser2Device) {
59 CPWL_Wnd* pWnd = GetPWLWindow(pPageView, false);
60 if (pWnd) {
61 pWnd->DrawAppearance(pDevice, GetCurMatrix() * mtUser2Device);
62 return;
63 }
64
65 CPDFSDK_Widget* pWidget = ToCPDFSDKWidget(pAnnot);
66 if (!CFFL_InteractiveFormFiller::IsVisible(pWidget))
67 return;
68
69 pWidget->DrawAppearance(pDevice, mtUser2Device, CPDF_Annot::Normal, nullptr);
70 }
71
OnDrawDeactive(CPDFSDK_PageView * pPageView,CPDFSDK_Annot * pAnnot,CFX_RenderDevice * pDevice,const CFX_Matrix & mtUser2Device)72 void CFFL_FormFiller::OnDrawDeactive(CPDFSDK_PageView* pPageView,
73 CPDFSDK_Annot* pAnnot,
74 CFX_RenderDevice* pDevice,
75 const CFX_Matrix& mtUser2Device) {
76 ToCPDFSDKWidget(pAnnot)->DrawAppearance(pDevice, mtUser2Device,
77 CPDF_Annot::Normal, nullptr);
78 }
79
OnMouseEnter(CPDFSDK_PageView * pPageView)80 void CFFL_FormFiller::OnMouseEnter(CPDFSDK_PageView* pPageView) {}
81
OnMouseExit(CPDFSDK_PageView * pPageView)82 void CFFL_FormFiller::OnMouseExit(CPDFSDK_PageView* pPageView) {
83 m_pTimer.reset();
84 ASSERT(m_pWidget);
85 }
86
OnLButtonDown(CPDFSDK_PageView * pPageView,CPDFSDK_Annot * pAnnot,uint32_t nFlags,const CFX_PointF & point)87 bool CFFL_FormFiller::OnLButtonDown(CPDFSDK_PageView* pPageView,
88 CPDFSDK_Annot* pAnnot,
89 uint32_t nFlags,
90 const CFX_PointF& point) {
91 CPWL_Wnd* pWnd = GetPWLWindow(pPageView, true);
92 if (!pWnd)
93 return false;
94
95 m_bValid = true;
96 FX_RECT rect = GetViewBBox(pPageView);
97 InvalidateRect(rect);
98 if (!rect.Contains(static_cast<int>(point.x), static_cast<int>(point.y)))
99 return false;
100 return pWnd->OnLButtonDown(WndtoPWL(point), nFlags);
101 }
102
OnLButtonUp(CPDFSDK_PageView * pPageView,CPDFSDK_Annot * pAnnot,uint32_t nFlags,const CFX_PointF & point)103 bool CFFL_FormFiller::OnLButtonUp(CPDFSDK_PageView* pPageView,
104 CPDFSDK_Annot* pAnnot,
105 uint32_t nFlags,
106 const CFX_PointF& point) {
107 CPWL_Wnd* pWnd = GetPWLWindow(pPageView, false);
108 if (!pWnd)
109 return false;
110
111 InvalidateRect(GetViewBBox(pPageView));
112 pWnd->OnLButtonUp(WndtoPWL(point), nFlags);
113 return true;
114 }
115
OnLButtonDblClk(CPDFSDK_PageView * pPageView,uint32_t nFlags,const CFX_PointF & point)116 bool CFFL_FormFiller::OnLButtonDblClk(CPDFSDK_PageView* pPageView,
117 uint32_t nFlags,
118 const CFX_PointF& point) {
119 CPWL_Wnd* pWnd = GetPWLWindow(pPageView, false);
120 if (!pWnd)
121 return false;
122
123 pWnd->OnLButtonDblClk(WndtoPWL(point), nFlags);
124 return true;
125 }
126
OnMouseMove(CPDFSDK_PageView * pPageView,uint32_t nFlags,const CFX_PointF & point)127 bool CFFL_FormFiller::OnMouseMove(CPDFSDK_PageView* pPageView,
128 uint32_t nFlags,
129 const CFX_PointF& point) {
130 CPWL_Wnd* pWnd = GetPWLWindow(pPageView, false);
131 if (!pWnd)
132 return false;
133
134 pWnd->OnMouseMove(WndtoPWL(point), nFlags);
135 return true;
136 }
137
OnMouseWheel(CPDFSDK_PageView * pPageView,uint32_t nFlags,short zDelta,const CFX_PointF & point)138 bool CFFL_FormFiller::OnMouseWheel(CPDFSDK_PageView* pPageView,
139 uint32_t nFlags,
140 short zDelta,
141 const CFX_PointF& point) {
142 if (!IsValid())
143 return false;
144
145 CPWL_Wnd* pWnd = GetPWLWindow(pPageView, true);
146 return pWnd && pWnd->OnMouseWheel(zDelta, WndtoPWL(point), nFlags);
147 }
148
OnRButtonDown(CPDFSDK_PageView * pPageView,uint32_t nFlags,const CFX_PointF & point)149 bool CFFL_FormFiller::OnRButtonDown(CPDFSDK_PageView* pPageView,
150 uint32_t nFlags,
151 const CFX_PointF& point) {
152 CPWL_Wnd* pWnd = GetPWLWindow(pPageView, true);
153 return pWnd && pWnd->OnRButtonDown(WndtoPWL(point), nFlags);
154 }
155
OnRButtonUp(CPDFSDK_PageView * pPageView,uint32_t nFlags,const CFX_PointF & point)156 bool CFFL_FormFiller::OnRButtonUp(CPDFSDK_PageView* pPageView,
157 uint32_t nFlags,
158 const CFX_PointF& point) {
159 CPWL_Wnd* pWnd = GetPWLWindow(pPageView, false);
160 return pWnd && pWnd->OnRButtonUp(WndtoPWL(point), nFlags);
161 }
162
OnKeyDown(uint32_t nKeyCode,uint32_t nFlags)163 bool CFFL_FormFiller::OnKeyDown(uint32_t nKeyCode, uint32_t nFlags) {
164 if (!IsValid())
165 return false;
166
167 CPWL_Wnd* pWnd = GetPWLWindow(GetCurPageView(true), false);
168 return pWnd && pWnd->OnKeyDown(nKeyCode, nFlags);
169 }
170
OnChar(CPDFSDK_Annot * pAnnot,uint32_t nChar,uint32_t nFlags)171 bool CFFL_FormFiller::OnChar(CPDFSDK_Annot* pAnnot,
172 uint32_t nChar,
173 uint32_t nFlags) {
174 if (!IsValid())
175 return false;
176
177 CPWL_Wnd* pWnd = GetPWLWindow(GetCurPageView(true), false);
178 return pWnd && pWnd->OnChar(nChar, nFlags);
179 }
180
SetIndexSelected(int index,bool selected)181 bool CFFL_FormFiller::SetIndexSelected(int index, bool selected) {
182 return false;
183 }
184
IsIndexSelected(int index)185 bool CFFL_FormFiller::IsIndexSelected(int index) {
186 return false;
187 }
188
GetText()189 WideString CFFL_FormFiller::GetText() {
190 if (!IsValid())
191 return WideString();
192
193 CPWL_Wnd* pWnd = GetPWLWindow(GetCurPageView(true), false);
194 return pWnd ? pWnd->GetText() : WideString();
195 }
196
GetSelectedText()197 WideString CFFL_FormFiller::GetSelectedText() {
198 if (!IsValid())
199 return WideString();
200
201 CPWL_Wnd* pWnd = GetPWLWindow(GetCurPageView(true), false);
202 return pWnd ? pWnd->GetSelectedText() : WideString();
203 }
204
ReplaceSelection(const WideString & text)205 void CFFL_FormFiller::ReplaceSelection(const WideString& text) {
206 if (!IsValid())
207 return;
208
209 CPWL_Wnd* pWnd = GetPWLWindow(GetCurPageView(true), false);
210 if (!pWnd)
211 return;
212
213 pWnd->ReplaceSelection(text);
214 }
215
CanUndo()216 bool CFFL_FormFiller::CanUndo() {
217 if (!IsValid())
218 return false;
219
220 CPWL_Wnd* pWnd = GetPWLWindow(GetCurPageView(true), false);
221 return pWnd && pWnd->CanUndo();
222 }
223
CanRedo()224 bool CFFL_FormFiller::CanRedo() {
225 if (!IsValid())
226 return false;
227
228 CPWL_Wnd* pWnd = GetPWLWindow(GetCurPageView(true), false);
229 return pWnd && pWnd->CanRedo();
230 }
231
Undo()232 bool CFFL_FormFiller::Undo() {
233 if (!IsValid())
234 return false;
235
236 CPWL_Wnd* pWnd = GetPWLWindow(GetCurPageView(true), false);
237 return pWnd && pWnd->Undo();
238 }
239
Redo()240 bool CFFL_FormFiller::Redo() {
241 if (!IsValid())
242 return false;
243
244 CPWL_Wnd* pWnd = GetPWLWindow(GetCurPageView(true), false);
245 return pWnd && pWnd->Redo();
246 }
247
SetFocusForAnnot(CPDFSDK_Annot * pAnnot,uint32_t nFlag)248 void CFFL_FormFiller::SetFocusForAnnot(CPDFSDK_Annot* pAnnot, uint32_t nFlag) {
249 CPDFSDK_Widget* pWidget = ToCPDFSDKWidget(pAnnot);
250 IPDF_Page* pPage = pWidget->GetPage();
251 CPDFSDK_PageView* pPageView = m_pFormFillEnv->GetPageView(pPage, true);
252 if (CPWL_Wnd* pWnd = GetPWLWindow(pPageView, true))
253 pWnd->SetFocus();
254
255 m_bValid = true;
256 InvalidateRect(GetViewBBox(pPageView));
257 }
258
KillFocusForAnnot(uint32_t nFlag)259 void CFFL_FormFiller::KillFocusForAnnot(uint32_t nFlag) {
260 if (!IsValid())
261 return;
262
263 CPDFSDK_PageView* pPageView = GetCurPageView(false);
264 if (!pPageView || !CommitData(pPageView, nFlag))
265 return;
266 if (CPWL_Wnd* pWnd = GetPWLWindow(pPageView, false))
267 pWnd->KillFocus();
268
269 bool bDestroyPWLWindow;
270 switch (m_pWidget->GetFieldType()) {
271 case FormFieldType::kPushButton:
272 case FormFieldType::kCheckBox:
273 case FormFieldType::kRadioButton:
274 bDestroyPWLWindow = true;
275 break;
276 default:
277 bDestroyPWLWindow = false;
278 break;
279 }
280 EscapeFiller(pPageView, bDestroyPWLWindow);
281 }
282
IsValid() const283 bool CFFL_FormFiller::IsValid() const {
284 return m_bValid;
285 }
286
GetCreateParam()287 CPWL_Wnd::CreateParams CFFL_FormFiller::GetCreateParam() {
288 CPWL_Wnd::CreateParams cp;
289 cp.pProvider.Reset(this);
290 cp.rcRectWnd = GetPDFAnnotRect();
291
292 uint32_t dwCreateFlags = PWS_BORDER | PWS_BACKGROUND | PWS_VISIBLE;
293 uint32_t dwFieldFlag = m_pWidget->GetFieldFlags();
294 if (dwFieldFlag & pdfium::form_flags::kReadOnly)
295 dwCreateFlags |= PWS_READONLY;
296
297 Optional<FX_COLORREF> color = m_pWidget->GetFillColor();
298 if (color.has_value())
299 cp.sBackgroundColor = CFX_Color(color.value());
300 color = m_pWidget->GetBorderColor();
301 if (color.has_value())
302 cp.sBorderColor = CFX_Color(color.value());
303
304 cp.sTextColor = CFX_Color(CFX_Color::kGray, 0);
305
306 color = m_pWidget->GetTextColor();
307 if (color.has_value())
308 cp.sTextColor = CFX_Color(color.value());
309
310 cp.fFontSize = m_pWidget->GetFontSize();
311 cp.dwBorderWidth = m_pWidget->GetBorderWidth();
312
313 cp.nBorderStyle = m_pWidget->GetBorderStyle();
314 switch (cp.nBorderStyle) {
315 case BorderStyle::DASH:
316 cp.sDash = CPWL_Dash(3, 3, 0);
317 break;
318 case BorderStyle::BEVELED:
319 case BorderStyle::INSET:
320 cp.dwBorderWidth *= 2;
321 break;
322 default:
323 break;
324 }
325
326 if (cp.fFontSize <= 0)
327 dwCreateFlags |= PWS_AUTOFONTSIZE;
328
329 cp.dwFlags = dwCreateFlags;
330 cp.pTimerHandler = m_pFormFillEnv->GetTimerHandler();
331 cp.pSystemHandler = m_pFormFillEnv->GetSysHandler();
332 return cp;
333 }
334
GetPWLWindow(CPDFSDK_PageView * pPageView,bool bNew)335 CPWL_Wnd* CFFL_FormFiller::GetPWLWindow(CPDFSDK_PageView* pPageView,
336 bool bNew) {
337 ASSERT(pPageView);
338 auto it = m_Maps.find(pPageView);
339 if (it == m_Maps.end()) {
340 if (!bNew)
341 return nullptr;
342
343 CPWL_Wnd::CreateParams cp = GetCreateParam();
344 auto pPrivateData = pdfium::MakeUnique<CFFL_PrivateData>();
345 pPrivateData->pWidget.Reset(m_pWidget.Get());
346 pPrivateData->pPageView = pPageView;
347 pPrivateData->nWidgetAppearanceAge = m_pWidget->GetAppearanceAge();
348 pPrivateData->nWidgetValueAge = 0;
349 m_Maps[pPageView] = NewPWLWindow(cp, std::move(pPrivateData));
350 return m_Maps[pPageView].get();
351 }
352
353 CPWL_Wnd* pWnd = it->second.get();
354 if (!bNew)
355 return pWnd;
356
357 const auto* pPrivateData =
358 static_cast<const CFFL_PrivateData*>(pWnd->GetAttachedData());
359 if (pPrivateData->nWidgetAppearanceAge == m_pWidget->GetAppearanceAge())
360 return pWnd;
361
362 return ResetPWLWindow(
363 pPageView, pPrivateData->nWidgetValueAge == m_pWidget->GetValueAge());
364 }
365
DestroyPWLWindow(CPDFSDK_PageView * pPageView)366 void CFFL_FormFiller::DestroyPWLWindow(CPDFSDK_PageView* pPageView) {
367 auto it = m_Maps.find(pPageView);
368 if (it == m_Maps.end())
369 return;
370
371 std::unique_ptr<CPWL_Wnd> pWnd = std::move(it->second);
372 m_Maps.erase(it);
373 pWnd->Destroy();
374 }
375
GetWindowMatrix(const IPWL_SystemHandler::PerWindowData * pAttached)376 CFX_Matrix CFFL_FormFiller::GetWindowMatrix(
377 const IPWL_SystemHandler::PerWindowData* pAttached) {
378 const auto* pPrivateData = static_cast<const CFFL_PrivateData*>(pAttached);
379 if (!pPrivateData || !pPrivateData->pPageView)
380 return CFX_Matrix();
381
382 return GetCurMatrix() * pPrivateData->pPageView->GetCurrentMatrix();
383 }
384
GetCurMatrix()385 CFX_Matrix CFFL_FormFiller::GetCurMatrix() {
386 CFX_Matrix mt;
387 CFX_FloatRect rcDA = m_pWidget->GetPDFAnnot()->GetRect();
388 switch (m_pWidget->GetRotate()) {
389 case 90:
390 mt = CFX_Matrix(0, 1, -1, 0, rcDA.right - rcDA.left, 0);
391 break;
392 case 180:
393 mt = CFX_Matrix(-1, 0, 0, -1, rcDA.right - rcDA.left,
394 rcDA.top - rcDA.bottom);
395 break;
396 case 270:
397 mt = CFX_Matrix(0, -1, 1, 0, 0, rcDA.top - rcDA.bottom);
398 break;
399 case 0:
400 default:
401 break;
402 }
403 mt.e += rcDA.left;
404 mt.f += rcDA.bottom;
405
406 return mt;
407 }
408
GetPDFAnnotRect() const409 CFX_FloatRect CFFL_FormFiller::GetPDFAnnotRect() const {
410 CFX_FloatRect rectAnnot = m_pWidget->GetPDFAnnot()->GetRect();
411
412 float fWidth = rectAnnot.Width();
413 float fHeight = rectAnnot.Height();
414 if ((m_pWidget->GetRotate() / 90) & 0x01)
415 std::swap(fWidth, fHeight);
416 return CFX_FloatRect(0, 0, fWidth, fHeight);
417 }
418
GetCurPageView(bool renew)419 CPDFSDK_PageView* CFFL_FormFiller::GetCurPageView(bool renew) {
420 IPDF_Page* pPage = m_pWidget->GetPage();
421 return m_pFormFillEnv->GetPageView(pPage, renew);
422 }
423
GetFocusBox(CPDFSDK_PageView * pPageView)424 CFX_FloatRect CFFL_FormFiller::GetFocusBox(CPDFSDK_PageView* pPageView) {
425 CPWL_Wnd* pWnd = GetPWLWindow(pPageView, false);
426 if (!pWnd)
427 return CFX_FloatRect();
428
429 CFX_FloatRect rcFocus = FFLtoWnd(PWLtoFFL(pWnd->GetFocusRect()));
430 return pPageView->GetPDFPage()->GetBBox().Contains(rcFocus) ? rcFocus
431 : CFX_FloatRect();
432 }
433
FFLtoPWL(const CFX_FloatRect & rect)434 CFX_FloatRect CFFL_FormFiller::FFLtoPWL(const CFX_FloatRect& rect) {
435 return GetCurMatrix().GetInverse().TransformRect(rect);
436 }
437
PWLtoFFL(const CFX_FloatRect & rect)438 CFX_FloatRect CFFL_FormFiller::PWLtoFFL(const CFX_FloatRect& rect) {
439 return GetCurMatrix().TransformRect(rect);
440 }
441
FFLtoPWL(const CFX_PointF & point)442 CFX_PointF CFFL_FormFiller::FFLtoPWL(const CFX_PointF& point) {
443 return GetCurMatrix().GetInverse().Transform(point);
444 }
445
PWLtoFFL(const CFX_PointF & point)446 CFX_PointF CFFL_FormFiller::PWLtoFFL(const CFX_PointF& point) {
447 return GetCurMatrix().Transform(point);
448 }
449
WndtoPWL(const CFX_PointF & pt)450 CFX_PointF CFFL_FormFiller::WndtoPWL(const CFX_PointF& pt) {
451 return FFLtoPWL(pt);
452 }
453
FFLtoWnd(const CFX_FloatRect & rect)454 CFX_FloatRect CFFL_FormFiller::FFLtoWnd(const CFX_FloatRect& rect) {
455 return rect;
456 }
457
CommitData(CPDFSDK_PageView * pPageView,uint32_t nFlag)458 bool CFFL_FormFiller::CommitData(CPDFSDK_PageView* pPageView, uint32_t nFlag) {
459 if (!IsDataChanged(pPageView))
460 return true;
461
462 CFFL_InteractiveFormFiller* pFormFiller =
463 m_pFormFillEnv->GetInteractiveFormFiller();
464 ObservedPtr<CPDFSDK_Annot> pObserved(m_pWidget.Get());
465
466 if (!pFormFiller->OnKeyStrokeCommit(&pObserved, pPageView, nFlag)) {
467 if (!pObserved)
468 return false;
469 ResetPWLWindow(pPageView, false);
470 return true;
471 }
472 if (!pObserved)
473 return false;
474
475 if (!pFormFiller->OnValidate(&pObserved, pPageView, nFlag)) {
476 if (!pObserved)
477 return false;
478 ResetPWLWindow(pPageView, false);
479 return true;
480 }
481 if (!pObserved)
482 return false;
483
484 SaveData(pPageView); // may invoking JS to delete this widget.
485 if (!pObserved)
486 return false;
487
488 pFormFiller->OnCalculate(&pObserved, pPageView, nFlag);
489 if (!pObserved)
490 return false;
491
492 pFormFiller->OnFormat(&pObserved, pPageView, nFlag);
493 if (!pObserved)
494 return false;
495
496 return true;
497 }
498
IsDataChanged(CPDFSDK_PageView * pPageView)499 bool CFFL_FormFiller::IsDataChanged(CPDFSDK_PageView* pPageView) {
500 return false;
501 }
502
SaveData(CPDFSDK_PageView * pPageView)503 void CFFL_FormFiller::SaveData(CPDFSDK_PageView* pPageView) {}
504
505 #ifdef PDF_ENABLE_XFA
IsFieldFull(CPDFSDK_PageView * pPageView)506 bool CFFL_FormFiller::IsFieldFull(CPDFSDK_PageView* pPageView) {
507 return false;
508 }
509 #endif // PDF_ENABLE_XFA
510
SetChangeMark()511 void CFFL_FormFiller::SetChangeMark() {
512 m_pFormFillEnv->OnChange();
513 }
514
GetActionData(CPDFSDK_PageView * pPageView,CPDF_AAction::AActionType type,CPDFSDK_FieldAction & fa)515 void CFFL_FormFiller::GetActionData(CPDFSDK_PageView* pPageView,
516 CPDF_AAction::AActionType type,
517 CPDFSDK_FieldAction& fa) {
518 fa.sValue = m_pWidget->GetValue();
519 }
520
SetActionData(CPDFSDK_PageView * pPageView,CPDF_AAction::AActionType type,const CPDFSDK_FieldAction & fa)521 void CFFL_FormFiller::SetActionData(CPDFSDK_PageView* pPageView,
522 CPDF_AAction::AActionType type,
523 const CPDFSDK_FieldAction& fa) {}
524
SaveState(CPDFSDK_PageView * pPageView)525 void CFFL_FormFiller::SaveState(CPDFSDK_PageView* pPageView) {}
526
RestoreState(CPDFSDK_PageView * pPageView)527 void CFFL_FormFiller::RestoreState(CPDFSDK_PageView* pPageView) {}
528
ResetPWLWindow(CPDFSDK_PageView * pPageView,bool bRestoreValue)529 CPWL_Wnd* CFFL_FormFiller::ResetPWLWindow(CPDFSDK_PageView* pPageView,
530 bool bRestoreValue) {
531 return GetPWLWindow(pPageView, false);
532 }
533
OnTimerFired()534 void CFFL_FormFiller::OnTimerFired() {}
535
EscapeFiller(CPDFSDK_PageView * pPageView,bool bDestroyPWLWindow)536 void CFFL_FormFiller::EscapeFiller(CPDFSDK_PageView* pPageView,
537 bool bDestroyPWLWindow) {
538 m_bValid = false;
539
540 InvalidateRect(GetViewBBox(pPageView));
541 if (bDestroyPWLWindow)
542 DestroyPWLWindow(pPageView);
543 }
544
InvalidateRect(const FX_RECT & rect)545 void CFFL_FormFiller::InvalidateRect(const FX_RECT& rect) {
546 m_pFormFillEnv->Invalidate(m_pWidget->GetPage(), rect);
547 }
548