diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-10-19 14:02:04 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-10-20 13:48:17 +0200 |
commit | a43712a9232eea1a439be95e8a30ee833dd4bff4 (patch) | |
tree | 587f738fa31d336e09ac11b9a1995ddd99c1ba18 /basegfx | |
parent | d585e572b5d4fc7113c0d0380f16427c1e3448d8 (diff) |
check for self assign
Change-Id: I1d8ae37c3f3fc41d5ec65bb246e891d76f7ff544
Reviewed-on: https://gerrit.libreoffice.org/62006
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'basegfx')
-rw-r--r-- | basegfx/source/inc/hommatrixtemplate.hxx | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/basegfx/source/inc/hommatrixtemplate.hxx b/basegfx/source/inc/hommatrixtemplate.hxx index b7106f6fb22d..667e7ecdb3b0 100644 --- a/basegfx/source/inc/hommatrixtemplate.hxx +++ b/basegfx/source/inc/hommatrixtemplate.hxx @@ -119,14 +119,17 @@ namespace basegfx ImplHomMatrixTemplate& operator=(const ImplHomMatrixTemplate& rToBeCopied) { - // complete initialization using copy - for(sal_uInt16 a(0); a < (RowSize - 1); a++) + if (this != &rToBeCopied) { - memcpy(&maLine[a], &rToBeCopied.maLine[a], sizeof(ImplMatLine< RowSize >)); - } - if(rToBeCopied.mpLine) - { - mpLine.reset( new ImplMatLine< RowSize >((RowSize - 1), rToBeCopied.mpLine.get()) ); + // complete initialization using copy + for(sal_uInt16 a(0); a < (RowSize - 1); a++) + { + memcpy(&maLine[a], &rToBeCopied.maLine[a], sizeof(ImplMatLine< RowSize >)); + } + if(rToBeCopied.mpLine) + { + mpLine.reset( new ImplMatLine< RowSize >((RowSize - 1), rToBeCopied.mpLine.get()) ); + } } return *this; } |