diff options
author | Takeshi Abe <tabe@fixedpoint.jp> | 2016-05-09 12:36:41 +0900 |
---|---|---|
committer | Takeshi Abe <tabe@fixedpoint.jp> | 2016-05-10 01:00:26 +0000 |
commit | 65b327b873e67ae24133b6e4afef5e8a12ed822e (patch) | |
tree | 5448750afc79dca32bda3c1976a3d8da1451d323 /starmath | |
parent | c550c3eba08ef74f47bebe792a16791161006bcb (diff) |
Simplify code with ForEachNonNull
Change-Id: Id149ecee4fa7737b529f3a3a19bb4bb9ed778dcd
Reviewed-on: https://gerrit.libreoffice.org/24778
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Takeshi Abe <tabe@fixedpoint.jp>
Diffstat (limited to 'starmath')
-rw-r--r-- | starmath/source/node.cxx | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx index b0cecfab4aca..1104196b099f 100644 --- a/starmath/source/node.cxx +++ b/starmath/source/node.cxx @@ -448,17 +448,13 @@ SmNode * SmStructureNode::GetSubNode(sal_uInt16 nIndex) void SmStructureNode::GetAccessibleText( OUStringBuffer &rText ) const { - sal_uInt16 nNodes = GetNumSubNodes(); - for (sal_uInt16 i = 0; i < nNodes; ++i) - { - SmNode *pNode = const_cast<SmStructureNode *>(this)->GetSubNode(i); - if (pNode) + ForEachNonNull(const_cast<SmStructureNode *>(this), + [&rText](SmNode *pNode) { if (pNode->IsVisible()) static_cast<SmStructureNode *>(pNode)->mnAccIndex = rText.getLength(); pNode->GetAccessibleText( rText ); - } - } + }); } |