summaryrefslogtreecommitdiff
path: root/xfa/fwl/basewidget/fwl_pictureboximp.cpp
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/fwl/basewidget/fwl_pictureboximp.cpp
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/fwl/basewidget/fwl_pictureboximp.cpp')
-rw-r--r--xfa/fwl/basewidget/fwl_pictureboximp.cpp45
1 files changed, 24 insertions, 21 deletions
diff --git a/xfa/fwl/basewidget/fwl_pictureboximp.cpp b/xfa/fwl/basewidget/fwl_pictureboximp.cpp
index 4495a495ba..c2cd09d342 100644
--- a/xfa/fwl/basewidget/fwl_pictureboximp.cpp
+++ b/xfa/fwl/basewidget/fwl_pictureboximp.cpp
@@ -35,29 +35,30 @@ CFWL_PictureBoxImp::CFWL_PictureBoxImp(
m_matrix.SetIdentity();
}
CFWL_PictureBoxImp::~CFWL_PictureBoxImp() {}
-FWL_ERR CFWL_PictureBoxImp::GetClassName(CFX_WideString& wsClass) const {
+FWL_Error CFWL_PictureBoxImp::GetClassName(CFX_WideString& wsClass) const {
wsClass = FWL_CLASS_PictureBox;
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
uint32_t CFWL_PictureBoxImp::GetClassID() const {
return FWL_CLASSHASH_PictureBox;
}
-FWL_ERR CFWL_PictureBoxImp::Initialize() {
- if (CFWL_WidgetImp::Initialize() != FWL_ERR_Succeeded)
- return FWL_ERR_Indefinite;
+FWL_Error CFWL_PictureBoxImp::Initialize() {
+ if (CFWL_WidgetImp::Initialize() != FWL_Error::Succeeded)
+ return FWL_Error::Indefinite;
m_pDelegate = new CFWL_PictureBoxImpDelegate(this);
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
-FWL_ERR CFWL_PictureBoxImp::Finalize() {
+FWL_Error CFWL_PictureBoxImp::Finalize() {
delete m_pDelegate;
m_pDelegate = nullptr;
return CFWL_WidgetImp::Finalize();
}
-FWL_ERR CFWL_PictureBoxImp::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) {
+FWL_Error CFWL_PictureBoxImp::GetWidgetRect(CFX_RectF& rect,
+ FX_BOOL bAutoSize) {
if (bAutoSize) {
rect.Set(0, 0, 0, 0);
if (!m_pProperties->m_pDataProvider)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
CFX_DIBitmap* pBitmap =
static_cast<IFWL_PictureBoxDP*>(m_pProperties->m_pDataProvider)
->GetPicture(m_pInterface);
@@ -69,24 +70,24 @@ FWL_ERR CFWL_PictureBoxImp::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) {
} else {
rect = m_pProperties->m_rtWidget;
}
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
-FWL_ERR CFWL_PictureBoxImp::Update() {
+FWL_Error CFWL_PictureBoxImp::Update() {
if (IsLocked()) {
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
if (!m_pProperties->m_pThemeProvider) {
m_pProperties->m_pThemeProvider = GetAvailableTheme();
}
GetClientRect(m_rtClient);
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
-FWL_ERR CFWL_PictureBoxImp::DrawWidget(CFX_Graphics* pGraphics,
- const CFX_Matrix* pMatrix) {
+FWL_Error CFWL_PictureBoxImp::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;
IFWL_ThemeProvider* pTheme = GetAvailableTheme();
if (HasBorder()) {
DrawBorder(pGraphics, CFWL_Part::Border, pTheme, pMatrix);
@@ -95,7 +96,7 @@ FWL_ERR CFWL_PictureBoxImp::DrawWidget(CFX_Graphics* pGraphics,
DrawEdge(pGraphics, CFWL_Part::Edge, pTheme, pMatrix);
}
DrawBkground(pGraphics, pTheme, pMatrix);
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
void CFWL_PictureBoxImp::DrawBkground(CFX_Graphics* pGraphics,
IFWL_ThemeProvider* pTheme,
@@ -141,10 +142,12 @@ FX_BOOL CFWL_PictureBoxImp::VStyle(FX_BOOL dwStyle) {
}
return FALSE;
}
+
CFWL_PictureBoxImpDelegate::CFWL_PictureBoxImpDelegate(
CFWL_PictureBoxImp* pOwner)
: m_pOwner(pOwner) {}
-FWL_ERR CFWL_PictureBoxImpDelegate::OnDrawWidget(CFX_Graphics* pGraphics,
- const CFX_Matrix* pMatrix) {
- return m_pOwner->DrawWidget(pGraphics, pMatrix);
+
+void CFWL_PictureBoxImpDelegate::OnDrawWidget(CFX_Graphics* pGraphics,
+ const CFX_Matrix* pMatrix) {
+ m_pOwner->DrawWidget(pGraphics, pMatrix);
}