summaryrefslogtreecommitdiff
path: root/include/basegfx/matrix
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2023-05-16 09:52:25 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2023-05-16 15:12:34 +0200
commita04fa4ad1dcfc6b7c2a13d9c5326757a1948ed4e (patch)
treed10b64fd8830da415f87a771a98754243ac427c7 /include/basegfx/matrix
parent511f4f785e6137dda2589e660dc2f1953c914dfd (diff)
simplify ImplMatLine constructor
Change-Id: I20998c99b46418f29c12cbf43787ccd17dfd75f3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151828 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include/basegfx/matrix')
-rw-r--r--include/basegfx/matrix/hommatrixtemplate.hxx22
1 files changed, 10 insertions, 12 deletions
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);
}
}