summaryrefslogtreecommitdiff
path: root/basegfx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-10-19 14:02:04 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-10-20 13:48:17 +0200
commita43712a9232eea1a439be95e8a30ee833dd4bff4 (patch)
tree587f738fa31d336e09ac11b9a1995ddd99c1ba18 /basegfx
parentd585e572b5d4fc7113c0d0380f16427c1e3448d8 (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.hxx17
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;
}