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

Side by Side Diff: fpdfsdk/cpdfsdk_widgethandler.cpp

Issue 2400673002: Convert CPDFSDK_PageView to have a CPDFSDK_FormFillEnvironment (Closed)
Patch Set: Rebase to master Created 4 years, 2 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 unified diff | Download patch
« no previous file with comments | « fpdfsdk/cpdfsdk_widget.cpp ('k') | fpdfsdk/cpdfsdk_xfawidgethandler.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 PDFium Authors. All rights reserved. 1 // Copyright 2016 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/cpdfsdk_widgethandler.h" 7 #include "fpdfsdk/cpdfsdk_widgethandler.h"
8 8
9 #include <memory> 9 #include <memory>
10 #include <vector> 10 #include <vector>
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 int nFieldType = pWidget->GetFieldType(); 244 int nFieldType = pWidget->GetFieldType();
245 if (nFieldType == FIELDTYPE_TEXTFIELD || nFieldType == FIELDTYPE_COMBOBOX) { 245 if (nFieldType == FIELDTYPE_TEXTFIELD || nFieldType == FIELDTYPE_COMBOBOX) {
246 FX_BOOL bFormatted = FALSE; 246 FX_BOOL bFormatted = FALSE;
247 CFX_WideString sValue = pWidget->OnFormat(bFormatted); 247 CFX_WideString sValue = pWidget->OnFormat(bFormatted);
248 if (bFormatted && nFieldType == FIELDTYPE_COMBOBOX) 248 if (bFormatted && nFieldType == FIELDTYPE_COMBOBOX)
249 pWidget->ResetAppearance(&sValue, FALSE); 249 pWidget->ResetAppearance(&sValue, FALSE);
250 } 250 }
251 251
252 #ifdef PDF_ENABLE_XFA 252 #ifdef PDF_ENABLE_XFA
253 CPDFSDK_PageView* pPageView = pAnnot->GetPageView(); 253 CPDFSDK_PageView* pPageView = pAnnot->GetPageView();
254 CPDFSDK_Document* pSDKDoc = pPageView->GetSDKDocument(); 254 CPDFXFA_Document* pDoc =
255 CPDFXFA_Document* pDoc = pSDKDoc->GetXFADocument(); 255 pPageView->GetFormFillEnv()->GetSDKDocument()->GetXFADocument();
256 if (pDoc->GetDocType() == DOCTYPE_STATIC_XFA) { 256 if (pDoc->GetDocType() == DOCTYPE_STATIC_XFA) {
257 if (!pWidget->IsAppearanceValid() && !pWidget->GetValue().IsEmpty()) 257 if (!pWidget->IsAppearanceValid() && !pWidget->GetValue().IsEmpty())
258 pWidget->ResetAppearance(FALSE); 258 pWidget->ResetAppearance(FALSE);
259 } 259 }
260 #endif // PDF_ENABLE_XFA 260 #endif // PDF_ENABLE_XFA
261 if (m_pFormFiller) 261 if (m_pFormFiller)
262 m_pFormFiller->OnLoad(pAnnot); 262 m_pFormFiller->OnLoad(pAnnot);
263 } 263 }
264 264
265 FX_BOOL CPDFSDK_WidgetHandler::OnSetFocus(CPDFSDK_Annot::ObservedPtr* pAnnot, 265 FX_BOOL CPDFSDK_WidgetHandler::OnSetFocus(CPDFSDK_Annot::ObservedPtr* pAnnot,
(...skipping 30 matching lines...) Expand all
296 296
297 FX_BOOL CPDFSDK_WidgetHandler::HitTest(CPDFSDK_PageView* pPageView, 297 FX_BOOL CPDFSDK_WidgetHandler::HitTest(CPDFSDK_PageView* pPageView,
298 CPDFSDK_Annot* pAnnot, 298 CPDFSDK_Annot* pAnnot,
299 const CFX_FloatPoint& point) { 299 const CFX_FloatPoint& point) {
300 ASSERT(pPageView); 300 ASSERT(pPageView);
301 ASSERT(pAnnot); 301 ASSERT(pAnnot);
302 302
303 CFX_FloatRect rect = GetViewBBox(pPageView, pAnnot); 303 CFX_FloatRect rect = GetViewBBox(pPageView, pAnnot);
304 return rect.Contains(point.x, point.y); 304 return rect.Contains(point.x, point.y);
305 } 305 }
OLDNEW
« no previous file with comments | « fpdfsdk/cpdfsdk_widget.cpp ('k') | fpdfsdk/cpdfsdk_xfawidgethandler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698