summaryrefslogtreecommitdiff
path: root/dbaccess/source/ui/browser/genericcontroller.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'dbaccess/source/ui/browser/genericcontroller.cxx')
-rw-r--r--dbaccess/source/ui/browser/genericcontroller.cxx42
1 files changed, 18 insertions, 24 deletions
diff --git a/dbaccess/source/ui/browser/genericcontroller.cxx b/dbaccess/source/ui/browser/genericcontroller.cxx
index 8bde54b54549..189432f70abf 100644
--- a/dbaccess/source/ui/browser/genericcontroller.cxx
+++ b/dbaccess/source/ui/browser/genericcontroller.cxx
@@ -177,20 +177,20 @@ void SAL_CALL OGenericUnoController::initialize( const Sequence< Any >& aArgumen
Reference< XFrame > xFrame;
- PropertyValue aValue;
- const Any* pIter = aArguments.getConstArray();
- const Any* pEnd = pIter + aArguments.getLength();
-
- for ( ; pIter != pEnd; ++pIter )
+ for (auto& arg : aArguments)
{
- if ( ( *pIter >>= aValue ) && aValue.Name == "Frame" )
- {
- xFrame.set(aValue.Value,UNO_QUERY_THROW);
- }
- else if ( ( *pIter >>= aValue ) && aValue.Name == "Preview" )
+ PropertyValue aValue;
+ if (arg >>= aValue)
{
- aValue.Value >>= m_bPreview;
- m_bReadOnly = true;
+ if (aValue.Name == "Frame")
+ {
+ xFrame.set(aValue.Value, UNO_QUERY_THROW);
+ }
+ else if (aValue.Name == "Preview")
+ {
+ aValue.Value >>= m_bPreview;
+ m_bReadOnly = true;
+ }
}
}
try
@@ -542,19 +542,13 @@ Reference< XDispatch > OGenericUnoController::queryDispatch(const URL& aURL, co
Sequence< Reference< XDispatch > > OGenericUnoController::queryDispatches(const Sequence< DispatchDescriptor >& aDescripts)
{
- Sequence< Reference< XDispatch > > aReturn;
- sal_Int32 nLen = aDescripts.getLength();
- if ( nLen )
+ Sequence< Reference< XDispatch > > aReturn(aDescripts.getLength());
+ if (aDescripts.hasElements())
{
- aReturn.realloc( nLen );
- Reference< XDispatch >* pReturn = aReturn.getArray();
- const Reference< XDispatch >* pReturnEnd = aReturn.getArray() + nLen;
- const DispatchDescriptor* pDescripts = aDescripts.getConstArray();
-
- for ( ; pReturn != pReturnEnd; ++ pReturn, ++pDescripts )
- {
- *pReturn = queryDispatch( pDescripts->FeatureURL, pDescripts->FrameName, pDescripts->SearchFlags );
- }
+ std::transform(aDescripts.begin(), aDescripts.end(), aReturn.getArray(),
+ [this](auto& desc) {
+ return queryDispatch(desc.FeatureURL, desc.FrameName, desc.SearchFlags);
+ });
}
return aReturn;