summaryrefslogtreecommitdiff
path: root/xfa/fwl/lightwidget/cfwl_picturebox.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/lightwidget/cfwl_picturebox.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/lightwidget/cfwl_picturebox.cpp')
-rw-r--r--xfa/fwl/lightwidget/cfwl_picturebox.cpp53
1 files changed, 27 insertions, 26 deletions
diff --git a/xfa/fwl/lightwidget/cfwl_picturebox.cpp b/xfa/fwl/lightwidget/cfwl_picturebox.cpp
index b0bd3c9931..f3f52ab993 100644
--- a/xfa/fwl/lightwidget/cfwl_picturebox.cpp
+++ b/xfa/fwl/lightwidget/cfwl_picturebox.cpp
@@ -12,94 +12,95 @@ CFWL_PictureBox* CFWL_PictureBox::Create() {
return new CFWL_PictureBox;
}
-FWL_ERR CFWL_PictureBox::Initialize(const CFWL_WidgetProperties* pProperties) {
+FWL_Error CFWL_PictureBox::Initialize(
+ const CFWL_WidgetProperties* pProperties) {
if (m_pIface)
- return FWL_ERR_Indefinite;
+ return FWL_Error::Indefinite;
if (pProperties) {
*m_pProperties = *pProperties;
}
std::unique_ptr<IFWL_PictureBox> pPictureBox(IFWL_PictureBox::Create(
m_pProperties->MakeWidgetImpProperties(&m_PictureBoxDP), nullptr));
- FWL_ERR ret = pPictureBox->Initialize();
- if (ret != FWL_ERR_Succeeded) {
+ FWL_Error ret = pPictureBox->Initialize();
+ if (ret != FWL_Error::Succeeded) {
return ret;
}
m_pIface = pPictureBox.release();
CFWL_Widget::Initialize();
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
CFX_DIBitmap* CFWL_PictureBox::GetPicture() {
return m_PictureBoxDP.m_pBitmap;
}
-FWL_ERR CFWL_PictureBox::SetPicture(CFX_DIBitmap* pBitmap) {
+FWL_Error CFWL_PictureBox::SetPicture(CFX_DIBitmap* pBitmap) {
m_PictureBoxDP.m_pBitmap = pBitmap;
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
FX_FLOAT CFWL_PictureBox::GetRotation() {
return m_PictureBoxDP.m_fRotation;
}
-FWL_ERR CFWL_PictureBox::SetRotation(FX_FLOAT fRotation) {
+FWL_Error CFWL_PictureBox::SetRotation(FX_FLOAT fRotation) {
m_PictureBoxDP.m_fRotation = fRotation;
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
int32_t CFWL_PictureBox::GetFlipMode() {
return m_PictureBoxDP.GetFlipMode(m_pIface);
}
-FWL_ERR CFWL_PictureBox::SetFlipMode(int32_t iFlipMode) {
+FWL_Error CFWL_PictureBox::SetFlipMode(int32_t iFlipMode) {
m_PictureBoxDP.m_iFlipMode = iFlipMode;
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
int32_t CFWL_PictureBox::GetOpacity() {
return m_PictureBoxDP.GetOpacity(m_pIface);
}
-FWL_ERR CFWL_PictureBox::SetOpacity(int32_t iOpacity) {
+FWL_Error CFWL_PictureBox::SetOpacity(int32_t iOpacity) {
m_PictureBoxDP.m_iOpacity = iOpacity;
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
-FWL_ERR CFWL_PictureBox::GetScale(FX_FLOAT& fScaleX, FX_FLOAT& fScaleY) {
+FWL_Error CFWL_PictureBox::GetScale(FX_FLOAT& fScaleX, FX_FLOAT& fScaleY) {
CFX_Matrix matrix;
m_PictureBoxDP.GetMatrix(m_pIface, matrix);
matrix.Scale(fScaleX, fScaleY);
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
-FWL_ERR CFWL_PictureBox::SetScale(FX_FLOAT fScaleX, FX_FLOAT fScaleY) {
+FWL_Error CFWL_PictureBox::SetScale(FX_FLOAT fScaleX, FX_FLOAT fScaleY) {
m_PictureBoxDP.m_fScaleX = fScaleX;
m_PictureBoxDP.m_fScaleY = fScaleY;
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
-FWL_ERR CFWL_PictureBox::GetOffset(FX_FLOAT& fx, FX_FLOAT& fy) {
+FWL_Error CFWL_PictureBox::GetOffset(FX_FLOAT& fx, FX_FLOAT& fy) {
CFX_Matrix matrix;
m_PictureBoxDP.GetMatrix(m_pIface, matrix);
fx = matrix.e;
fy = matrix.f;
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
-FWL_ERR CFWL_PictureBox::SetOffset(FX_FLOAT fx, FX_FLOAT fy) {
+FWL_Error CFWL_PictureBox::SetOffset(FX_FLOAT fx, FX_FLOAT fy) {
m_PictureBoxDP.m_fOffSetX = fx;
m_PictureBoxDP.m_fOffSetY = fy;
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
CFWL_PictureBox::CFWL_PictureBox() {}
CFWL_PictureBox::~CFWL_PictureBox() {}
-FWL_ERR CFWL_PictureBox::CFWL_PictureBoxDP::GetCaption(
+FWL_Error CFWL_PictureBox::CFWL_PictureBoxDP::GetCaption(
IFWL_Widget* pWidget,
CFX_WideString& wsCaption) {
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
CFX_DIBitmap* CFWL_PictureBox::CFWL_PictureBoxDP::GetPicture(
@@ -121,8 +122,8 @@ int32_t CFWL_PictureBox::CFWL_PictureBoxDP::GetOpacity(IFWL_Widget* pWidget) {
return m_iOpacity;
}
-FWL_ERR CFWL_PictureBox::CFWL_PictureBoxDP::GetMatrix(IFWL_Widget* pWidget,
- CFX_Matrix& matrix) {
+FWL_Error CFWL_PictureBox::CFWL_PictureBoxDP::GetMatrix(IFWL_Widget* pWidget,
+ CFX_Matrix& matrix) {
CFX_RectF rect;
pWidget->GetClientRect(rect);
FX_FLOAT fLen = rect.width / 2;
@@ -133,7 +134,7 @@ FWL_ERR CFWL_PictureBox::CFWL_PictureBoxDP::GetMatrix(IFWL_Widget* pWidget,
matrix.Translate(fLen, fWid);
matrix.Scale(m_fScaleX, m_fScaleY);
matrix.Translate(m_fOffSetX, m_fOffSetY);
- return FWL_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
int32_t CFWL_PictureBox::CFWL_PictureBoxDP::GetFlipMode(IFWL_Widget* pWidget) {