summaryrefslogtreecommitdiff
path: root/xfa/fxfa/app
diff options
context:
space:
mode:
authordan sinclair <dsinclair@chromium.org>2016-11-24 10:45:29 -0500
committerChromium commit bot <commit-bot@chromium.org>2016-11-24 16:34:32 +0000
commit0354ccf37f05f25b1bf64fd60bb3b48efab4d7d0 (patch)
tree378745e450e4f02128ab6766d6ca71bd0b27f4ab /xfa/fxfa/app
parent41ba08e5552c2eccad0c34024dc680feb3f2b251 (diff)
downloadpdfium-chromium/2935.tar.xz
Change TxtEdtEngine to return CFX_WideStringchromium/2935chromium/2934chromium/2933chromium/2932
This Cl updates the TxtEdtEngine and TxtEdtBuf to return CFX_WideStrings on a Get instead of taking an out param. The change is propagated out through the various Get methods that call into the edit engine. Change-Id: Iccf10a8ee06678ae3b59f3afd6e65308dacd16bd Reviewed-on: https://pdfium-review.googlesource.com/2070 Commit-Queue: ooo 11-24 -- 12-05 (dsinclair) <dsinclair@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
Diffstat (limited to 'xfa/fxfa/app')
-rw-r--r--xfa/fxfa/app/xfa_ffchoicelist.cpp9
-rw-r--r--xfa/fxfa/app/xfa_fftextedit.cpp19
2 files changed, 14 insertions, 14 deletions
diff --git a/xfa/fxfa/app/xfa_ffchoicelist.cpp b/xfa/fxfa/app/xfa_ffchoicelist.cpp
index b289a39eb3..c9a513607e 100644
--- a/xfa/fxfa/app/xfa_ffchoicelist.cpp
+++ b/xfa/fxfa/app/xfa_ffchoicelist.cpp
@@ -160,8 +160,10 @@ void CXFA_FFListBox::OnSelectChanged(CFWL_Widget* pWidget,
CFWL_ListBox* pListBox = (CFWL_ListBox*)m_pNormalWidget;
int32_t iSels = pListBox->CountSelItems();
if (iSels > 0) {
- pListBox->GetItemText(nullptr, pListBox->GetSelItem(0), eParam.m_wsNewText);
+ eParam.m_wsNewText =
+ pListBox->GetItemText(nullptr, pListBox->GetSelItem(0));
}
+
m_pDataAcc->ProcessEvent(XFA_ATTRIBUTEENUM_Change, &eParam);
}
void CXFA_FFListBox::SetItemState(int32_t nIndex, bool bSelected) {
@@ -316,8 +318,7 @@ bool CXFA_FFComboBox::CommitData() {
}
bool CXFA_FFComboBox::IsDataChanged() {
CFWL_ComboBox* pFWLcombobox = ((CFWL_ComboBox*)m_pNormalWidget);
- CFX_WideString wsText;
- pFWLcombobox->GetEditText(wsText);
+ CFX_WideString wsText = pFWLcombobox->GetEditText();
int32_t iCursel = pFWLcombobox->GetCurSel();
if (iCursel >= 0) {
CFX_WideString wsSel;
@@ -338,7 +339,7 @@ void CXFA_FFComboBox::FWLEventSelChange(CXFA_EventParam* pParam) {
pParam->m_eType = XFA_EVENT_Change;
pParam->m_pTarget = m_pDataAcc;
CFWL_ComboBox* pFWLcombobox = ((CFWL_ComboBox*)m_pNormalWidget);
- pFWLcombobox->GetEditText(pParam->m_wsNewText);
+ pParam->m_wsNewText = pFWLcombobox->GetEditText();
m_pDataAcc->ProcessEvent(XFA_ATTRIBUTEENUM_Change, pParam);
}
uint32_t CXFA_FFComboBox::GetAlignment() {
diff --git a/xfa/fxfa/app/xfa_fftextedit.cpp b/xfa/fxfa/app/xfa_fftextedit.cpp
index 77ca7a6d91..a070f90b99 100644
--- a/xfa/fxfa/app/xfa_fftextedit.cpp
+++ b/xfa/fxfa/app/xfa_fftextedit.cpp
@@ -187,8 +187,7 @@ bool CXFA_FFTextEdit::OnKillFocus(CXFA_FFWidget* pNewWidget) {
return true;
}
bool CXFA_FFTextEdit::CommitData() {
- CFX_WideString wsText;
- ((CFWL_Edit*)m_pNormalWidget)->GetText(wsText);
+ CFX_WideString wsText = static_cast<CFWL_Edit*>(m_pNormalWidget)->GetText();
if (m_pDataAcc->SetValue(wsText, XFA_VALUEPICTURE_Edit)) {
m_pDataAcc->UpdateUIDisplay(this);
return true;
@@ -283,8 +282,8 @@ bool CXFA_FFTextEdit::UpdateFWLData() {
}
CFX_WideString wsText;
m_pDataAcc->GetValue(wsText, eType);
- CFX_WideString wsOldText;
- ((CFWL_Edit*)m_pNormalWidget)->GetText(wsOldText);
+ CFX_WideString wsOldText =
+ static_cast<CFWL_Edit*>(m_pNormalWidget)->GetText();
if (wsText != wsOldText || (eType == XFA_VALUEPICTURE_Edit && bUpdate)) {
((CFWL_Edit*)m_pNormalWidget)->SetText(wsText);
bUpdate = true;
@@ -306,13 +305,13 @@ void CXFA_FFTextEdit::OnTextChanged(CFWL_Widget* pWidget,
CFWL_Edit* pEdit = ((CFWL_Edit*)m_pNormalWidget);
if (m_pDataAcc->GetUIType() == XFA_Element::DateTimeEdit) {
CFWL_DateTimePicker* pDateTime = (CFWL_DateTimePicker*)pEdit;
- pDateTime->GetEditText(eParam.m_wsNewText);
+ eParam.m_wsNewText = pDateTime->GetEditText();
int32_t iSels = pDateTime->CountSelRanges();
if (iSels) {
eParam.m_iSelEnd = pDateTime->GetSelRange(0, eParam.m_iSelStart);
}
} else {
- pEdit->GetText(eParam.m_wsNewText);
+ eParam.m_wsNewText = pEdit->GetText();
int32_t iSels = pEdit->CountSelRanges();
if (iSels) {
eParam.m_iSelEnd = pEdit->GetSelRange(0, eParam.m_iSelStart);
@@ -616,8 +615,8 @@ uint32_t CXFA_FFDateTimeEdit::GetAlignment() {
return dwExtendedStyle;
}
bool CXFA_FFDateTimeEdit::CommitData() {
- CFX_WideString wsText;
- ((CFWL_DateTimePicker*)m_pNormalWidget)->GetEditText(wsText);
+ CFX_WideString wsText =
+ static_cast<CFWL_DateTimePicker*>(m_pNormalWidget)->GetEditText();
if (m_pDataAcc->SetValue(wsText, XFA_VALUEPICTURE_Edit)) {
m_pDataAcc->UpdateUIDisplay(this);
return true;
@@ -652,8 +651,8 @@ bool CXFA_FFDateTimeEdit::IsDataChanged() {
if (m_dwStatus & XFA_WidgetStatus_TextEditValueChanged) {
return true;
}
- CFX_WideString wsText;
- ((CFWL_DateTimePicker*)m_pNormalWidget)->GetEditText(wsText);
+ CFX_WideString wsText =
+ static_cast<CFWL_DateTimePicker*>(m_pNormalWidget)->GetEditText();
CFX_WideString wsOldValue;
m_pDataAcc->GetValue(wsOldValue, XFA_VALUEPICTURE_Edit);
return wsOldValue != wsText;