summaryrefslogtreecommitdiff
path: root/xfa/fxfa/cxfa_ffcombobox.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/fxfa/cxfa_ffcombobox.cpp')
-rw-r--r--xfa/fxfa/cxfa_ffcombobox.cpp25
1 files changed, 17 insertions, 8 deletions
diff --git a/xfa/fxfa/cxfa_ffcombobox.cpp b/xfa/fxfa/cxfa_ffcombobox.cpp
index 268d1da2b4..e4de85c517 100644
--- a/xfa/fxfa/cxfa_ffcombobox.cpp
+++ b/xfa/fxfa/cxfa_ffcombobox.cpp
@@ -116,14 +116,7 @@ bool CXFA_FFComboBox::CommitData() {
}
bool CXFA_FFComboBox::IsDataChanged() {
- auto* pFWLcombobox = ToComboBox(m_pNormalWidget.get());
- WideString wsText = pFWLcombobox->GetEditText();
- int32_t iCursel = pFWLcombobox->GetCurSel();
- if (iCursel >= 0) {
- WideString wsSel = pFWLcombobox->GetTextByIndex(iCursel);
- if (wsSel == wsText)
- wsText = m_pNode->GetChoiceListItem(iCursel, true).value_or(L"");
- }
+ WideString wsText = GetCurrentText();
if (m_pNode->GetValue(XFA_VALUEPICTURE_Raw) == wsText)
return false;
@@ -138,6 +131,18 @@ void CXFA_FFComboBox::FWLEventSelChange(CXFA_EventParam* pParam) {
m_pNode->ProcessEvent(GetDocView(), XFA_AttributeEnum::Change, pParam);
}
+WideString CXFA_FFComboBox::GetCurrentText() const {
+ auto* pFWLcombobox = ToComboBox(m_pNormalWidget.get());
+ WideString wsText = pFWLcombobox->GetEditText();
+ int32_t iCursel = pFWLcombobox->GetCurSel();
+ if (iCursel >= 0) {
+ WideString wsSel = pFWLcombobox->GetTextByIndex(iCursel);
+ if (wsSel == wsText)
+ wsText = m_pNode->GetChoiceListItem(iCursel, true).value_or(L"");
+ }
+ return wsText;
+}
+
uint32_t CXFA_FFComboBox::GetAlignment() {
CXFA_Para* para = m_pNode->GetParaIfExists();
if (!para)
@@ -259,6 +264,10 @@ void CXFA_FFComboBox::DeSelect() {
ToComboBox(m_pNormalWidget.get())->EditDeSelect();
}
+WideString CXFA_FFComboBox::GetText() {
+ return GetCurrentText();
+}
+
FormFieldType CXFA_FFComboBox::GetFormFieldType() {
return FormFieldType::kXFA_ComboBox;
}