starmath/source/node.cxx | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-)
New commits: commit 65b327b873e67ae24133b6e4afef5e8a12ed822e Author: Takeshi Abe <t...@fixedpoint.jp> Date: Mon May 9 12:36:41 2016 +0900 Simplify code with ForEachNonNull Change-Id: Id149ecee4fa7737b529f3a3a19bb4bb9ed778dcd Reviewed-on: https://gerrit.libreoffice.org/24778 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Takeshi Abe <t...@fixedpoint.jp> diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx index b0cecfa..1104196 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 ); - } - } + }); } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits