diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-08-12 12:29:40 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-08-12 13:48:21 +0100 |
commit | 197c4320aeb6f29e7de15dfc1b8d8ad5ce89b0b3 (patch) | |
tree | a314ca5af1050f5875dc60f847711a737f21eec7 /starmath | |
parent | b472ba671ab4e388786a109ac61823e0f7290cd4 (diff) |
cppcheck: variableScope
Change-Id: Ibb70de22f566c103af7a1f075252ae38da1742b2
Diffstat (limited to 'starmath')
-rw-r--r-- | starmath/source/node.cxx | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx index f8a7ae1a25ce..31ee52a6b050 100644 --- a/starmath/source/node.cxx +++ b/starmath/source/node.cxx @@ -498,11 +498,13 @@ void SmNode::DumpAsDot(std::ostream &out, OUString* label, int number, int& id, //Dump subnodes int myid = id; - const SmNode *pNode; sal_uInt16 nSize = GetNumSubNodes(); for (sal_uInt16 i = 0; i < nSize; i++) - if (NULL != (pNode = GetSubNode(i))) + { + const SmNode *pNode = GetSubNode(i); + if (pNode) pNode->DumpAsDot(out, NULL, i, ++id, myid); + } //If this is the root end the file if( number == -1 ) @@ -641,25 +643,20 @@ SmNode * SmVisibleNode::GetSubNode(sal_uInt16 /*nIndex*/) return NULL; } - - - void SmGraphicNode::GetAccessibleText( OUStringBuffer &rText ) const { rText.append(GetToken().aText); } - - - void SmExpressionNode::CreateTextFromNode(OUString &rText) { - SmNode *pNode; sal_uInt16 nSize = GetNumSubNodes(); if (nSize > 1) rText += "{"; for (sal_uInt16 i = 0; i < nSize; i++) - if (NULL != (pNode = GetSubNode(i))) + { + SmNode *pNode = GetSubNode(i); + if (pNode) { pNode->CreateTextFromNode(rText); //Just a bit of foo to make unary +asd -asd +-asd -+asd look nice @@ -668,6 +665,7 @@ void SmExpressionNode::CreateTextFromNode(OUString &rText) ( !rText.endsWith("+") && !rText.endsWith("-") )) rText += " "; } + } if (nSize > 1) { @@ -676,9 +674,6 @@ void SmExpressionNode::CreateTextFromNode(OUString &rText) } } - - - void SmTableNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat) // arranges all subnodes in one column { @@ -736,7 +731,6 @@ void SmTableNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat) } } - SmNode * SmTableNode::GetLeftMost() { return this; |