diff options
author | dsinclair <dsinclair@chromium.org> | 2016-05-04 17:57:03 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-05-04 17:57:03 -0700 |
commit | c777f486f84611d2fdd2d03af661b14955f9efb6 (patch) | |
tree | 679012454d82e885f749d17f75fd12735efec29a /xfa/fxfa/app/xfa_fwltheme.cpp | |
parent | 41aad19ba366540bd4efa20a9009ac1c70a81403 (diff) | |
download | pdfium-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/app/xfa_fwltheme.cpp')
-rw-r--r-- | xfa/fxfa/app/xfa_fwltheme.cpp | 39 |
1 files changed, 19 insertions, 20 deletions
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()); |