summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/formfiller/FFL_IFormFiller.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-07-17 09:16:17 -0700
committerTom Sepez <tsepez@chromium.org>2015-07-17 09:16:17 -0700
commitdcbc02f15e767e7d427fe6346d415c48da53afe0 (patch)
tree0a751aeef7e5f21f702dc9bff05848883ea370ea /fpdfsdk/src/formfiller/FFL_IFormFiller.cpp
parentd44f1074fa672f1765c69945eb37157279154999 (diff)
downloadpdfium-dcbc02f15e767e7d427fe6346d415c48da53afe0.tar.xz
Merge to XFA: Tidy up CPDFDOC_Environment.
Original Review URL: https://codereview.chromium.org/1235393002 . (cherry picked from commit fb07e2843dad0774d5842c2b08e7792164efc14a) R=thestig@chromium.org Review URL: https://codereview.chromium.org/1244503002 .
Diffstat (limited to 'fpdfsdk/src/formfiller/FFL_IFormFiller.cpp')
-rw-r--r--fpdfsdk/src/formfiller/FFL_IFormFiller.cpp23
1 files changed, 2 insertions, 21 deletions
diff --git a/fpdfsdk/src/formfiller/FFL_IFormFiller.cpp b/fpdfsdk/src/formfiller/FFL_IFormFiller.cpp
index 66ae237a31..dccb0408cf 100644
--- a/fpdfsdk/src/formfiller/FFL_IFormFiller.cpp
+++ b/fpdfsdk/src/formfiller/FFL_IFormFiller.cpp
@@ -81,20 +81,15 @@ void CFFL_IFormFiller::OnDraw(CPDFSDK_PageView* pPageView, /*HDC hDC,*/ CPDFSDK_
if (pFormFiller->IsValid())
{
pFormFiller->OnDraw(pPageView, pAnnot, pDevice, pUser2Device, dwFlags);
-
pAnnot->GetPDFPage();
-
- CPDFSDK_Document* pDocument = m_pApp->GetCurrentDoc();
- ASSERT(pDocument != NULL);
-
+ CPDFSDK_Document* pDocument = m_pApp->GetSDKDocument();
if (pDocument->GetFocusAnnot() == pAnnot)
{
CPDF_Rect rcFocus = pFormFiller->GetFocusBox(pPageView);
if (!rcFocus.IsEmpty())
{
CFX_PathData path;
-
path.SetPointCount(5);
path.SetPoint(0, rcFocus.left, rcFocus.top, FXPT_MOVETO);
path.SetPoint(1, rcFocus.left, rcFocus.bottom, FXPT_LINETO);
@@ -106,14 +101,10 @@ void CFFL_IFormFiller::OnDraw(CPDFSDK_PageView* pPageView, /*HDC hDC,*/ CPDFSDK_
gsd.SetDashCount(1);
gsd.m_DashArray[0] = 1.0f;
gsd.m_DashPhase = 0;
-
gsd.m_LineWidth = 1.0f;
pDevice->DrawPath(&path, pUser2Device, &gsd, 0, ArgbEncode(255,0,0,0), FXFILL_ALTERNATE);
-
- // ::DrawFocusRect(hDC, &rcFocus);
}
}
-
return;
}
}
@@ -124,10 +115,7 @@ void CFFL_IFormFiller::OnDraw(CPDFSDK_PageView* pPageView, /*HDC hDC,*/ CPDFSDK_
pWidget->DrawAppearance(pDevice, pUser2Device, CPDF_Annot::Normal, NULL);
if (!IsReadOnly(pWidget) && IsFillingAllowed(pWidget))
- {
pWidget->DrawShadow(pDevice, pPageView);
- }
-
}
}
@@ -292,14 +280,9 @@ FX_BOOL CFFL_IFormFiller::OnLButtonDown(CPDFSDK_PageView* pPageView, CPDFSDK_Ann
FX_BOOL CFFL_IFormFiller::OnLButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point)
{
- ASSERT(pAnnot != NULL);
ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget");
-
CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot;
- // CReader_Page* pPage = pAnnot->GetPage();
- // ASSERT(pPage != NULL);
- CPDFSDK_Document* pDocument = m_pApp->GetCurrentDoc();
- ASSERT(pDocument != NULL);
+ CPDFSDK_Document* pDocument = m_pApp->GetSDKDocument();
switch (pWidget->GetFieldType())
{
@@ -307,9 +290,7 @@ FX_BOOL CFFL_IFormFiller::OnLButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot
case FIELDTYPE_CHECKBOX:
case FIELDTYPE_RADIOBUTTON:
if (GetViewBBox(pPageView, pAnnot).Contains((int)point.x, (int)point.y))
- {
pDocument->SetFocusAnnot(pAnnot);
- }
break;
default:
pDocument->SetFocusAnnot(pAnnot);