Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(704)

Unified Diff: fpdfsdk/src/formfiller/FFL_IFormFiller.cpp

Issue 1244503002: Merge to XFA: Tidy up CPDFDOC_Environment. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Address comments, also remove two noisy unused var. Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « fpdfsdk/src/formfiller/FFL_FormFiller.cpp ('k') | fpdfsdk/src/fpdfformfill.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/src/formfiller/FFL_IFormFiller.cpp
diff --git a/fpdfsdk/src/formfiller/FFL_IFormFiller.cpp b/fpdfsdk/src/formfiller/FFL_IFormFiller.cpp
index 66ae237a311e2f610f25a199924c6de68fc847b7..dccb0408cfef23cf679616444e1bc0090d62c093 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);
« no previous file with comments | « fpdfsdk/src/formfiller/FFL_FormFiller.cpp ('k') | fpdfsdk/src/fpdfformfill.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698