include/basegfx/matrix/hommatrixtemplate.hxx | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-)
New commits: commit a04fa4ad1dcfc6b7c2a13d9c5326757a1948ed4e Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Tue May 16 09:52:25 2023 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Tue May 16 15:12:34 2023 +0200 simplify ImplMatLine constructor Change-Id: I20998c99b46418f29c12cbf43787ccd17dfd75f3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151828 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/include/basegfx/matrix/hommatrixtemplate.hxx b/include/basegfx/matrix/hommatrixtemplate.hxx index e31c522c7711..c40853b4247e 100644 --- a/include/basegfx/matrix/hommatrixtemplate.hxx +++ b/include/basegfx/matrix/hommatrixtemplate.hxx @@ -45,18 +45,16 @@ namespace basegfx::internal { } - explicit ImplMatLine(sal_uInt16 nRow, ImplMatLine< RowSize >* pToBeCopied) + explicit ImplMatLine(const ImplMatLine< RowSize >& rToBeCopied) { - if(pToBeCopied) - { - memcpy(&mfValue, pToBeCopied, sizeof(double) * RowSize); - } - else + memcpy(&mfValue, &rToBeCopied, sizeof(double) * RowSize); + } + + explicit ImplMatLine(sal_uInt16 nRow) + { + for(sal_uInt16 a(0); a < RowSize; a++) { - for(sal_uInt16 a(0); a < RowSize; a++) - { - mfValue[a] = implGetDefaultValue(nRow, a); - } + mfValue[a] = implGetDefaultValue(nRow, a); } } @@ -128,7 +126,7 @@ namespace basegfx::internal mpLine.reset(); if(rToBeCopied.mpLine) { - mpLine.reset( new ImplMatLine< RowSize >((RowSize - 1), rToBeCopied.mpLine.get()) ); + mpLine.reset( new ImplMatLine< RowSize >( *rToBeCopied.mpLine ) ); } } return *this; @@ -167,7 +165,7 @@ namespace basegfx::internal if(!::basegfx::fTools::equal(fDefault, rValue)) { - mpLine.reset(new ImplMatLine< RowSize >((RowSize - 1), nullptr)); + mpLine.reset(new ImplMatLine< RowSize >((RowSize - 1))); mpLine->set(nColumn, rValue); } }