summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2012-06-30 16:16:55 +0200
committerDavid Tardon <dtardon@redhat.com>2012-06-30 16:16:55 +0200
commit5cdf1b038052e2483425ef8d1761a98042432623 (patch)
tree69b8ddf2e501ffbe58cefd770493e7851c042e6b
parenteb391d7ff19b18e2b020a4d20760f94a8e0600df (diff)
coverity: protect against self-assignment
-rw-r--r--src/lib/VSDXPages.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/lib/VSDXPages.cpp b/src/lib/VSDXPages.cpp
index 12c6c0b..178ba9b 100644
--- a/src/lib/VSDXPages.cpp
+++ b/src/lib/VSDXPages.cpp
@@ -51,11 +51,14 @@ libvisio::VSDXPage::~VSDXPage()
libvisio::VSDXPage &libvisio::VSDXPage::operator=(const libvisio::VSDXPage &page)
{
- m_pageWidth = page.m_pageWidth;
- m_pageHeight = page.m_pageHeight;
- m_currentPageID = page.m_currentPageID;
- m_backgroundPageID = page.m_backgroundPageID;
- m_pageElements = page.m_pageElements;
+ if (this == &page)
+ {
+ m_pageWidth = page.m_pageWidth;
+ m_pageHeight = page.m_pageHeight;
+ m_currentPageID = page.m_currentPageID;
+ m_backgroundPageID = page.m_backgroundPageID;
+ m_pageElements = page.m_pageElements;
+ }
return *this;
}