summaryrefslogtreecommitdiff
path: root/scripting/source/basprov/basmethnode.cxx
diff options
context:
space:
mode:
authorArkadiy Illarionov <qarkai@gmail.com>2019-07-27 23:20:29 +0300
committerArkadiy Illarionov <qarkai@gmail.com>2019-07-30 11:16:00 +0200
commit5ba84c3c7080d55d86b8b39db077b6da36cb700a (patch)
treea71491f3d336a314ab63e834bd013f0503be967b /scripting/source/basprov/basmethnode.cxx
parent850693273970be2662cce8f4d2710b3657a02f65 (diff)
Simplify Sequence iterations in scaddins, sccomp, scripting
Use range-based loops, STL and comphelper functions Change-Id: I836422a1c81a3dc9585687ed2e506eb59bb4ec91 Reviewed-on: https://gerrit.libreoffice.org/76484 Tested-by: Jenkins Reviewed-by: Arkadiy Illarionov <qarkai@gmail.com>
Diffstat (limited to 'scripting/source/basprov/basmethnode.cxx')
-rw-r--r--scripting/source/basprov/basmethnode.cxx16
1 files changed, 5 insertions, 11 deletions
diff --git a/scripting/source/basprov/basmethnode.cxx b/scripting/source/basprov/basmethnode.cxx
index a0104f260950..2b950556c9e8 100644
--- a/scripting/source/basprov/basmethnode.cxx
+++ b/scripting/source/basprov/basmethnode.cxx
@@ -205,17 +205,11 @@ namespace basprov
if ( sDocURL.isEmpty() )
{
Sequence < PropertyValue > aProps = xModel->getArgs();
- sal_Int32 nProps = aProps.getLength();
- const PropertyValue* pProps = aProps.getConstArray();
- for ( sal_Int32 i = 0; i < nProps; ++i )
- {
- // TODO: according to MBA the property 'Title' may change in future
- if ( pProps[i].Name == "Title" )
- {
- pProps[i].Value >>= sDocURL;
- break;
- }
- }
+ // TODO: according to MBA the property 'Title' may change in future
+ const PropertyValue* pProp = std::find_if(aProps.begin(), aProps.end(),
+ [](const PropertyValue& rProp) { return rProp.Name == "Title"; });
+ if (pProp != aProps.end())
+ pProp->Value >>= sDocURL;
}
}
}