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

Unified Diff: fpdfsdk/cpdfsdk_widget.cpp

Issue 2397723005: Convert CPDFSDK_InterForm to take 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « fpdfsdk/cpdfsdk_interform.cpp ('k') | fpdfsdk/javascript/Field.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/cpdfsdk_widget.cpp
diff --git a/fpdfsdk/cpdfsdk_widget.cpp b/fpdfsdk/cpdfsdk_widget.cpp
index 94555b70c5d6fe304071b06cf1570d9231d21fed..0624b0754eb37ad2f51ac88f393d69901529fde9 100644
--- a/fpdfsdk/cpdfsdk_widget.cpp
+++ b/fpdfsdk/cpdfsdk_widget.cpp
@@ -852,10 +852,10 @@ void CPDFSDK_Widget::DrawShadow(CFX_RenderDevice* pDevice,
uint8_t alpha = m_pInterForm->GetHighlightAlpha();
CFX_FloatRect rcDevice;
- ASSERT(m_pInterForm->GetDocument());
- CPDFSDK_FormFillEnvironment* pEnv = m_pInterForm->GetDocument()->GetEnv();
+ CPDFSDK_FormFillEnvironment* pEnv = m_pInterForm->GetFormFillEnv();
if (!pEnv)
return;
+
CFX_Matrix page2device;
pPageView->GetCurrentMatrix(page2device);
page2device.Transform(((FX_FLOAT)rc.left), ((FX_FLOAT)rc.bottom),
@@ -999,10 +999,7 @@ void CPDFSDK_Widget::ResetAppearance_PushButton() {
CPDF_IconFit iconFit = pControl->GetIconFit();
- CPDFSDK_Document* pDoc = m_pInterForm->GetDocument();
- CPDFSDK_FormFillEnvironment* pEnv = pDoc->GetEnv();
-
- CBA_FontMap font_map(this, pEnv->GetSysHandler());
+ CBA_FontMap font_map(this, m_pInterForm->GetFormFillEnv()->GetSysHandler());
font_map.SetAPType("N");
CFX_ByteString csAP =
@@ -1377,9 +1374,7 @@ void CPDFSDK_Widget::ResetAppearance_ComboBox(const CFX_WideString* sValue) {
std::unique_ptr<CFX_Edit> pEdit(new CFX_Edit);
pEdit->EnableRefresh(FALSE);
- CPDFSDK_Document* pDoc = m_pInterForm->GetDocument();
- CPDFSDK_FormFillEnvironment* pEnv = pDoc->GetEnv();
- CBA_FontMap font_map(this, pEnv->GetSysHandler());
+ CBA_FontMap font_map(this, m_pInterForm->GetFormFillEnv()->GetSysHandler());
pEdit->SetFontMap(&font_map);
CFX_FloatRect rcEdit = rcClient;
@@ -1443,10 +1438,7 @@ void CPDFSDK_Widget::ResetAppearance_ListBox() {
std::unique_ptr<CFX_Edit> pEdit(new CFX_Edit);
pEdit->EnableRefresh(FALSE);
- CPDFSDK_Document* pDoc = m_pInterForm->GetDocument();
- CPDFSDK_FormFillEnvironment* pEnv = pDoc->GetEnv();
-
- CBA_FontMap font_map(this, pEnv->GetSysHandler());
+ CBA_FontMap font_map(this, m_pInterForm->GetFormFillEnv()->GetSysHandler());
pEdit->SetFontMap(&font_map);
pEdit->SetPlateRect(CFX_FloatRect(rcClient.left, 0.0f, rcClient.right, 0.0f));
@@ -1530,10 +1522,7 @@ void CPDFSDK_Widget::ResetAppearance_TextField(const CFX_WideString* sValue) {
std::unique_ptr<CFX_Edit> pEdit(new CFX_Edit);
pEdit->EnableRefresh(FALSE);
- CPDFSDK_Document* pDoc = m_pInterForm->GetDocument();
- CPDFSDK_FormFillEnvironment* pEnv = pDoc->GetEnv();
-
- CBA_FontMap font_map(this, pEnv->GetSysHandler());
+ CBA_FontMap font_map(this, m_pInterForm->GetFormFillEnv()->GetSysHandler());
pEdit->SetFontMap(&font_map);
CFX_FloatRect rcClient = GetClientRect();
« no previous file with comments | « fpdfsdk/cpdfsdk_interform.cpp ('k') | fpdfsdk/javascript/Field.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698