Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(551)

Unified Diff: xfa/fxfa/app/xfa_fwltheme.cpp

Issue 1952693003: Convert FWL_ERR into an enum class. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « xfa/fxfa/app/xfa_fwltheme.h ('k') | xfa/fxgraphics/cagg_graphics.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fxfa/app/xfa_fwltheme.cpp
diff --git a/xfa/fxfa/app/xfa_fwltheme.cpp b/xfa/fxfa/app/xfa_fwltheme.cpp
index 86da75e066cd864f21560babde20a521f6dff812..b07a7323b3559b1f4678726cfaeec0bfc36247ce 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());
« no previous file with comments | « xfa/fxfa/app/xfa_fwltheme.h ('k') | xfa/fxgraphics/cagg_graphics.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698