summaryrefslogtreecommitdiff
path: root/xfa/fxfa/app/xfa_fftextedit.cpp
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-06-21 14:15:25 -0700
committerCommit bot <commit-bot@chromium.org>2016-06-21 14:15:26 -0700
commit56a8b1944d555ed65dda97164b702a9a657485ca (patch)
tree0bfead2fa031b2c162a5992d29a11f872cf77135 /xfa/fxfa/app/xfa_fftextedit.cpp
parentbb8b63d6b762393e6e7460351375d596bdabef0c (diff)
downloadpdfium-56a8b1944d555ed65dda97164b702a9a657485ca.tar.xz
Convert XFA_ELEMENT to an enum class
This CL changes XFA_ELEMENT From an enum to an enum class. The type name was updated to XFA_Element. Review-Url: https://codereview.chromium.org/2089443002
Diffstat (limited to 'xfa/fxfa/app/xfa_fftextedit.cpp')
-rw-r--r--xfa/fxfa/app/xfa_fftextedit.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/xfa/fxfa/app/xfa_fftextedit.cpp b/xfa/fxfa/app/xfa_fftextedit.cpp
index fd2abe7aba..d29446a086 100644
--- a/xfa/fxfa/app/xfa_fftextedit.cpp
+++ b/xfa/fxfa/app/xfa_fftextedit.cpp
@@ -75,9 +75,9 @@ void CXFA_FFTextEdit::UpdateWidgetProperty() {
dwExtendedStyle |= FWL_STYLEEXT_EDT_ReadOnly;
dwExtendedStyle |= FWL_STYLEEXT_EDT_MultiLine;
}
- XFA_ELEMENT eType = XFA_ELEMENT_UNKNOWN;
+ XFA_Element eType = XFA_Element::Unknown;
int32_t iMaxChars = m_pDataAcc->GetMaxChars(eType);
- if (eType == XFA_ELEMENT_ExData) {
+ if (eType == XFA_Element::ExData) {
iMaxChars = 0;
}
int32_t iNumCells = m_pDataAcc->GetNumberOfCells();
@@ -189,7 +189,7 @@ FX_BOOL CXFA_FFTextEdit::CommitData() {
}
void CXFA_FFTextEdit::ValidateNumberField(const CFX_WideString& wsText) {
CXFA_WidgetAcc* pAcc = GetDataAcc();
- if (pAcc && pAcc->GetUIType() == XFA_ELEMENT_NumericEdit) {
+ if (pAcc && pAcc->GetUIType() == XFA_Element::NumericEdit) {
IXFA_AppProvider* pAppProvider = GetApp()->GetAppProvider();
if (pAppProvider) {
CFX_WideString wsTitle;
@@ -253,11 +253,11 @@ FX_BOOL CXFA_FFTextEdit::UpdateFWLData() {
eType = XFA_VALUEPICTURE_Edit;
}
FX_BOOL bUpdate = FALSE;
- if (m_pDataAcc->GetUIType() == XFA_ELEMENT_TextEdit &&
+ if (m_pDataAcc->GetUIType() == XFA_Element::TextEdit &&
m_pDataAcc->GetNumberOfCells() < 0) {
- XFA_ELEMENT elementType = XFA_ELEMENT_UNKNOWN;
+ XFA_Element elementType = XFA_Element::Unknown;
int32_t iMaxChars = m_pDataAcc->GetMaxChars(elementType);
- if (elementType == XFA_ELEMENT_ExData) {
+ if (elementType == XFA_Element::ExData) {
iMaxChars = eType == XFA_VALUEPICTURE_Edit ? iMaxChars : 0;
}
if (((CFWL_Edit*)m_pNormalWidget)->GetLimit() != iMaxChars) {
@@ -265,7 +265,7 @@ FX_BOOL CXFA_FFTextEdit::UpdateFWLData() {
bUpdate = TRUE;
}
}
- if (m_pDataAcc->GetUIType() == XFA_ELEMENT_Barcode) {
+ if (m_pDataAcc->GetUIType() == XFA_Element::Barcode) {
int32_t nDataLen = 0;
if (eType == XFA_VALUEPICTURE_Edit)
m_pDataAcc->GetBarcodeAttribute_DataLength(nDataLen);
@@ -337,7 +337,7 @@ FX_BOOL CXFA_FFTextEdit::DeSelect() {
FX_BOOL CXFA_FFTextEdit::GetSuggestWords(
CFX_PointF pointf,
std::vector<CFX_ByteString>& sSuggest) {
- if (m_pDataAcc->GetUIType() != XFA_ELEMENT_TextEdit) {
+ if (m_pDataAcc->GetUIType() != XFA_Element::TextEdit) {
return FALSE;
}
FWLToClient(pointf.x, pointf.y);
@@ -346,7 +346,7 @@ FX_BOOL CXFA_FFTextEdit::GetSuggestWords(
FX_BOOL CXFA_FFTextEdit::ReplaceSpellCheckWord(
CFX_PointF pointf,
const CFX_ByteStringC& bsReplace) {
- if (m_pDataAcc->GetUIType() != XFA_ELEMENT_TextEdit) {
+ if (m_pDataAcc->GetUIType() != XFA_Element::TextEdit) {
return FALSE;
}
FWLToClient(pointf.x, pointf.y);
@@ -363,7 +363,7 @@ void CXFA_FFTextEdit::OnTextChanged(IFWL_Widget* pWidget,
eParam.m_pTarget = m_pDataAcc;
eParam.m_wsPrevText = wsPrevText;
CFWL_Edit* pEdit = ((CFWL_Edit*)m_pNormalWidget);
- if (m_pDataAcc->GetUIType() == XFA_ELEMENT_DateTimeEdit) {
+ if (m_pDataAcc->GetUIType() == XFA_Element::DateTimeEdit) {
CFWL_DateTimePicker* pDateTime = (CFWL_DateTimePicker*)pEdit;
pDateTime->GetEditText(eParam.m_wsNewText);
int32_t iSels = pDateTime->CountSelRanges();
@@ -387,7 +387,7 @@ void CXFA_FFTextEdit::OnTextFull(IFWL_Widget* pWidget) {
}
FX_BOOL CXFA_FFTextEdit::CheckWord(const CFX_ByteStringC& sWord) {
- if (sWord.IsEmpty() || m_pDataAcc->GetUIType() != XFA_ELEMENT_TextEdit) {
+ if (sWord.IsEmpty() || m_pDataAcc->GetUIType() != XFA_Element::TextEdit) {
return TRUE;
}
return GetDoc()->GetDocProvider()->CheckWord(GetDoc(), sWord);
@@ -395,7 +395,7 @@ FX_BOOL CXFA_FFTextEdit::CheckWord(const CFX_ByteStringC& sWord) {
FX_BOOL CXFA_FFTextEdit::GetSuggestWords(
const CFX_ByteStringC& sWord,
std::vector<CFX_ByteString>& sSuggest) {
- if (m_pDataAcc->GetUIType() != XFA_ELEMENT_TextEdit) {
+ if (m_pDataAcc->GetUIType() != XFA_Element::TextEdit) {
return FALSE;
}
return GetDoc()->GetDocProvider()->GetSuggestWords(GetDoc(), sWord, sSuggest);
@@ -600,7 +600,7 @@ FX_BOOL CXFA_FFDateTimeEdit::LoadWidget() {
pWidget->SetEditText(wsText);
if (CXFA_Value value = m_pDataAcc->GetFormValue()) {
switch (value.GetChildValueClassID()) {
- case XFA_ELEMENT_Date: {
+ case XFA_Element::Date: {
if (!wsText.IsEmpty()) {
CXFA_LocaleValue lcValue = XFA_GetLocaleValue(m_pDataAcc);
CFX_Unitime date = lcValue.GetDate();