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/fwl/basewidget/fwl_barcodeimp.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/fwl/basewidget/fwl_barcodeimp.cpp')
-rw-r--r-- | xfa/fwl/basewidget/fwl_barcodeimp.cpp | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/xfa/fwl/basewidget/fwl_barcodeimp.cpp b/xfa/fwl/basewidget/fwl_barcodeimp.cpp index d4589e39c1..ce9d083d83 100644 --- a/xfa/fwl/basewidget/fwl_barcodeimp.cpp +++ b/xfa/fwl/basewidget/fwl_barcodeimp.cpp @@ -38,45 +38,45 @@ CFWL_BarcodeImp::CFWL_BarcodeImp(const CFWL_WidgetImpProperties& properties, CFWL_BarcodeImp::~CFWL_BarcodeImp() { ReleaseBarcodeEngine(); } -FWL_ERR CFWL_BarcodeImp::GetClassName(CFX_WideString& wsClass) const { +FWL_Error CFWL_BarcodeImp::GetClassName(CFX_WideString& wsClass) const { wsClass = FWL_CLASS_Barcode; - return FWL_ERR_Succeeded; + return FWL_Error::Succeeded; } uint32_t CFWL_BarcodeImp::GetClassID() const { return FWL_CLASSHASH_Barcode; } -FWL_ERR CFWL_BarcodeImp::Initialize() { +FWL_Error CFWL_BarcodeImp::Initialize() { if (!m_pDelegate) { m_pDelegate = new CFWL_BarcodeImpDelegate(this); } - if (CFWL_EditImp::Initialize() != FWL_ERR_Succeeded) - return FWL_ERR_Indefinite; - return FWL_ERR_Succeeded; + if (CFWL_EditImp::Initialize() != FWL_Error::Succeeded) + return FWL_Error::Indefinite; + return FWL_Error::Succeeded; } -FWL_ERR CFWL_BarcodeImp::Finalize() { +FWL_Error CFWL_BarcodeImp::Finalize() { delete m_pDelegate; m_pDelegate = nullptr; ReleaseBarcodeEngine(); return CFWL_EditImp::Finalize(); } -FWL_ERR CFWL_BarcodeImp::Update() { +FWL_Error CFWL_BarcodeImp::Update() { if (IsLocked()) { - return FWL_ERR_Indefinite; + return FWL_Error::Indefinite; } - FWL_ERR ret = CFWL_EditImp::Update(); + FWL_Error ret = CFWL_EditImp::Update(); GenerateBarcodeImageCache(); return ret; } -FWL_ERR CFWL_BarcodeImp::DrawWidget(CFX_Graphics* pGraphics, - const CFX_Matrix* pMatrix) { +FWL_Error CFWL_BarcodeImp::DrawWidget(CFX_Graphics* pGraphics, + const CFX_Matrix* pMatrix) { if (!pGraphics) - return FWL_ERR_Indefinite; + return FWL_Error::Indefinite; if (!m_pProperties->m_pThemeProvider) - return FWL_ERR_Indefinite; + return FWL_Error::Indefinite; if ((m_pProperties->m_dwStates & FWL_WGTSTATE_Focused) == 0) { GenerateBarcodeImageCache(); if (!m_pBarcodeEngine || (m_dwStatus & XFA_BCS_EncodeSuccess) == 0) { - return FWL_ERR_Succeeded; + return FWL_Error::Succeeded; } CFX_Matrix mt; mt.e = m_rtClient.left; @@ -87,9 +87,9 @@ FWL_ERR CFWL_BarcodeImp::DrawWidget(CFX_Graphics* pGraphics, int32_t errorCode = 0; if (!m_pBarcodeEngine->RenderDevice(pGraphics->GetRenderDevice(), pMatrix, errorCode)) { - return FWL_ERR_Indefinite; + return FWL_Error::Indefinite; } - return FWL_ERR_Succeeded; + return FWL_Error::Succeeded; } return CFWL_EditImp::DrawWidget(pGraphics, pMatrix); } @@ -105,7 +105,7 @@ void CFWL_BarcodeImp::GenerateBarcodeImageCache() { if (!m_pBarcodeEngine) return; CFX_WideString wsText; - if (GetText(wsText) != FWL_ERR_Succeeded) + if (GetText(wsText) != FWL_Error::Succeeded) return; CFWL_ThemePart part; part.m_pWidget = m_pInterface; @@ -200,7 +200,7 @@ void CFWL_BarcodeImp::SetType(BC_TYPE type) { m_type = type; m_dwStatus = XFA_BCS_NeedUpdate; } -FWL_ERR CFWL_BarcodeImp::SetText(const CFX_WideString& wsText) { +FWL_Error CFWL_BarcodeImp::SetText(const CFX_WideString& wsText) { ReleaseBarcodeEngine(); m_dwStatus = XFA_BCS_NeedUpdate; return CFWL_EditImp::SetText(wsText); @@ -220,11 +220,11 @@ FX_BOOL CFWL_BarcodeImp::IsProtectedType() { CFWL_BarcodeImpDelegate::CFWL_BarcodeImpDelegate(CFWL_BarcodeImp* pOwner) : CFWL_EditImpDelegate(pOwner) {} -FWL_ERR CFWL_BarcodeImpDelegate::OnProcessEvent(CFWL_Event* pEvent) { +void CFWL_BarcodeImpDelegate::OnProcessEvent(CFWL_Event* pEvent) { if (pEvent->GetClassID() == CFWL_EventType::TextChanged) { CFWL_BarcodeImp* pOwner = static_cast<CFWL_BarcodeImp*>(m_pOwner); pOwner->ReleaseBarcodeEngine(); pOwner->m_dwStatus = XFA_BCS_NeedUpdate; } - return CFWL_EditImpDelegate::OnProcessEvent(pEvent); + CFWL_EditImpDelegate::OnProcessEvent(pEvent); } |