diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2018-01-23 21:17:43 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-01-23 21:17:43 +0000 |
commit | 414cc9c9676b01587010ec5475d495eef6e05ba3 (patch) | |
tree | c4474fdd1cd945a16eb70cb0cb24b074e2010f22 /xfa/fxfa/cxfa_fftextedit.cpp | |
parent | 9b85f4ba6fdd86c488498003a2db5854d4ece036 (diff) | |
download | pdfium-414cc9c9676b01587010ec5475d495eef6e05ba3.tar.xz |
Remove GetWidgetAcc calls
This CL removes the calls to CXFA_Node::GetWidgetAcc() as they
redundantly return the node they were called upon.
Change-Id: I46e66cf98137a1dee7cd3fa8bc7d379eb97fded5
Reviewed-on: https://pdfium-review.googlesource.com/23630
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/cxfa_fftextedit.cpp')
-rw-r--r-- | xfa/fxfa/cxfa_fftextedit.cpp | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/xfa/fxfa/cxfa_fftextedit.cpp b/xfa/fxfa/cxfa_fftextedit.cpp index 89a7c90155..d3c6fa6ad6 100644 --- a/xfa/fxfa/cxfa_fftextedit.cpp +++ b/xfa/fxfa/cxfa_fftextedit.cpp @@ -57,8 +57,7 @@ bool CXFA_FFTextEdit::LoadWidget() { m_pNormalWidget->LockUpdate(); UpdateWidgetProperty(); - pFWLEdit->SetText( - m_pNode->GetWidgetAcc()->GetValue(XFA_VALUEPICTURE_Display)); + pFWLEdit->SetText(m_pNode->GetValue(XFA_VALUEPICTURE_Display)); m_pNormalWidget->UnlockUpdate(); return CXFA_FFField::LoadWidget(); } @@ -72,13 +71,13 @@ void CXFA_FFTextEdit::UpdateWidgetProperty() { uint32_t dwExtendedStyle = FWL_STYLEEXT_EDT_ShowScrollbarFocus | FWL_STYLEEXT_EDT_OuterScrollbar; dwExtendedStyle |= UpdateUIProperty(); - if (m_pNode->GetWidgetAcc()->IsMultiLine()) { + if (m_pNode->IsMultiLine()) { dwExtendedStyle |= FWL_STYLEEXT_EDT_MultiLine | FWL_STYLEEXT_EDT_WantReturn; - if (!m_pNode->GetWidgetAcc()->IsVerticalScrollPolicyOff()) { + if (!m_pNode->IsVerticalScrollPolicyOff()) { dwStyle |= FWL_WGTSTYLE_VScroll; dwExtendedStyle |= FWL_STYLEEXT_EDT_AutoVScroll; } - } else if (!m_pNode->GetWidgetAcc()->IsHorizontalScrollPolicyOff()) { + } else if (!m_pNode->IsHorizontalScrollPolicyOff()) { dwExtendedStyle |= FWL_STYLEEXT_EDT_AutoHScroll; } if (!m_pNode->IsOpenAccess() || !GetDoc()->GetXFADoc()->IsInteractive()) { @@ -88,11 +87,11 @@ void CXFA_FFTextEdit::UpdateWidgetProperty() { XFA_Element eType; int32_t iMaxChars; - std::tie(eType, iMaxChars) = m_pNode->GetWidgetAcc()->GetMaxChars(); + std::tie(eType, iMaxChars) = m_pNode->GetMaxChars(); if (eType == XFA_Element::ExData) iMaxChars = 0; - Optional<int32_t> numCells = m_pNode->GetWidgetAcc()->GetNumberOfCells(); + Optional<int32_t> numCells = m_pNode->GetNumberOfCells(); if (!numCells) { pWidget->SetLimit(iMaxChars); } else if (*numCells == 0) { @@ -184,8 +183,8 @@ bool CXFA_FFTextEdit::OnKillFocus(CXFA_FFWidget* pNewWidget) { bool CXFA_FFTextEdit::CommitData() { WideString wsText = static_cast<CFWL_Edit*>(m_pNormalWidget.get())->GetText(); - if (m_pNode->GetWidgetAcc()->SetValue(XFA_VALUEPICTURE_Edit, wsText)) { - m_pNode->GetWidgetAcc()->UpdateUIDisplay(GetDoc()->GetDocView(), this); + if (m_pNode->SetValue(XFA_VALUEPICTURE_Edit, wsText)) { + m_pNode->UpdateUIDisplay(GetDoc()->GetDocView(), this); return true; } ValidateNumberField(wsText); @@ -260,10 +259,10 @@ bool CXFA_FFTextEdit::UpdateFWLData() { bool bUpdate = false; if (m_pNode->GetUIType() == XFA_Element::TextEdit && - !m_pNode->GetWidgetAcc()->GetNumberOfCells()) { + !m_pNode->GetNumberOfCells()) { XFA_Element elementType; int32_t iMaxChars; - std::tie(elementType, iMaxChars) = m_pNode->GetWidgetAcc()->GetMaxChars(); + std::tie(elementType, iMaxChars) = m_pNode->GetMaxChars(); if (elementType == XFA_Element::ExData) iMaxChars = eType == XFA_VALUEPICTURE_Edit ? iMaxChars : 0; if (pEdit->GetLimit() != iMaxChars) { @@ -279,7 +278,7 @@ bool CXFA_FFTextEdit::UpdateFWLData() { bUpdate = true; } - WideString wsText = m_pNode->GetWidgetAcc()->GetValue(eType); + WideString wsText = m_pNode->GetValue(eType); WideString wsOldText = pEdit->GetText(); if (wsText != wsOldText || (eType == XFA_VALUEPICTURE_Edit && bUpdate)) { pEdit->SetText(wsText); |