summaryrefslogtreecommitdiff
path: root/xfa/fxfa
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-05-04 17:57:03 -0700
committerCommit bot <commit-bot@chromium.org>2016-05-04 17:57:03 -0700
commitc777f486f84611d2fdd2d03af661b14955f9efb6 (patch)
tree679012454d82e885f749d17f75fd12735efec29a /xfa/fxfa
parent41aad19ba366540bd4efa20a9009ac1c70a81403 (diff)
downloadpdfium-c777f486f84611d2fdd2d03af661b14955f9efb6.tar.xz
Convert FWL_ERR into an enum class.
This Cl updates FWL_ERR to be an FWL_Error enum class. It removes FX_ERR and replaces it with FWL_Error as well as the values were the same. There were many places where we either returned other values for FWL_ERR results. This Cl is the same as: https://codereview.chromium.org/1943413002/ but I seem to have messed up the base URL in that one. TBR=tsepez@chromium.org Review-Url: https://codereview.chromium.org/1952693003
Diffstat (limited to 'xfa/fxfa')
-rw-r--r--xfa/fxfa/app/xfa_ffcheckbutton.cpp15
-rw-r--r--xfa/fxfa/app/xfa_ffcheckbutton.h8
-rw-r--r--xfa/fxfa/app/xfa_ffchoicelist.cpp30
-rw-r--r--xfa/fxfa/app/xfa_ffchoicelist.h16
-rw-r--r--xfa/fxfa/app/xfa_fffield.cpp13
-rw-r--r--xfa/fxfa/app/xfa_fffield.h8
-rw-r--r--xfa/fxfa/app/xfa_ffimageedit.cpp17
-rw-r--r--xfa/fxfa/app/xfa_ffimageedit.h8
-rw-r--r--xfa/fxfa/app/xfa_ffpushbutton.cpp17
-rw-r--r--xfa/fxfa/app/xfa_ffpushbutton.h8
-rw-r--r--xfa/fxfa/app/xfa_fftextedit.cpp31
-rw-r--r--xfa/fxfa/app/xfa_fftextedit.h12
-rw-r--r--xfa/fxfa/app/xfa_fwladapter.cpp12
-rw-r--r--xfa/fxfa/app/xfa_fwladapter.h2
-rw-r--r--xfa/fxfa/app/xfa_fwltheme.cpp39
-rw-r--r--xfa/fxfa/app/xfa_fwltheme.h28
16 files changed, 135 insertions, 129 deletions
diff --git a/xfa/fxfa/app/xfa_ffcheckbutton.cpp b/xfa/fxfa/app/xfa_ffcheckbutton.cpp
index b75fcd5ab0..84a6013528 100644
--- a/xfa/fxfa/app/xfa_ffcheckbutton.cpp
+++ b/xfa/fxfa/app/xfa_ffcheckbutton.cpp
@@ -295,11 +295,12 @@ FX_BOOL CXFA_FFCheckButton::UpdateFWLData() {
m_pNormalWidget->Update();
return TRUE;
}
-int32_t CXFA_FFCheckButton::OnProcessMessage(CFWL_Message* pMessage) {
- return m_pOldDelegate->OnProcessMessage(pMessage);
+
+void CXFA_FFCheckButton::OnProcessMessage(CFWL_Message* pMessage) {
+ m_pOldDelegate->OnProcessMessage(pMessage);
}
-FWL_ERR CXFA_FFCheckButton::OnProcessEvent(CFWL_Event* pEvent) {
+void CXFA_FFCheckButton::OnProcessEvent(CFWL_Event* pEvent) {
CXFA_FFField::OnProcessEvent(pEvent);
switch (pEvent->GetClassID()) {
case CFWL_EventType::CheckStateChanged: {
@@ -330,10 +331,10 @@ FWL_ERR CXFA_FFCheckButton::OnProcessEvent(CFWL_Event* pEvent) {
default:
break;
}
- return m_pOldDelegate->OnProcessEvent(pEvent);
+ m_pOldDelegate->OnProcessEvent(pEvent);
}
-FWL_ERR CXFA_FFCheckButton::OnDrawWidget(CFX_Graphics* pGraphics,
- const CFX_Matrix* pMatrix) {
- return m_pOldDelegate->OnDrawWidget(pGraphics, pMatrix);
+void CXFA_FFCheckButton::OnDrawWidget(CFX_Graphics* pGraphics,
+ const CFX_Matrix* pMatrix) {
+ m_pOldDelegate->OnDrawWidget(pGraphics, pMatrix);
}
diff --git a/xfa/fxfa/app/xfa_ffcheckbutton.h b/xfa/fxfa/app/xfa_ffcheckbutton.h
index a04284250b..c3323b4035 100644
--- a/xfa/fxfa/app/xfa_ffcheckbutton.h
+++ b/xfa/fxfa/app/xfa_ffcheckbutton.h
@@ -25,10 +25,10 @@ class CXFA_FFCheckButton : public CXFA_FFField {
virtual void UpdateWidgetProperty();
virtual FX_BOOL OnLButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy);
void SetFWLCheckState(XFA_CHECKSTATE eCheckState);
- virtual int32_t OnProcessMessage(CFWL_Message* pMessage);
- virtual FWL_ERR OnProcessEvent(CFWL_Event* pEvent);
- virtual FWL_ERR OnDrawWidget(CFX_Graphics* pGraphics,
- const CFX_Matrix* pMatrix = NULL);
+ virtual void OnProcessMessage(CFWL_Message* pMessage);
+ virtual void OnProcessEvent(CFWL_Event* pEvent);
+ virtual void OnDrawWidget(CFX_Graphics* pGraphics,
+ const CFX_Matrix* pMatrix = NULL);
protected:
virtual FX_BOOL CommitData();
diff --git a/xfa/fxfa/app/xfa_ffchoicelist.cpp b/xfa/fxfa/app/xfa_ffchoicelist.cpp
index 6bb7c0bedb..4676bc9374 100644
--- a/xfa/fxfa/app/xfa_ffchoicelist.cpp
+++ b/xfa/fxfa/app/xfa_ffchoicelist.cpp
@@ -180,10 +180,12 @@ void CXFA_FFListBox::DeleteItem(int32_t nIndex) {
m_pNormalWidget->Update();
AddInvalidateRect();
}
-int32_t CXFA_FFListBox::OnProcessMessage(CFWL_Message* pMessage) {
- return m_pOldDelegate->OnProcessMessage(pMessage);
+
+void CXFA_FFListBox::OnProcessMessage(CFWL_Message* pMessage) {
+ m_pOldDelegate->OnProcessMessage(pMessage);
}
-FWL_ERR CXFA_FFListBox::OnProcessEvent(CFWL_Event* pEvent) {
+
+void CXFA_FFListBox::OnProcessEvent(CFWL_Event* pEvent) {
CXFA_FFField::OnProcessEvent(pEvent);
switch (pEvent->GetClassID()) {
case CFWL_EventType::SelectChanged: {
@@ -194,11 +196,11 @@ FWL_ERR CXFA_FFListBox::OnProcessEvent(CFWL_Event* pEvent) {
default:
break;
}
- return m_pOldDelegate->OnProcessEvent(pEvent);
+ m_pOldDelegate->OnProcessEvent(pEvent);
}
-FWL_ERR CXFA_FFListBox::OnDrawWidget(CFX_Graphics* pGraphics,
- const CFX_Matrix* pMatrix) {
- return m_pOldDelegate->OnDrawWidget(pGraphics, pMatrix);
+void CXFA_FFListBox::OnDrawWidget(CFX_Graphics* pGraphics,
+ const CFX_Matrix* pMatrix) {
+ m_pOldDelegate->OnDrawWidget(pGraphics, pMatrix);
}
CXFA_FFComboBox::CXFA_FFComboBox(CXFA_FFPageView* pPageView,
@@ -495,11 +497,11 @@ void CXFA_FFComboBox::OnPostOpen(IFWL_Widget* pWidget) {
m_pDataAcc->ProcessEvent(XFA_ATTRIBUTEENUM_PostOpen, &eParam);
}
-int32_t CXFA_FFComboBox::OnProcessMessage(CFWL_Message* pMessage) {
- return m_pOldDelegate->OnProcessMessage(pMessage);
+void CXFA_FFComboBox::OnProcessMessage(CFWL_Message* pMessage) {
+ m_pOldDelegate->OnProcessMessage(pMessage);
}
-FWL_ERR CXFA_FFComboBox::OnProcessEvent(CFWL_Event* pEvent) {
+void CXFA_FFComboBox::OnProcessEvent(CFWL_Event* pEvent) {
CXFA_FFField::OnProcessEvent(pEvent);
switch (pEvent->GetClassID()) {
case CFWL_EventType::SelectChanged: {
@@ -524,10 +526,10 @@ FWL_ERR CXFA_FFComboBox::OnProcessEvent(CFWL_Event* pEvent) {
default:
break;
}
- return m_pOldDelegate->OnProcessEvent(pEvent);
+ m_pOldDelegate->OnProcessEvent(pEvent);
}
-FWL_ERR CXFA_FFComboBox::OnDrawWidget(CFX_Graphics* pGraphics,
- const CFX_Matrix* pMatrix) {
- return m_pOldDelegate->OnDrawWidget(pGraphics, pMatrix);
+void CXFA_FFComboBox::OnDrawWidget(CFX_Graphics* pGraphics,
+ const CFX_Matrix* pMatrix) {
+ m_pOldDelegate->OnDrawWidget(pGraphics, pMatrix);
}
diff --git a/xfa/fxfa/app/xfa_ffchoicelist.h b/xfa/fxfa/app/xfa_ffchoicelist.h
index ba48380138..c59ca647aa 100644
--- a/xfa/fxfa/app/xfa_ffchoicelist.h
+++ b/xfa/fxfa/app/xfa_ffchoicelist.h
@@ -28,10 +28,10 @@ class CXFA_FFListBox : public CXFA_FFField {
void SetItemState(int32_t nIndex, FX_BOOL bSelected);
void InsertItem(const CFX_WideStringC& wsLabel, int32_t nIndex = -1);
void DeleteItem(int32_t nIndex);
- virtual int32_t OnProcessMessage(CFWL_Message* pMessage);
- virtual FWL_ERR OnProcessEvent(CFWL_Event* pEvent);
- virtual FWL_ERR OnDrawWidget(CFX_Graphics* pGraphics,
- const CFX_Matrix* pMatrix = NULL);
+ virtual void OnProcessMessage(CFWL_Message* pMessage);
+ virtual void OnProcessEvent(CFWL_Event* pEvent);
+ virtual void OnDrawWidget(CFX_Graphics* pGraphics,
+ const CFX_Matrix* pMatrix = NULL);
protected:
IFWL_WidgetDelegate* m_pOldDelegate;
@@ -84,10 +84,10 @@ class CXFA_FFComboBox : public CXFA_FFField {
void SetItemState(int32_t nIndex, FX_BOOL bSelected);
void InsertItem(const CFX_WideStringC& wsLabel, int32_t nIndex = -1);
void DeleteItem(int32_t nIndex);
- virtual int32_t OnProcessMessage(CFWL_Message* pMessage);
- virtual FWL_ERR OnProcessEvent(CFWL_Event* pEvent);
- virtual FWL_ERR OnDrawWidget(CFX_Graphics* pGraphics,
- const CFX_Matrix* pMatrix = NULL);
+ virtual void OnProcessMessage(CFWL_Message* pMessage);
+ virtual void OnProcessEvent(CFWL_Event* pEvent);
+ virtual void OnDrawWidget(CFX_Graphics* pGraphics,
+ const CFX_Matrix* pMatrix = NULL);
protected:
IFWL_WidgetDelegate* m_pOldDelegate;
diff --git a/xfa/fxfa/app/xfa_fffield.cpp b/xfa/fxfa/app/xfa_fffield.cpp
index f56d5a1ece..cb65a0b9a9 100644
--- a/xfa/fxfa/app/xfa_fffield.cpp
+++ b/xfa/fxfa/app/xfa_fffield.cpp
@@ -785,11 +785,9 @@ FX_BOOL CXFA_FFField::IsDataChanged() {
void CXFA_FFField::TranslateFWLMessage(CFWL_Message* pMessage) {
GetApp()->GetWidgetMgrDelegate()->OnProcessMessageToForm(pMessage);
}
-int32_t CXFA_FFField::OnProcessMessage(CFWL_Message* pMessage) {
- return FWL_ERR_Succeeded;
-}
+void CXFA_FFField::OnProcessMessage(CFWL_Message* pMessage) {}
-FWL_ERR CXFA_FFField::OnProcessEvent(CFWL_Event* pEvent) {
+void CXFA_FFField::OnProcessEvent(CFWL_Event* pEvent) {
switch (pEvent->GetClassID()) {
case CFWL_EventType::Mouse: {
CFWL_EvtMouse* event = (CFWL_EvtMouse*)pEvent;
@@ -826,10 +824,7 @@ FWL_ERR CXFA_FFField::OnProcessEvent(CFWL_Event* pEvent) {
default:
break;
}
- return FWL_ERR_Succeeded;
}
-FWL_ERR CXFA_FFField::OnDrawWidget(CFX_Graphics* pGraphics,
- const CFX_Matrix* pMatrix) {
- return FWL_ERR_Succeeded;
-}
+void CXFA_FFField::OnDrawWidget(CFX_Graphics* pGraphics,
+ const CFX_Matrix* pMatrix) {}
diff --git a/xfa/fxfa/app/xfa_fffield.h b/xfa/fxfa/app/xfa_fffield.h
index 91908e3b98..fd6661dea2 100644
--- a/xfa/fxfa/app/xfa_fffield.h
+++ b/xfa/fxfa/app/xfa_fffield.h
@@ -85,10 +85,10 @@ class CXFA_FFField : public CXFA_FFWidget, public IFWL_WidgetDelegate {
void SetEditScrollOffset();
public:
- virtual int32_t OnProcessMessage(CFWL_Message* pMessage);
- virtual FWL_ERR OnProcessEvent(CFWL_Event* pEvent);
- virtual FWL_ERR OnDrawWidget(CFX_Graphics* pGraphics,
- const CFX_Matrix* pMatrix = NULL);
+ virtual void OnProcessMessage(CFWL_Message* pMessage);
+ virtual void OnProcessEvent(CFWL_Event* pEvent);
+ virtual void OnDrawWidget(CFX_Graphics* pGraphics,
+ const CFX_Matrix* pMatrix = NULL);
protected:
CFWL_Widget* m_pNormalWidget;
diff --git a/xfa/fxfa/app/xfa_ffimageedit.cpp b/xfa/fxfa/app/xfa_ffimageedit.cpp
index 16fa0ef06a..2250eef2e4 100644
--- a/xfa/fxfa/app/xfa_ffimageedit.cpp
+++ b/xfa/fxfa/app/xfa_ffimageedit.cpp
@@ -123,14 +123,17 @@ FX_BOOL CXFA_FFImageEdit::UpdateFWLData() {
m_pDataAcc->LoadImageEditImage();
return TRUE;
}
-int32_t CXFA_FFImageEdit::OnProcessMessage(CFWL_Message* pMessage) {
- return m_pOldDelegate->OnProcessMessage(pMessage);
+
+void CXFA_FFImageEdit::OnProcessMessage(CFWL_Message* pMessage) {
+ m_pOldDelegate->OnProcessMessage(pMessage);
}
-FWL_ERR CXFA_FFImageEdit::OnProcessEvent(CFWL_Event* pEvent) {
+
+void CXFA_FFImageEdit::OnProcessEvent(CFWL_Event* pEvent) {
CXFA_FFField::OnProcessEvent(pEvent);
- return m_pOldDelegate->OnProcessEvent(pEvent);
+ m_pOldDelegate->OnProcessEvent(pEvent);
}
-FWL_ERR CXFA_FFImageEdit::OnDrawWidget(CFX_Graphics* pGraphics,
- const CFX_Matrix* pMatrix) {
- return m_pOldDelegate->OnDrawWidget(pGraphics, pMatrix);
+
+void CXFA_FFImageEdit::OnDrawWidget(CFX_Graphics* pGraphics,
+ const CFX_Matrix* pMatrix) {
+ m_pOldDelegate->OnDrawWidget(pGraphics, pMatrix);
}
diff --git a/xfa/fxfa/app/xfa_ffimageedit.h b/xfa/fxfa/app/xfa_ffimageedit.h
index 1acc13c7fa..fb3e21e19f 100644
--- a/xfa/fxfa/app/xfa_ffimageedit.h
+++ b/xfa/fxfa/app/xfa_ffimageedit.h
@@ -21,10 +21,10 @@ class CXFA_FFImageEdit : public CXFA_FFField {
virtual FX_BOOL LoadWidget();
virtual void UnloadWidget();
virtual FX_BOOL OnLButtonDown(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy);
- virtual int32_t OnProcessMessage(CFWL_Message* pMessage);
- virtual FWL_ERR OnProcessEvent(CFWL_Event* pEvent);
- virtual FWL_ERR OnDrawWidget(CFX_Graphics* pGraphics,
- const CFX_Matrix* pMatrix = NULL);
+ virtual void OnProcessMessage(CFWL_Message* pMessage);
+ virtual void OnProcessEvent(CFWL_Event* pEvent);
+ virtual void OnDrawWidget(CFX_Graphics* pGraphics,
+ const CFX_Matrix* pMatrix = NULL);
protected:
virtual void SetFWLRect();
diff --git a/xfa/fxfa/app/xfa_ffpushbutton.cpp b/xfa/fxfa/app/xfa_ffpushbutton.cpp
index 6db2b7078c..96b6d77096 100644
--- a/xfa/fxfa/app/xfa_ffpushbutton.cpp
+++ b/xfa/fxfa/app/xfa_ffpushbutton.cpp
@@ -201,15 +201,18 @@ void CXFA_FFPushButton::RenderHighlightCaption(CFX_Graphics* pGS,
}
}
}
-int32_t CXFA_FFPushButton::OnProcessMessage(CFWL_Message* pMessage) {
- return m_pOldDelegate->OnProcessMessage(pMessage);
+
+void CXFA_FFPushButton::OnProcessMessage(CFWL_Message* pMessage) {
+ m_pOldDelegate->OnProcessMessage(pMessage);
}
-FWL_ERR CXFA_FFPushButton::OnProcessEvent(CFWL_Event* pEvent) {
+
+void CXFA_FFPushButton::OnProcessEvent(CFWL_Event* pEvent) {
m_pOldDelegate->OnProcessEvent(pEvent);
- return CXFA_FFField::OnProcessEvent(pEvent);
+ CXFA_FFField::OnProcessEvent(pEvent);
}
-FWL_ERR CXFA_FFPushButton::OnDrawWidget(CFX_Graphics* pGraphics,
- const CFX_Matrix* pMatrix) {
+
+void CXFA_FFPushButton::OnDrawWidget(CFX_Graphics* pGraphics,
+ const CFX_Matrix* pMatrix) {
if (m_pNormalWidget->GetStylesEx() & XFA_FWL_PSBSTYLEEXT_HiliteInverted) {
if ((m_pNormalWidget->GetStates() & FWL_STATE_PSB_Pressed) &&
(m_pNormalWidget->GetStates() & FWL_STATE_PSB_Hovered)) {
@@ -240,7 +243,5 @@ FWL_ERR CXFA_FFPushButton::OnDrawWidget(CFX_Graphics* pGraphics,
path.AddRectangle(0, 0, rect.width, rect.height);
pGraphics->StrokePath(&path, (CFX_Matrix*)pMatrix);
}
- } else if (m_pNormalWidget->GetStylesEx() & XFA_FWL_PSBSTYLEEXT_HilitePush) {
}
- return FWL_ERR_Succeeded;
}
diff --git a/xfa/fxfa/app/xfa_ffpushbutton.h b/xfa/fxfa/app/xfa_ffpushbutton.h
index a37670bb30..96cf785eb0 100644
--- a/xfa/fxfa/app/xfa_ffpushbutton.h
+++ b/xfa/fxfa/app/xfa_ffpushbutton.h
@@ -28,10 +28,10 @@ class CXFA_FFPushButton : public CXFA_FFField {
virtual void UnloadWidget();
virtual FX_BOOL PerformLayout();
virtual void UpdateWidgetProperty();
- virtual int32_t OnProcessMessage(CFWL_Message* pMessage);
- virtual FWL_ERR OnProcessEvent(CFWL_Event* pEvent);
- virtual FWL_ERR OnDrawWidget(CFX_Graphics* pGraphics,
- const CFX_Matrix* pMatrix = NULL);
+ virtual void OnProcessMessage(CFWL_Message* pMessage);
+ virtual void OnProcessEvent(CFWL_Event* pEvent);
+ virtual void OnDrawWidget(CFX_Graphics* pGraphics,
+ const CFX_Matrix* pMatrix = NULL);
protected:
void LoadHighlightCaption();
diff --git a/xfa/fxfa/app/xfa_fftextedit.cpp b/xfa/fxfa/app/xfa_fftextedit.cpp
index 07324cb358..f5605c9775 100644
--- a/xfa/fxfa/app/xfa_fftextedit.cpp
+++ b/xfa/fxfa/app/xfa_fftextedit.cpp
@@ -332,7 +332,8 @@ FX_BOOL CXFA_FFTextEdit::Delete() {
return ((CFWL_Edit*)m_pNormalWidget)->Delete();
}
FX_BOOL CXFA_FFTextEdit::DeSelect() {
- return ((CFWL_Edit*)m_pNormalWidget)->ClearSelections();
+ return ((CFWL_Edit*)m_pNormalWidget)->ClearSelections() ==
+ FWL_Error::Succeeded;
}
FX_BOOL CXFA_FFTextEdit::GetSuggestWords(
CFX_PointF pointf,
@@ -400,11 +401,12 @@ FX_BOOL CXFA_FFTextEdit::GetSuggestWords(
}
return GetDoc()->GetDocProvider()->GetSuggestWords(GetDoc(), sWord, sSuggest);
}
-int32_t CXFA_FFTextEdit::OnProcessMessage(CFWL_Message* pMessage) {
- return m_pOldDelegate->OnProcessMessage(pMessage);
+
+void CXFA_FFTextEdit::OnProcessMessage(CFWL_Message* pMessage) {
+ m_pOldDelegate->OnProcessMessage(pMessage);
}
-FWL_ERR CXFA_FFTextEdit::OnProcessEvent(CFWL_Event* pEvent) {
+void CXFA_FFTextEdit::OnProcessEvent(CFWL_Event* pEvent) {
CXFA_FFField::OnProcessEvent(pEvent);
switch (pEvent->GetClassID()) {
case CFWL_EventType::TextChanged: {
@@ -432,13 +434,14 @@ FWL_ERR CXFA_FFTextEdit::OnProcessEvent(CFWL_Event* pEvent) {
default:
break;
}
- return m_pOldDelegate->OnProcessEvent(pEvent);
+ m_pOldDelegate->OnProcessEvent(pEvent);
}
-FWL_ERR CXFA_FFTextEdit::OnDrawWidget(CFX_Graphics* pGraphics,
- const CFX_Matrix* pMatrix) {
- return m_pOldDelegate->OnDrawWidget(pGraphics, pMatrix);
+void CXFA_FFTextEdit::OnDrawWidget(CFX_Graphics* pGraphics,
+ const CFX_Matrix* pMatrix) {
+ m_pOldDelegate->OnDrawWidget(pGraphics, pMatrix);
}
+
CXFA_FFNumericEdit::CXFA_FFNumericEdit(CXFA_FFPageView* pPageView,
CXFA_WidgetAcc* pDataAcc)
: CXFA_FFTextEdit(pPageView, pDataAcc) {}
@@ -486,14 +489,14 @@ void CXFA_FFNumericEdit::UpdateWidgetProperty() {
m_pNormalWidget->ModifyStylesEx(dwExtendedStyle, 0xFFFFFFFF);
}
-FWL_ERR CXFA_FFNumericEdit::OnProcessEvent(CFWL_Event* pEvent) {
+void CXFA_FFNumericEdit::OnProcessEvent(CFWL_Event* pEvent) {
if (pEvent->GetClassID() == CFWL_EventType::Validate) {
CFWL_EvtEdtValidate* event = (CFWL_EvtEdtValidate*)pEvent;
CFX_WideString wsChange = event->wsInsert;
event->bValidate = OnValidate(m_pNormalWidget->GetWidget(), wsChange);
- return event->bValidate;
+ return;
}
- return CXFA_FFTextEdit::OnProcessEvent(pEvent);
+ CXFA_FFTextEdit::OnProcessEvent(pEvent);
}
FX_BOOL CXFA_FFNumericEdit::OnValidate(IFWL_Widget* pWidget,
@@ -788,12 +791,12 @@ void CXFA_FFDateTimeEdit::OnSelectChanged(IFWL_Widget* pWidget,
m_pDataAcc->ProcessEvent(XFA_ATTRIBUTEENUM_Change, &eParam);
}
-FWL_ERR CXFA_FFDateTimeEdit::OnProcessEvent(CFWL_Event* pEvent) {
+void CXFA_FFDateTimeEdit::OnProcessEvent(CFWL_Event* pEvent) {
if (pEvent->GetClassID() == CFWL_EventType::SelectChanged) {
CFWL_Event_DtpSelectChanged* event = (CFWL_Event_DtpSelectChanged*)pEvent;
OnSelectChanged(m_pNormalWidget->GetWidget(), event->iYear, event->iMonth,
event->iDay);
- return TRUE;
+ return;
}
- return CXFA_FFTextEdit::OnProcessEvent(pEvent);
+ CXFA_FFTextEdit::OnProcessEvent(pEvent);
}
diff --git a/xfa/fxfa/app/xfa_fftextedit.h b/xfa/fxfa/app/xfa_fftextedit.h
index ecdc2da485..9b73577aab 100644
--- a/xfa/fxfa/app/xfa_fftextedit.h
+++ b/xfa/fxfa/app/xfa_fftextedit.h
@@ -44,10 +44,10 @@ class CXFA_FFTextEdit : public CXFA_FFField {
const CFX_ByteStringC& bsReplace) override;
// IFWL_WidgetDelegate:
- int32_t OnProcessMessage(CFWL_Message* pMessage) override;
- FWL_ERR OnProcessEvent(CFWL_Event* pEvent) override;
- FWL_ERR OnDrawWidget(CFX_Graphics* pGraphics,
- const CFX_Matrix* pMatrix = NULL) override;
+ void OnProcessMessage(CFWL_Message* pMessage) override;
+ void OnProcessEvent(CFWL_Event* pEvent) override;
+ void OnDrawWidget(CFX_Graphics* pGraphics,
+ const CFX_Matrix* pMatrix = NULL) override;
void OnTextChanged(IFWL_Widget* pWidget,
const CFX_WideString& wsChanged,
@@ -73,7 +73,7 @@ class CXFA_FFNumericEdit : public CXFA_FFTextEdit {
virtual ~CXFA_FFNumericEdit();
virtual FX_BOOL LoadWidget();
virtual void UpdateWidgetProperty();
- virtual FWL_ERR OnProcessEvent(CFWL_Event* pEvent);
+ virtual void OnProcessEvent(CFWL_Event* pEvent);
public:
FX_BOOL OnValidate(IFWL_Widget* pWidget, CFX_WideString& wsText);
@@ -132,7 +132,7 @@ class CXFA_FFDateTimeEdit : public CXFA_FFTextEdit {
int32_t iYear,
int32_t iMonth,
int32_t iDay);
- virtual FWL_ERR OnProcessEvent(CFWL_Event* pEvent);
+ virtual void OnProcessEvent(CFWL_Event* pEvent);
};
#endif // XFA_FXFA_APP_XFA_FFTEXTEDIT_H_
diff --git a/xfa/fxfa/app/xfa_fwladapter.cpp b/xfa/fxfa/app/xfa_fwladapter.cpp
index 564d479d73..4a0828b5ef 100644
--- a/xfa/fxfa/app/xfa_fwladapter.cpp
+++ b/xfa/fxfa/app/xfa_fwladapter.cpp
@@ -13,15 +13,17 @@ CXFA_FWLAdapterWidgetMgr::CXFA_FWLAdapterWidgetMgr() {}
CXFA_FWLAdapterWidgetMgr::~CXFA_FWLAdapterWidgetMgr() {}
-FWL_ERR CXFA_FWLAdapterWidgetMgr::RepaintWidget(IFWL_Widget* pWidget,
- const CFX_RectF* pRect) {
+FWL_Error CXFA_FWLAdapterWidgetMgr::RepaintWidget(IFWL_Widget* pWidget,
+ const CFX_RectF* pRect) {
if (!pWidget)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
+
CXFA_FFField* pField = (CXFA_FFField*)pWidget->GetPrivateData(pWidget);
if (!pField)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
+
pField->AddInvalidateRect(nullptr);
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
FX_BOOL CXFA_FWLAdapterWidgetMgr::GetPopupPos(IFWL_Widget* pWidget,
diff --git a/xfa/fxfa/app/xfa_fwladapter.h b/xfa/fxfa/app/xfa_fwladapter.h
index 7d2241668b..00e76db227 100644
--- a/xfa/fxfa/app/xfa_fwladapter.h
+++ b/xfa/fxfa/app/xfa_fwladapter.h
@@ -18,7 +18,7 @@ class CXFA_FWLAdapterWidgetMgr {
CXFA_FWLAdapterWidgetMgr();
~CXFA_FWLAdapterWidgetMgr();
- FWL_ERR RepaintWidget(IFWL_Widget* pWidget, const CFX_RectF* pRect);
+ FWL_Error RepaintWidget(IFWL_Widget* pWidget, const CFX_RectF* pRect);
FX_BOOL GetPopupPos(IFWL_Widget* pWidget,
FX_FLOAT fMinHeight,
FX_FLOAT fMaxHeight,
diff --git a/xfa/fxfa/app/xfa_fwltheme.cpp b/xfa/fxfa/app/xfa_fwltheme.cpp
index 86da75e066..b07a7323b3 100644
--- a/xfa/fxfa/app/xfa_fwltheme.cpp
+++ b/xfa/fxfa/app/xfa_fwltheme.cpp
@@ -76,7 +76,7 @@ CXFA_FWLTheme::~CXFA_FWLTheme() {
delete m_pCaretTP;
delete m_pBarcodeTP;
}
-FWL_ERR CXFA_FWLTheme::Initialize() {
+FWL_Error CXFA_FWLTheme::Initialize() {
m_pTextOut = new CFDE_TextOut;
for (size_t i = 0; !m_pCalendarFont && i < FX_ArraySize(g_FWLTheme_CalFonts);
++i) {
@@ -95,9 +95,9 @@ FWL_ERR CXFA_FWLTheme::Initialize() {
ASSERT(NULL != m_pCalendarFont);
FWLTHEME_Init();
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
-FWL_ERR CXFA_FWLTheme::Finalize() {
+FWL_Error CXFA_FWLTheme::Finalize() {
if (m_pTextOut) {
m_pTextOut->Release();
m_pTextOut = NULL;
@@ -107,7 +107,7 @@ FWL_ERR CXFA_FWLTheme::Finalize() {
m_pCalendarFont = NULL;
}
FWLTHEME_Release();
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
FX_BOOL CXFA_FWLTheme::IsValidWidget(IFWL_Widget* pWidget) {
return TRUE;
@@ -124,14 +124,14 @@ FX_BOOL CXFA_FWLTheme::DrawBackground(CFWL_ThemeBackground* pParams) {
return GetTheme(pParams->m_pWidget)->DrawBackground(pParams);
}
FX_BOOL CXFA_FWLTheme::DrawText(CFWL_ThemeText* pParams) {
- if (pParams->m_wsText.IsEmpty()) {
- return FWL_ERR_Indefinite;
- }
+ if (pParams->m_wsText.IsEmpty())
+ return FALSE;
+
if (pParams->m_pWidget->GetClassID() == FWL_CLASSHASH_MonthCalendar) {
CXFA_FFWidget* pWidget = XFA_ThemeGetOuterWidget(pParams->m_pWidget);
- if (!pWidget) {
- return FWL_ERR_Indefinite;
- }
+ if (!pWidget)
+ return FALSE;
+
m_pTextOut->SetStyles(pParams->m_dwTTOStyles);
m_pTextOut->SetAlignment(pParams->m_iTTOAlign);
m_pTextOut->SetFont(m_pCalendarFont);
@@ -166,9 +166,9 @@ FX_BOOL CXFA_FWLTheme::DrawText(CFWL_ThemeText* pParams) {
return TRUE;
}
CXFA_FFWidget* pWidget = XFA_ThemeGetOuterWidget(pParams->m_pWidget);
- if (!pWidget) {
- return FWL_ERR_Indefinite;
- }
+ if (!pWidget)
+ return FALSE;
+
CXFA_WidgetAcc* pAcc = pWidget->GetDataAcc();
CFX_Graphics* pGraphics = pParams->m_pGraphics;
CFX_RenderDevice* pRenderDevice = pGraphics->GetRenderDevice();
@@ -345,7 +345,7 @@ void* CXFA_FWLTheme::GetCapacity(CFWL_ThemePart* pThemePart,
FX_BOOL CXFA_FWLTheme::IsCustomizedLayout(IFWL_Widget* pWidget) {
return GetTheme(pWidget)->IsCustomizedLayout(pWidget);
}
-FWL_ERR CXFA_FWLTheme::GetPartRect(CFWL_ThemePart* pThemePart) {
+FWL_Error CXFA_FWLTheme::GetPartRect(CFWL_ThemePart* pThemePart) {
CFX_RectF rect;
return GetTheme(pThemePart->m_pWidget)->GetPartRect(pThemePart, rect);
}
@@ -357,9 +357,8 @@ FX_BOOL CXFA_FWLTheme::IsInPart(CFWL_ThemePart* pThemePart,
FX_BOOL CXFA_FWLTheme::CalcTextRect(CFWL_ThemeText* pParams, CFX_RectF& rect) {
if (pParams->m_pWidget->GetClassID() == FWL_CLASSHASH_MonthCalendar) {
CXFA_FFWidget* pWidget = XFA_ThemeGetOuterWidget(pParams->m_pWidget);
- if (!pWidget) {
- return FWL_ERR_Indefinite;
- }
+ if (!pWidget)
+ return FALSE;
if (!pParams)
return FALSE;
if (!m_pTextOut)
@@ -374,9 +373,9 @@ FX_BOOL CXFA_FWLTheme::CalcTextRect(CFWL_ThemeText* pParams, CFX_RectF& rect) {
return TRUE;
}
CXFA_FFWidget* pWidget = XFA_ThemeGetOuterWidget(pParams->m_pWidget);
- if (!pWidget) {
- return FWL_ERR_Indefinite;
- }
+ if (!pWidget)
+ return FALSE;
+
CXFA_WidgetAcc* pAcc = pWidget->GetDataAcc();
m_pTextOut->SetFont(pAcc->GetFDEFont());
m_pTextOut->SetFontSize(pAcc->GetFontSize());
diff --git a/xfa/fxfa/app/xfa_fwltheme.h b/xfa/fxfa/app/xfa_fwltheme.h
index ae95637c8d..fa63085ba5 100644
--- a/xfa/fxfa/app/xfa_fwltheme.h
+++ b/xfa/fxfa/app/xfa_fwltheme.h
@@ -26,17 +26,17 @@ class CXFA_FWLTheme : public IFWL_ThemeProvider {
public:
CXFA_FWLTheme(CXFA_FFApp* pApp);
virtual ~CXFA_FWLTheme();
- virtual FWL_ERR Release() {
+ virtual FWL_Error Release() {
delete this;
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
virtual IFWL_Widget* Retain() { return NULL; }
- virtual FWL_ERR GetClassName(CFX_WideString& wsClass) const {
- return FWL_ERR_Succeeded;
+ virtual FWL_Error GetClassName(CFX_WideString& wsClass) const {
+ return FWL_Error::Succeeded;
}
virtual uint32_t GetHashCode() const { return 0; }
- virtual FWL_ERR Initialize();
- virtual FWL_ERR Finalize();
+ virtual FWL_Error Initialize();
+ virtual FWL_Error Finalize();
virtual FX_BOOL IsValidWidget(IFWL_Widget* pWidget);
virtual uint32_t GetThemeID(IFWL_Widget* pWidget);
virtual uint32_t SetThemeID(IFWL_Widget* pWidget,
@@ -47,21 +47,21 @@ class CXFA_FWLTheme : public IFWL_ThemeProvider {
virtual void* GetCapacity(CFWL_ThemePart* pThemePart,
CFWL_WidgetCapacity dwCapacity);
virtual FX_BOOL IsCustomizedLayout(IFWL_Widget* pWidget);
- virtual FWL_ERR GetPartRect(CFWL_ThemePart* pThemePart);
+ virtual FWL_Error GetPartRect(CFWL_ThemePart* pThemePart);
virtual FX_BOOL IsInPart(CFWL_ThemePart* pThemePart,
FX_FLOAT fx,
FX_FLOAT fy);
virtual FX_BOOL CalcTextRect(CFWL_ThemeText* pParams, CFX_RectF& rect);
- virtual FWL_ERR GetThemeMatrix(IFWL_Widget* pWidget, CFX_Matrix& matrix) {
- return FWL_ERR_Succeeded;
+ virtual FWL_Error GetThemeMatrix(IFWL_Widget* pWidget, CFX_Matrix& matrix) {
+ return FWL_Error::Succeeded;
}
- virtual FWL_ERR SetThemeMatrix(IFWL_Widget* pWidget,
- const CFX_Matrix& matrix) {
- return FWL_ERR_Succeeded;
+ virtual FWL_Error SetThemeMatrix(IFWL_Widget* pWidget,
+ const CFX_Matrix& matrix) {
+ return FWL_Error::Succeeded;
}
- virtual FWL_ERR GetPartRect(CFWL_ThemePart* pThemePart, CFX_RectF& rtPart) {
- return FWL_ERR_Succeeded;
+ virtual FWL_Error GetPartRect(CFWL_ThemePart* pThemePart, CFX_RectF& rtPart) {
+ return FWL_Error::Succeeded;
}
protected: