diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2012-06-15 23:39:27 +0200 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2012-06-15 23:39:27 +0200 |
commit | 6bd252598ca662b909afefb133c63a4f7f4b6e84 (patch) | |
tree | d3585e8bd293fddf4017db324386bb64afabde88 | |
parent | b53f31e4615740c676621680312334aba7397933 (diff) |
For the moment no more cppcheck reports
-rw-r--r-- | src/lib/VSDSVGGenerator.cpp | 3 | ||||
-rw-r--r-- | src/lib/VSDStringVector.cpp | 3 | ||||
-rw-r--r-- | src/lib/VSDXCharacterList.h | 2 | ||||
-rw-r--r-- | src/lib/VSDXContentCollector.cpp | 6 | ||||
-rw-r--r-- | src/lib/VSDXFieldList.h | 2 | ||||
-rw-r--r-- | src/lib/VSDXGeometryList.h | 2 | ||||
-rw-r--r-- | src/lib/VSDXParagraphList.h | 2 | ||||
-rw-r--r-- | src/lib/VSDXShapeList.h | 2 |
8 files changed, 12 insertions, 10 deletions
diff --git a/src/lib/VSDSVGGenerator.cpp b/src/lib/VSDSVGGenerator.cpp index 26754e3..b39779a 100644 --- a/src/lib/VSDSVGGenerator.cpp +++ b/src/lib/VSDSVGGenerator.cpp @@ -507,7 +507,6 @@ void libvisio::VSDSVGGenerator::startTextObject(const ::WPXPropertyList &propLis { double x = 0.0; double y = 0.0; - double width = 0.0; double height = 0.0; m_outputSink << "<svg:text "; if (propList["svg:x"] && propList["svg:y"]) @@ -521,7 +520,7 @@ void libvisio::VSDSVGGenerator::startTextObject(const ::WPXPropertyList &propLis if (propList["svg:width"]) { - width = propList["svg:width"]->getDouble(); + double width = propList["svg:width"]->getDouble(); xmiddle += width / 2.0; } diff --git a/src/lib/VSDStringVector.cpp b/src/lib/VSDStringVector.cpp index 26bb5cd..ae3a9e0 100644 --- a/src/lib/VSDStringVector.cpp +++ b/src/lib/VSDStringVector.cpp @@ -59,6 +59,9 @@ libvisio::VSDStringVector::~VSDStringVector() libvisio::VSDStringVector &libvisio::VSDStringVector::operator=(const VSDStringVector &vec) { + // Check for self-assignment + if (this == &vec) + return *this; if (m_pImpl) delete m_pImpl; m_pImpl = new VSDStringVectorImpl(*(vec.m_pImpl)); diff --git a/src/lib/VSDXCharacterList.h b/src/lib/VSDXCharacterList.h index bd737c5..734d36f 100644 --- a/src/lib/VSDXCharacterList.h +++ b/src/lib/VSDXCharacterList.h @@ -55,7 +55,7 @@ public: void clear(); bool empty() const { - return (!m_elements.size()); + return (m_elements.empty()); } private: std::map<unsigned, VSDXCharacterListElement *> m_elements; diff --git a/src/lib/VSDXContentCollector.cpp b/src/lib/VSDXContentCollector.cpp index 1e18a5e..cfbd9be 100644 --- a/src/lib/VSDXContentCollector.cpp +++ b/src/lib/VSDXContentCollector.cpp @@ -574,8 +574,6 @@ void libvisio::VSDXContentCollector::_flushCurrentPath() fillPathProps.insert("draw:stroke", "none"); WPXPropertyList linePathProps(m_styleProps); linePathProps.insert("draw:fill", "none"); - bool firstPoint = true; - bool wasMove = false; bool needsGroup = true; if (!m_styleProps["draw:fill"] || m_styleProps["draw:fill"]->getStr() == "none") @@ -592,6 +590,8 @@ void libvisio::VSDXContentCollector::_flushCurrentPath() if (m_styleProps["draw:fill"] && m_styleProps["draw:fill"]->getStr() != "none") { + bool firstPoint = true; + bool wasMove = false; for (unsigned i = 0; i < m_currentFillGeometry.size(); i++) { if (firstPoint) @@ -2004,7 +2004,7 @@ void libvisio::VSDXContentCollector::collectSplineKnot(unsigned /* id */, unsign void libvisio::VSDXContentCollector::collectSplineEnd() { - if (!m_splineKnotVector.size() || !m_splineControlPoints.size()) + if (m_splineKnotVector.empty() || m_splineControlPoints.empty()) { m_splineKnotVector.clear(); m_splineControlPoints.clear(); diff --git a/src/lib/VSDXFieldList.h b/src/lib/VSDXFieldList.h index 7a9e9cd..7ae9cd8 100644 --- a/src/lib/VSDXFieldList.h +++ b/src/lib/VSDXFieldList.h @@ -119,7 +119,7 @@ public: } bool empty() const { - return (!m_elements.size()); + return (m_elements.empty()); } VSDXFieldListElement *getElement(unsigned index); private: diff --git a/src/lib/VSDXGeometryList.h b/src/lib/VSDXGeometryList.h index 3d53816..af96a38 100644 --- a/src/lib/VSDXGeometryList.h +++ b/src/lib/VSDXGeometryList.h @@ -66,7 +66,7 @@ public: void clear(); bool empty() const { - return (!m_elements.size()); + return (m_elements.empty()); } VSDXGeometryListElement *getElement(unsigned index) const; std::vector<unsigned> getElementsOrder() const diff --git a/src/lib/VSDXParagraphList.h b/src/lib/VSDXParagraphList.h index dd1c893..1df29ec 100644 --- a/src/lib/VSDXParagraphList.h +++ b/src/lib/VSDXParagraphList.h @@ -55,7 +55,7 @@ public: void clear(); bool empty() const { - return (!m_elements.size()); + return (m_elements.empty()); } private: std::map<unsigned, VSDXParagraphListElement *> m_elements; diff --git a/src/lib/VSDXShapeList.h b/src/lib/VSDXShapeList.h index 6bb6967..17ae708 100644 --- a/src/lib/VSDXShapeList.h +++ b/src/lib/VSDXShapeList.h @@ -50,7 +50,7 @@ public: void clear(); bool empty() const { - return (!m_elements.size()); + return (m_elements.empty()); } private: std::map<unsigned, VSDXShapeListElement *> m_elements; |