summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-04-11 09:43:53 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-04-11 10:33:05 +0200
commit4e162517869c811c06242bb8eb08001dfcf3b714 (patch)
treeee27a784c3dbb3f9cde25beb8ce643a872e712a8
parent25e92d7f7c915e26febd8c868a6531d99aac30cd (diff)
loplugin:inlinefields in ScJumpMatrix
Change-Id: I8fea7185c6ccd1c023835da41ab184351d5cac01 Reviewed-on: https://gerrit.libreoffice.org/36403 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--sc/source/core/inc/jumpmatrix.hxx4
-rw-r--r--sc/source/core/tool/jumpmatrix.cxx9
2 files changed, 6 insertions, 7 deletions
diff --git a/sc/source/core/inc/jumpmatrix.hxx b/sc/source/core/inc/jumpmatrix.hxx
index 4ef4f87b282a..94b8dc1737aa 100644
--- a/sc/source/core/inc/jumpmatrix.hxx
+++ b/sc/source/core/inc/jumpmatrix.hxx
@@ -45,7 +45,7 @@ struct ScJumpMatrixEntry
nNext = nNextP;
nStop = nStopP;
}
- void GetJump( double& rBool, short& rStart, short& rNext, short& rStop )
+ void GetJump( double& rBool, short& rStart, short& rNext, short& rStop ) const
{
rBool = fBool;
rStart = nStart;
@@ -56,7 +56,7 @@ struct ScJumpMatrixEntry
class ScJumpMatrix
{
- ScJumpMatrixEntry* pJump; // the jumps
+ std::vector<ScJumpMatrixEntry> mvJump; // the jumps
ScMatrixRef pMat; // the results
ScTokenVec* pParams; // parameter stack
SCSIZE nCols;
diff --git a/sc/source/core/tool/jumpmatrix.cxx b/sc/source/core/tool/jumpmatrix.cxx
index 0961e78ff49d..760f89735db6 100644
--- a/sc/source/core/tool/jumpmatrix.cxx
+++ b/sc/source/core/tool/jumpmatrix.cxx
@@ -28,7 +28,7 @@ const SCSIZE kBufferThreshold = 128;
}
ScJumpMatrix::ScJumpMatrix(SCSIZE nColsP, SCSIZE nRowsP)
- : pJump(new ScJumpMatrixEntry[nColsP * nRowsP])
+ : mvJump(nColsP * nRowsP)
, pMat(new ScFullMatrix(nColsP, nRowsP))
, pParams(nullptr)
, nCols(nColsP)
@@ -62,7 +62,6 @@ ScJumpMatrix::~ScJumpMatrix()
}
delete pParams;
}
- delete[] pJump;
}
void ScJumpMatrix::GetDimensions(SCSIZE& rCols, SCSIZE& rRows) const
@@ -74,7 +73,7 @@ void ScJumpMatrix::GetDimensions(SCSIZE& rCols, SCSIZE& rRows) const
void ScJumpMatrix::SetJump(SCSIZE nCol, SCSIZE nRow, double fBool,
short nStart, short nNext)
{
- pJump[(sal_uLong)nCol * nRows + nRow].SetJump(fBool, nStart, nNext, SHRT_MAX);
+ mvJump[(sal_uLong)nCol * nRows + nRow].SetJump(fBool, nStart, nNext, SHRT_MAX);
}
void ScJumpMatrix::GetJump(
@@ -93,7 +92,7 @@ void ScJumpMatrix::GetJump(
nCol = 0;
nRow = 0;
}
- pJump[(sal_uLong)nCol * nRows + nRow].
+ mvJump[(sal_uLong)nCol * nRows + nRow].
GetJump(rBool, rStart, rNext, rStop);
}
@@ -102,7 +101,7 @@ void ScJumpMatrix::SetAllJumps(double fBool, short nStart, short nNext, short nS
sal_uLong n = (sal_uLong)nCols * nRows;
for (sal_uLong j = 0; j < n; ++j)
{
- pJump[j].SetJump(fBool, nStart,
+ mvJump[j].SetJump(fBool, nStart,
nNext, nStop);
}
}