diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2012-08-29 20:50:44 +0200 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2012-08-29 20:50:44 +0200 |
commit | ae3fdb9148627b62f08d68690785fc764065a57b (patch) | |
tree | 147d974f34f8b4cc05fd9b897eee9335df4e0538 | |
parent | 6298807d48b594a63e024d19a40cfaf284fe7042 (diff) |
Some cppcheck cleaning
-rw-r--r-- | src/lib/MSPUBParser.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/lib/MSPUBParser.cpp b/src/lib/MSPUBParser.cpp index e7e3d46..88098d7 100644 --- a/src/lib/MSPUBParser.cpp +++ b/src/lib/MSPUBParser.cpp @@ -345,7 +345,7 @@ bool libmspub::MSPUBParser::parseContents(WPXInputStream *input) } else(skipBlock(input, m_blockInfo.back())); } - if (m_contentChunks.size() > 0) + if (!m_contentChunks.empty()) { m_contentChunks.back().end = trailerPart.dataOffset + trailerPart.dataLength; } @@ -647,9 +647,6 @@ bool libmspub::MSPUBParser::parseShape(WPXInputStream *input, unsigned height = 0; bool isTable = chunk.type == TABLE; bool isGroup = chunk.type == GROUP || chunk.type == LOGO; - bool isText = false; - bool shouldStretchBorderArt = true; - unsigned textId = 0; if (isTable) { boost::optional<unsigned> cellsSeqNum; @@ -763,6 +760,9 @@ bool libmspub::MSPUBParser::parseShape(WPXInputStream *input, } else { + bool isText = false; + bool shouldStretchBorderArt = true; + unsigned textId = 0; while (stillReading(input, pos + length)) { libmspub::MSPUBBlockInfo info = parseBlock(input, true); @@ -1487,9 +1487,9 @@ void libmspub::MSPUBParser::parseEscherShape(WPXInputStream *input, const Escher anchorTypes.insert(OFFICE_ART_CLIENT_ANCHOR); anchorTypes.insert(OFFICE_ART_CHILD_ANCHOR); bool foundAnchor; - bool rotated90 = false; if ((foundAnchor = findEscherContainerWithTypeInSet(input, sp, cAnchor, anchorTypes)) || isGroupLeader) { + bool rotated90 = false; MSPUB_DEBUG_MSG(("Found Escher data for %s of seqnum 0x%x\n", isGroupLeader ? "group" : "shape", *shapeSeqNum)); boost::optional<std::map<unsigned short, unsigned> > maybe_tertiaryFoptValues; input->seek(sp.contentsOffset, WPX_SEEK_SET); @@ -1741,7 +1741,7 @@ void libmspub::MSPUBParser::parseEscherShape(WPXInputStream *input, const Escher } const std::vector<unsigned char> vertexData = foptValues.m_complexValues[FIELDID_P_VERTICES]; - if (vertexData.size() > 0) + if (!vertexData.empty()) { unsigned *p_geoRight = getIfExists(foptValues.m_scalarValues, FIELDID_GEO_RIGHT); |