diff options
author | dsinclair <dsinclair@chromium.org> | 2016-10-11 09:13:01 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-10-11 09:13:01 -0700 |
commit | 690c033e86b34f7a9c3d4be15759c63ef9360217 (patch) | |
tree | fdbde142926cd9f77882e0d5984770267561ad32 /fpdfsdk/cpdfsdk_widget.cpp | |
parent | 232ce9365df0768846972be34a3a84f915bf7e82 (diff) | |
download | pdfium-690c033e86b34f7a9c3d4be15759c63ef9360217.tar.xz |
Convert CPDFSDK_InterForm to take a CPDFSDK_FormFillEnvironment
This CL removes CPDFSDK_Document from CPDFSDK_InterForm and has it work with
a CPDFSDK_FormFillEnvironment.
Review-Url: https://codereview.chromium.org/2397723005
Diffstat (limited to 'fpdfsdk/cpdfsdk_widget.cpp')
-rw-r--r-- | fpdfsdk/cpdfsdk_widget.cpp | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/fpdfsdk/cpdfsdk_widget.cpp b/fpdfsdk/cpdfsdk_widget.cpp index 94555b70c5..0624b0754e 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(); |