summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-05-14 17:14:18 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-06-11 11:38:15 +0200
commit1f08bff31238d5818c54a0b86570689644dff087 (patch)
treed4d6f4b62a3c48ddeb85ba89818247c17f2578c8 /chart2
parentff130af9661a57d290dbf89b54a4c0ce8d0f71ea (diff)
new loplugin:shouldreturnbool
look for methods returning only 1 and/or 0, which (most of the time) should be returning bool. Off by default, because some of this is a matter of taste Change-Id: Ib17782e629888255196e89d4a178618a9612a0de Reviewed-on: https://gerrit.libreoffice.org/54379 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'chart2')
-rw-r--r--chart2/source/view/main/OpenGLRender.cxx37
-rw-r--r--chart2/source/view/main/OpenGLRender.hxx22
2 files changed, 24 insertions, 35 deletions
diff --git a/chart2/source/view/main/OpenGLRender.cxx b/chart2/source/view/main/OpenGLRender.cxx
index 35fbbac1d76f..56e46040ac5e 100644
--- a/chart2/source/view/main/OpenGLRender.cxx
+++ b/chart2/source/view/main/OpenGLRender.cxx
@@ -169,7 +169,7 @@ int OpenGLRender::InitOpenGL()
return 0;
}
-int OpenGLRender::SetLine2DShapePoint(float x, float y, int listLength)
+void OpenGLRender::SetLine2DShapePoint(float x, float y, int listLength)
{
if (m_Line2DPointList.empty())
{
@@ -184,7 +184,6 @@ int OpenGLRender::SetLine2DShapePoint(float x, float y, int listLength)
m_Line2DShapePointList.push_back(m_Line2DPointList);
m_Line2DPointList.clear();
}
- return 0;
}
int OpenGLRender::RenderLine2FBO()
@@ -275,13 +274,12 @@ void OpenGLRender::prepareToRender()
m_fZStep = 0;
}
-int OpenGLRender::MoveModelf(const PosVecf3& trans, const PosVecf3& angle, const PosVecf3& scale)
+void OpenGLRender::MoveModelf(const PosVecf3& trans, const PosVecf3& angle, const PosVecf3& scale)
{
glm::mat4 aTranslationMatrix = glm::translate(glm::vec3(trans.x, trans.y, trans.z));
glm::mat4 aScaleMatrix = glm::scale(glm::vec3(scale.x, scale.y, scale.z));
glm::mat4 aRotationMatrix = glm::eulerAngleYXZ(angle.y, angle.x, angle.z);
m_Model = aTranslationMatrix * aRotationMatrix * aScaleMatrix;
- return 0;
}
void OpenGLRender::Release()
@@ -392,7 +390,7 @@ int OpenGLRender::Create2DCircle(int detail)
return 0;
}
-int OpenGLRender::Bubble2DShapePoint(float x, float y, float directionX, float directionY)
+void OpenGLRender::Bubble2DShapePoint(float x, float y, float directionX, float directionY)
{
//check whether to create the circle data
if (m_Bubble2DCircle.empty())
@@ -407,7 +405,6 @@ int OpenGLRender::Bubble2DShapePoint(float x, float y, float directionX, float d
aBubble2DPointList.y = y + aBubble2DPointList.yScale / 2;
m_Bubble2DShapePointList.push_back(aBubble2DPointList);
- return 0;
}
int OpenGLRender::RenderBubble2FBO()
@@ -487,7 +484,7 @@ int OpenGLRender::RenderBubble2FBO()
return 0;
}
-int OpenGLRender::RectangleShapePoint(float x, float y, float directionX, float directionY)
+void OpenGLRender::RectangleShapePoint(float x, float y, float directionX, float directionY)
{
RectanglePointList aRectangle;
@@ -505,10 +502,9 @@ int OpenGLRender::RectangleShapePoint(float x, float y, float directionX, float
aRectangle.points[11] = m_fZStep;
m_RectangleShapePointList.push_back(aRectangle);
- return 0;
}
-int OpenGLRender::RenderRectangleShape(bool bBorder, bool bFill)
+void OpenGLRender::RenderRectangleShape(bool bBorder, bool bFill)
{
for (auto const& pointList : m_RectangleShapePointList)
{
@@ -613,7 +609,6 @@ int OpenGLRender::RenderRectangleShape(bool bBorder, bool bFill)
CHECK_GL_ERROR();
m_fZStep += Z_STEP;
- return 0;
}
@@ -637,11 +632,12 @@ int OpenGLRender::CreateTextTexture(const BitmapEx& rBitmapEx, const awt::Size&
OpenGLHelper::ConvertBitmapExToRGBATextureBuffer(rBitmapEx, bitmapBuf.get());
- return CreateTextTexture(bitmapBuf, rBitmapEx.GetSizePixel(),
+ CreateTextTexture(bitmapBuf, rBitmapEx.GetSizePixel(),
aSize, rotation, rTrans);
+ return 0;
}
-int OpenGLRender::CreateTextTexture(const boost::shared_array<sal_uInt8> &rPixels,
+void OpenGLRender::CreateTextTexture(const boost::shared_array<sal_uInt8> &rPixels,
const ::Size &aPixelSize,
const awt::Size& aSize,
long rotation,
@@ -688,10 +684,9 @@ int OpenGLRender::CreateTextTexture(const boost::shared_array<sal_uInt8> &rPixel
glBindTexture(GL_TEXTURE_2D, 0);
CHECK_GL_ERROR();
m_TextInfoVector.push_back(aTextInfo);
- return 0;
}
-int OpenGLRender::RenderTextShape()
+void OpenGLRender::RenderTextShape()
{
CHECK_GL_ERROR();
for (auto const& textInfo : m_TextInfoVector)
@@ -753,10 +748,9 @@ int OpenGLRender::RenderTextShape()
m_TextInfoVector.clear();
CHECK_GL_ERROR();
m_fZStep += Z_STEP;
- return 0;
}
-int OpenGLRender::SetArea2DShapePoint(float x, float y, int listLength)
+void OpenGLRender::SetArea2DShapePoint(float x, float y, int listLength)
{
if (m_Area2DPointList.empty())
{
@@ -771,7 +765,6 @@ int OpenGLRender::SetArea2DShapePoint(float x, float y, int listLength)
m_Area2DShapePointList.push_back(m_Area2DPointList);
m_Area2DPointList.clear();
}
- return 0;
}
namespace {
@@ -799,7 +792,7 @@ bool checkCCW(const PointList& rPoints)
}
-int OpenGLRender::RenderArea2DShape()
+void OpenGLRender::RenderArea2DShape()
{
CHECK_GL_ERROR();
@@ -847,8 +840,6 @@ int OpenGLRender::RenderArea2DShape()
m_fZStep += Z_STEP;
CHECK_GL_ERROR();
-
- return 0;
}
void OpenGLRender::SetBackGroundColor(::Color color1, ::Color color2, css::drawing::FillStyle fillStyle)
@@ -932,7 +923,7 @@ void OpenGLRender::GeneratePieSegment2D(double fInnerRadius, double fOutterRadiu
m_PieSegment2DShapePointList.push_back(aPointList);
}
-int OpenGLRender::RenderPieSegment2DShape(float fSize, float fPosX, float fPosY)
+void OpenGLRender::RenderPieSegment2DShape(float fSize, float fPosX, float fPosY)
{
int listNum = m_PieSegment2DShapePointList.size();
PosVecf3 const trans = {fPosX, fPosY, 0.0f};
@@ -975,10 +966,9 @@ int OpenGLRender::RenderPieSegment2DShape(float fSize, float fPosX, float fPosY)
m_fZStep += Z_STEP;
CHECK_GL_ERROR();
- return 0;
}
-int OpenGLRender::RenderSymbol2DShape(float x, float y, sal_Int32 nSymbol)
+void OpenGLRender::RenderSymbol2DShape(float x, float y, sal_Int32 nSymbol)
{
CHECK_GL_ERROR();
@@ -1028,7 +1018,6 @@ int OpenGLRender::RenderSymbol2DShape(float x, float y, sal_Int32 nSymbol)
m_fZStep += Z_STEP;
CHECK_GL_ERROR();
- return 0;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/view/main/OpenGLRender.hxx b/chart2/source/view/main/OpenGLRender.hxx
index b222a40f6647..3b9d8700c3ce 100644
--- a/chart2/source/view/main/OpenGLRender.hxx
+++ b/chart2/source/view/main/OpenGLRender.hxx
@@ -67,24 +67,24 @@ public:
OpenGLRender();
~OpenGLRender();
int InitOpenGL();
- int MoveModelf(const PosVecf3& trans, const PosVecf3& angle, const PosVecf3& scale);
+ void MoveModelf(const PosVecf3& trans, const PosVecf3& angle, const PosVecf3& scale);
void SetSize(int width, int height);
void SetSizePixel(int width, int height);
void Release();
int RenderLine2FBO();
- int SetLine2DShapePoint(float x, float y, int listLength);
+ void SetLine2DShapePoint(float x, float y, int listLength);
void SetLine2DColor(sal_uInt8 r, sal_uInt8 g, sal_uInt8 b, sal_uInt8 nAlpha);
void SetLine2DWidth(int width);
void SetColor(sal_uInt32 color, sal_uInt8 nAlpha);
- int Bubble2DShapePoint(float x, float y, float directionX, float directionY);
+ void Bubble2DShapePoint(float x, float y, float directionX, float directionY);
int RenderBubble2FBO();
void prepareToRender();
- int RenderRectangleShape(bool bBorder, bool bFill);
- int RectangleShapePoint(float x, float y, float directionX, float directionY);
+ void RenderRectangleShape(bool bBorder, bool bFill);
+ void RectangleShapePoint(float x, float y, float directionX, float directionY);
- int CreateTextTexture(const boost::shared_array<sal_uInt8> &rPixels,
+ void CreateTextTexture(const boost::shared_array<sal_uInt8> &rPixels,
const ::Size &aPixelSize,
const css::awt::Size& aSize,
long rotation,
@@ -92,16 +92,16 @@ public:
int CreateTextTexture(const BitmapEx& rBitmapEx,
const css::awt::Size& aSize,
long rotation, const css::drawing::HomogenMatrix3& rTrans);
- int RenderTextShape();
+ void RenderTextShape();
- int SetArea2DShapePoint(float x, float y, int listLength);
- int RenderArea2DShape();
+ void SetArea2DShapePoint(float x, float y, int listLength);
+ void RenderArea2DShape();
void SetChartTransparencyGradient(long transparencyGradient);
void GeneratePieSegment2D(double, double, double, double);
- int RenderPieSegment2DShape(float, float, float);
+ void RenderPieSegment2DShape(float, float, float);
- int RenderSymbol2DShape(float, float, sal_Int32);
+ void RenderSymbol2DShape(float, float, sal_Int32);
#if DEBUG_POSITIONING
void renderDebug();
#endif