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

Unified Diff: xfa/fxgraphics/cfx_path.cpp

Issue 1943413002: Convert FWL_ERR into an enum class. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@bcdattribute
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/fxgraphics/cfx_path.h ('k') | xfa/fxgraphics/include/cfx_graphics.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fxgraphics/cfx_path.cpp
diff --git a/xfa/fxgraphics/cfx_path.cpp b/xfa/fxgraphics/cfx_path.cpp
index 2acdc3eac25170f1e224ba9ac40209aa1c7b27b5..fe956d3fcc3e8a938c449778871d8854d0f57f18 100644
--- a/xfa/fxgraphics/cfx_path.cpp
+++ b/xfa/fxgraphics/cfx_path.cpp
@@ -12,163 +12,165 @@ CFX_Path::CFX_Path() {
m_generator = nullptr;
}
-FX_ERR CFX_Path::Create() {
+FWL_Error CFX_Path::Create() {
if (m_generator)
- return FX_ERR_Property_Invalid;
+ return FWL_Error::PropertyInvalid;
m_generator = new CFX_PathGenerator;
m_generator->Create();
- return FX_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
CFX_Path::~CFX_Path() {
delete m_generator;
}
-FX_ERR CFX_Path::MoveTo(FX_FLOAT x, FX_FLOAT y) {
+FWL_Error CFX_Path::MoveTo(FX_FLOAT x, FX_FLOAT y) {
if (!m_generator)
- return FX_ERR_Property_Invalid;
+ return FWL_Error::PropertyInvalid;
m_generator->MoveTo(x, y);
- return FX_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
-FX_ERR CFX_Path::LineTo(FX_FLOAT x, FX_FLOAT y) {
+FWL_Error CFX_Path::LineTo(FX_FLOAT x, FX_FLOAT y) {
if (!m_generator)
- return FX_ERR_Property_Invalid;
+ return FWL_Error::PropertyInvalid;
m_generator->LineTo(x, y);
- return FX_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
-FX_ERR CFX_Path::BezierTo(FX_FLOAT ctrlX1,
- FX_FLOAT ctrlY1,
- FX_FLOAT ctrlX2,
- FX_FLOAT ctrlY2,
- FX_FLOAT toX,
- FX_FLOAT toY) {
+FWL_Error CFX_Path::BezierTo(FX_FLOAT ctrlX1,
+ FX_FLOAT ctrlY1,
+ FX_FLOAT ctrlX2,
+ FX_FLOAT ctrlY2,
+ FX_FLOAT toX,
+ FX_FLOAT toY) {
if (!m_generator)
- return FX_ERR_Property_Invalid;
+ return FWL_Error::PropertyInvalid;
m_generator->BezierTo(ctrlX1, ctrlY1, ctrlX2, ctrlY2, toX, toY);
- return FX_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
-FX_ERR CFX_Path::ArcTo(FX_FLOAT left,
- FX_FLOAT top,
- FX_FLOAT width,
- FX_FLOAT height,
- FX_FLOAT startAngle,
- FX_FLOAT sweepAngle) {
+FWL_Error CFX_Path::ArcTo(FX_FLOAT left,
+ FX_FLOAT top,
+ FX_FLOAT width,
+ FX_FLOAT height,
+ FX_FLOAT startAngle,
+ FX_FLOAT sweepAngle) {
if (!m_generator)
- return FX_ERR_Property_Invalid;
+ return FWL_Error::PropertyInvalid;
m_generator->ArcTo(left + width / 2, top + height / 2, width / 2, height / 2,
startAngle, sweepAngle);
- return FX_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
-FX_ERR CFX_Path::Close() {
+FWL_Error CFX_Path::Close() {
if (!m_generator)
- return FX_ERR_Property_Invalid;
+ return FWL_Error::PropertyInvalid;
m_generator->Close();
- return FX_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
-FX_ERR CFX_Path::AddLine(FX_FLOAT x1, FX_FLOAT y1, FX_FLOAT x2, FX_FLOAT y2) {
+FWL_Error CFX_Path::AddLine(FX_FLOAT x1,
+ FX_FLOAT y1,
+ FX_FLOAT x2,
+ FX_FLOAT y2) {
if (!m_generator)
- return FX_ERR_Property_Invalid;
+ return FWL_Error::PropertyInvalid;
m_generator->AddLine(x1, y1, x2, y2);
- return FX_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
-FX_ERR CFX_Path::AddBezier(FX_FLOAT startX,
- FX_FLOAT startY,
- FX_FLOAT ctrlX1,
- FX_FLOAT ctrlY1,
- FX_FLOAT ctrlX2,
- FX_FLOAT ctrlY2,
- FX_FLOAT endX,
- FX_FLOAT endY) {
+FWL_Error CFX_Path::AddBezier(FX_FLOAT startX,
+ FX_FLOAT startY,
+ FX_FLOAT ctrlX1,
+ FX_FLOAT ctrlY1,
+ FX_FLOAT ctrlX2,
+ FX_FLOAT ctrlY2,
+ FX_FLOAT endX,
+ FX_FLOAT endY) {
if (!m_generator)
- return FX_ERR_Property_Invalid;
+ return FWL_Error::PropertyInvalid;
m_generator->AddBezier(startX, startY, ctrlX1, ctrlY1, ctrlX2, ctrlY2, endX,
endY);
- return FX_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
-FX_ERR CFX_Path::AddRectangle(FX_FLOAT left,
- FX_FLOAT top,
- FX_FLOAT width,
- FX_FLOAT height) {
+FWL_Error CFX_Path::AddRectangle(FX_FLOAT left,
+ FX_FLOAT top,
+ FX_FLOAT width,
+ FX_FLOAT height) {
if (!m_generator)
- return FX_ERR_Property_Invalid;
+ return FWL_Error::PropertyInvalid;
m_generator->AddRectangle(left, top, left + width, top + height);
- return FX_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
-FX_ERR CFX_Path::AddEllipse(FX_FLOAT left,
- FX_FLOAT top,
- FX_FLOAT width,
- FX_FLOAT height) {
+FWL_Error CFX_Path::AddEllipse(FX_FLOAT left,
+ FX_FLOAT top,
+ FX_FLOAT width,
+ FX_FLOAT height) {
if (!m_generator)
- return FX_ERR_Property_Invalid;
+ return FWL_Error::PropertyInvalid;
m_generator->AddEllipse(left + width / 2, top + height / 2, width / 2,
height / 2);
- return FX_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
-FX_ERR CFX_Path::AddEllipse(const CFX_RectF& rect) {
+FWL_Error CFX_Path::AddEllipse(const CFX_RectF& rect) {
if (!m_generator)
- return FX_ERR_Property_Invalid;
+ return FWL_Error::PropertyInvalid;
m_generator->AddEllipse(rect.left + rect.Width() / 2,
rect.top + rect.Height() / 2, rect.Width() / 2,
rect.Height() / 2);
- return FX_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
-FX_ERR CFX_Path::AddArc(FX_FLOAT left,
- FX_FLOAT top,
- FX_FLOAT width,
- FX_FLOAT height,
- FX_FLOAT startAngle,
- FX_FLOAT sweepAngle) {
+FWL_Error CFX_Path::AddArc(FX_FLOAT left,
+ FX_FLOAT top,
+ FX_FLOAT width,
+ FX_FLOAT height,
+ FX_FLOAT startAngle,
+ FX_FLOAT sweepAngle) {
if (!m_generator)
- return FX_ERR_Property_Invalid;
+ return FWL_Error::PropertyInvalid;
m_generator->AddArc(left + width / 2, top + height / 2, width / 2, height / 2,
startAngle, sweepAngle);
- return FX_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
-FX_ERR CFX_Path::AddPie(FX_FLOAT left,
- FX_FLOAT top,
- FX_FLOAT width,
- FX_FLOAT height,
- FX_FLOAT startAngle,
- FX_FLOAT sweepAngle) {
+FWL_Error CFX_Path::AddPie(FX_FLOAT left,
+ FX_FLOAT top,
+ FX_FLOAT width,
+ FX_FLOAT height,
+ FX_FLOAT startAngle,
+ FX_FLOAT sweepAngle) {
if (!m_generator)
- return FX_ERR_Property_Invalid;
+ return FWL_Error::PropertyInvalid;
m_generator->AddPie(left + width / 2, top + height / 2, width / 2, height / 2,
startAngle, sweepAngle);
- return FX_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
-FX_ERR CFX_Path::AddSubpath(CFX_Path* path) {
+FWL_Error CFX_Path::AddSubpath(CFX_Path* path) {
if (!m_generator)
- return FX_ERR_Property_Invalid;
+ return FWL_Error::PropertyInvalid;
m_generator->AddPathData(path->GetPathData());
- return FX_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
-FX_ERR CFX_Path::Clear() {
+FWL_Error CFX_Path::Clear() {
if (!m_generator)
- return FX_ERR_Property_Invalid;
+ return FWL_Error::PropertyInvalid;
m_generator->GetPathData()->SetPointCount(0);
- return FX_ERR_Succeeded;
+ return FWL_Error::Succeeded;
}
FX_BOOL CFX_Path::IsEmpty() {
if (!m_generator)
- return FX_ERR_Property_Invalid;
- if (m_generator->GetPathData()->GetPointCount() == 0) {
+ return FALSE;
+ if (m_generator->GetPathData()->GetPointCount() == 0)
return TRUE;
- }
return FALSE;
}
« no previous file with comments | « xfa/fxgraphics/cfx_path.h ('k') | xfa/fxgraphics/include/cfx_graphics.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698