summaryrefslogtreecommitdiff
path: root/toolkit
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-08-15 15:01:55 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-08-15 20:23:50 +0200
commit2dfb192edfd1ab10e9d39e265e26ac6db93ac755 (patch)
tree2b8faf5b57cfeb9ceb636783406caf64694a0ff9 /toolkit
parent3c6cb83b80b502975dce89c02401a064872b5ea3 (diff)
loplugin:sequenceloop in test..toolkit
Change-Id: Ic8dad06c535b0af713bfe7cd46e601c8ea7ba6c7 Reviewed-on: https://gerrit.libreoffice.org/77531 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'toolkit')
-rw-r--r--toolkit/source/awt/vclxtoolkit.cxx4
-rw-r--r--toolkit/source/awt/vclxwindow1.cxx2
-rw-r--r--toolkit/source/awt/vclxwindows.cxx4
-rw-r--r--toolkit/source/controls/controlmodelcontainerbase.cxx10
-rw-r--r--toolkit/source/controls/dialogcontrol.cxx4
-rw-r--r--toolkit/source/controls/geometrycontrolmodel.cxx4
-rw-r--r--toolkit/source/controls/stdtabcontroller.cxx4
-rw-r--r--toolkit/source/controls/tabpagecontainer.cxx2
-rw-r--r--toolkit/source/controls/tabpagemodel.cxx2
-rw-r--r--toolkit/source/controls/unocontrolcontainer.cxx4
-rw-r--r--toolkit/source/controls/unocontrolmodel.cxx4
-rw-r--r--toolkit/source/helper/vclunohelper.cxx2
12 files changed, 23 insertions, 23 deletions
diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx
index 9505a6e907db..b385ce385958 100644
--- a/toolkit/source/awt/vclxtoolkit.cxx
+++ b/toolkit/source/awt/vclxtoolkit.cxx
@@ -1414,7 +1414,7 @@ vcl::Window* VCLXToolkit::ImplCreateWindow( VCLXWindow** ppNewComp,
css::uno::Sequence< css::beans::NamedValue > aProps;
if( anyHandle >>= aProps )
{
- for( const css::beans::NamedValue& rProp : aProps )
+ for( const css::beans::NamedValue& rProp : std::as_const(aProps) )
{
if ( rProp.Name == "WINDOW" )
rProp.Value >>= nWindowHandle;
@@ -1647,7 +1647,7 @@ css::uno::Reference< css::awt::XWindowPeer > VCLXToolkit::createSystemChild( con
css::uno::Sequence< css::beans::NamedValue > aProps;
if( Parent >>= aProps )
{
- for( const css::beans::NamedValue& rProp : aProps )
+ for( const css::beans::NamedValue& rProp : std::as_const(aProps) )
{
if ( rProp.Name == "WINDOW" )
rProp.Value >>= nWindowHandle;
diff --git a/toolkit/source/awt/vclxwindow1.cxx b/toolkit/source/awt/vclxwindow1.cxx
index 16f696a1c138..8b0cbe1320b3 100644
--- a/toolkit/source/awt/vclxwindow1.cxx
+++ b/toolkit/source/awt/vclxwindow1.cxx
@@ -55,7 +55,7 @@ void VCLXWindow::SetSystemParent_Impl( const css::uno::Any& rHandle )
css::uno::Sequence< css::beans::NamedValue > aProps;
if( rHandle >>= aProps )
{
- for( const css::beans::NamedValue& rProp : aProps )
+ for( const css::beans::NamedValue& rProp : std::as_const(aProps) )
{
if ( rProp.Name == "WINDOW" )
rProp.Value >>= nHandle;
diff --git a/toolkit/source/awt/vclxwindows.cxx b/toolkit/source/awt/vclxwindows.cxx
index 8d96999406a3..d03331a5876f 100644
--- a/toolkit/source/awt/vclxwindows.cxx
+++ b/toolkit/source/awt/vclxwindows.cxx
@@ -2155,7 +2155,7 @@ void SAL_CALL VCLXListBox::itemListChanged( const EventObject& i_rEvent )
Reference< XItemList > xItemList( i_rEvent.Source, uno::UNO_QUERY_THROW );
- uno::Sequence< beans::Pair< OUString, OUString > > aItems = xItemList->getAllItems();
+ const uno::Sequence< beans::Pair< OUString, OUString > > aItems = xItemList->getAllItems();
for ( const auto& rItem : aItems )
{
OUString aLocalizationKey( rItem.First );
@@ -4615,7 +4615,7 @@ void SAL_CALL VCLXComboBox::itemListChanged( const EventObject& i_rEvent )
Reference< XItemList > xItemList( i_rEvent.Source, uno::UNO_QUERY_THROW );
- uno::Sequence< beans::Pair< OUString, OUString > > aItems = xItemList->getAllItems();
+ const uno::Sequence< beans::Pair< OUString, OUString > > aItems = xItemList->getAllItems();
for ( const auto& rItem : aItems )
{
OUString aLocalizationKey( rItem.First );
diff --git a/toolkit/source/controls/controlmodelcontainerbase.cxx b/toolkit/source/controls/controlmodelcontainerbase.cxx
index e08d8c24e3e8..f81468526b13 100644
--- a/toolkit/source/controls/controlmodelcontainerbase.cxx
+++ b/toolkit/source/controls/controlmodelcontainerbase.cxx
@@ -914,7 +914,7 @@ void ControlModelContainerBase::implUpdateGroupStructure()
maGroups.clear();
- Sequence< Reference< XControlModel > > aControlModels = getControlModels();
+ const Sequence< Reference< XControlModel > > aControlModels = getControlModels();
// in extreme we have as much groups as controls
maGroups.reserve( aControlModels.getLength() );
@@ -1436,7 +1436,7 @@ sal_Bool ControlContainerBase::setModel( const Reference< XControlModel >& rxMod
if ( getModel().is() )
{
- Sequence< Reference< XControl > > aControls = getControls();
+ const Sequence< Reference< XControl > > aControls = getControls();
for ( const Reference< XControl >& rCtrl : aControls )
removeControl( rCtrl );
@@ -1460,7 +1460,7 @@ sal_Bool ControlContainerBase::setModel( const Reference< XControlModel >& rxMod
Reference< XNameAccess > xNA( getModel(), UNO_QUERY );
if ( xNA.is() )
{
- Sequence< OUString > aNames = xNA->getElementNames();
+ const Sequence< OUString > aNames = xNA->getElementNames();
Reference< XControlModel > xCtrlModel;
for( const OUString& rName : aNames )
@@ -1818,7 +1818,7 @@ ControlModelContainerBase::updateUserFormChildren( const Reference< XNameContain
// global list of containers
if ( xProps.is() )
xProps->setPropertyValue( GetPropertyName( BASEPROPERTY_USERFORMCONTAINEES ), uno::makeAny( uno::Reference< XNameContainer >() ) );
- Sequence< OUString > aChildNames = xChildContainer->getElementNames();
+ const Sequence< OUString > aChildNames = xChildContainer->getElementNames();
for ( const auto& rName : aChildNames )
updateUserFormChildren( xAllChildren, rName, Operation, Reference< XControlModel > () );
}
@@ -1834,7 +1834,7 @@ ControlModelContainerBase::updateUserFormChildren( const Reference< XNameContain
Reference< XPropertySet > xProps( xChildContainer, UNO_QUERY );
if ( xProps.is() )
xProps->setPropertyValue( GetPropertyName( BASEPROPERTY_USERFORMCONTAINEES ), uno::makeAny( xAllChildren ) );
- Sequence< OUString > aChildNames = xChildContainer->getElementNames();
+ const Sequence< OUString > aChildNames = xChildContainer->getElementNames();
for ( const auto& rName : aChildNames )
{
Reference< XControlModel > xChildTarget( xChildContainer->getByName( rName ), UNO_QUERY );
diff --git a/toolkit/source/controls/dialogcontrol.cxx b/toolkit/source/controls/dialogcontrol.cxx
index dede0319d66d..e67f33bef885 100644
--- a/toolkit/source/controls/dialogcontrol.cxx
+++ b/toolkit/source/controls/dialogcontrol.cxx
@@ -210,7 +210,7 @@ UnoControlDialogModel::UnoControlDialogModel( const UnoControlDialogModel& rMode
Reference< XNameContainer > xSrcNameCont( const_cast< UnoControlDialogModel& >(rModel).getPropertyValue( GetPropertyName( BASEPROPERTY_USERFORMCONTAINEES ) ), UNO_QUERY );
Reference<XNameContainer > xNameCont( new SimpleNamedThingContainer< XControlModel > );
- uno::Sequence< OUString > sNames = xSrcNameCont->getElementNames();
+ const uno::Sequence< OUString > sNames = xSrcNameCont->getElementNames();
for ( OUString const & name : sNames )
{
if ( xSrcNameCont->hasByName( name ) )
@@ -792,7 +792,7 @@ void UnoMultiPageControl::createPeer( const Reference< XToolkit > & rxToolkit, c
UnoControlContainer::createPeer( rxToolkit, rParentPeer );
- uno::Sequence< uno::Reference< awt::XControl > > aCtrls = getControls();
+ const uno::Sequence< uno::Reference< awt::XControl > > aCtrls = getControls();
for( const auto& rCtrl : aCtrls )
bindPage( rCtrl );
sal_Int32 nActiveTab(0);
diff --git a/toolkit/source/controls/geometrycontrolmodel.cxx b/toolkit/source/controls/geometrycontrolmodel.cxx
index 38827556bb0b..f47283a0b9e2 100644
--- a/toolkit/source/controls/geometrycontrolmodel.cxx
+++ b/toolkit/source/controls/geometrycontrolmodel.cxx
@@ -400,7 +400,7 @@
Reference< XNameContainer > xEventCont = xEventsSupplier->getEvents();
Reference< XNameContainer > xCloneEventCont = xCloneEventsSupplier->getEvents();
- css::uno::Sequence< OUString > aNames =
+ const css::uno::Sequence< OUString > aNames =
xEventCont->getElementNames();
for( const OUString& aName : aNames )
@@ -533,7 +533,7 @@
);
// now loop through our own props
- for ( const Property& rProp : aProps )
+ for ( const Property& rProp : std::as_const(aProps) )
{
// look for the current property in the properties of our aggregate
const Property* pAggPropPos = ::std::find_if( aAggregateProps.begin(), aAggregateProps.end(), PropertyNameEqual( rProp.Name ) );
diff --git a/toolkit/source/controls/stdtabcontroller.cxx b/toolkit/source/controls/stdtabcontroller.cxx
index 6d0bc4621809..3eba0ee86288 100644
--- a/toolkit/source/controls/stdtabcontroller.cxx
+++ b/toolkit/source/controls/stdtabcontroller.cxx
@@ -96,7 +96,7 @@ bool StdTabController::ImplCreateComponentSequence(
}
bool bOK = true;
- for ( const Reference< XControl >& xCtrl : rControls )
+ for ( const Reference< XControl >& xCtrl : std::as_const(rControls) )
{
// Get the matching control for this model
if ( !xCtrl.is() )
@@ -259,7 +259,7 @@ void StdTabController::autoTabOrder( )
// insert sort algorithm
std::vector< ComponentEntry > aCtrls;
aCtrls.reserve(nCtrls);
- for ( const Reference< XWindow >& rComponent : aCompSeq )
+ for ( const Reference< XWindow >& rComponent : std::as_const(aCompSeq) )
{
XWindow* pC = rComponent.get();
ComponentEntry newEntry;
diff --git a/toolkit/source/controls/tabpagecontainer.cxx b/toolkit/source/controls/tabpagecontainer.cxx
index f488687f5d75..2a67e44e756b 100644
--- a/toolkit/source/controls/tabpagecontainer.cxx
+++ b/toolkit/source/controls/tabpagecontainer.cxx
@@ -308,7 +308,7 @@ void UnoControlTabPageContainer::updateFromModel()
ContainerEvent aEvent;
aEvent.Source = getModel();
- Sequence< Reference< XControl > > aControls = getControls();
+ const Sequence< Reference< XControl > > aControls = getControls();
for ( const Reference< XControl >& rCtrl : aControls )
{
diff --git a/toolkit/source/controls/tabpagemodel.cxx b/toolkit/source/controls/tabpagemodel.cxx
index 7d0ff366ba73..27e2f3342c94 100644
--- a/toolkit/source/controls/tabpagemodel.cxx
+++ b/toolkit/source/controls/tabpagemodel.cxx
@@ -130,7 +130,7 @@ void SAL_CALL UnoControlTabPageModel::initialize (const Sequence<Any>& rArgument
Reference<container::XNameContainer > xDialogModel = awt::UnoControlDialogModelProvider::create( m_xContext, sURL );
if ( xDialogModel.is() )
{
- Sequence< OUString> aNames = xDialogModel->getElementNames();
+ const Sequence< OUString> aNames = xDialogModel->getElementNames();
for(const OUString& rName : aNames)
{
try
diff --git a/toolkit/source/controls/unocontrolcontainer.cxx b/toolkit/source/controls/unocontrolcontainer.cxx
index 77eb161f8ac9..5b9889a6bb68 100644
--- a/toolkit/source/controls/unocontrolcontainer.cxx
+++ b/toolkit/source/controls/unocontrolcontainer.cxx
@@ -295,7 +295,7 @@ static void implUpdateVisibility
const uno::Reference< awt::XControlContainer >& xControlContainer
)
{
- uno::Sequence< uno::Reference< awt::XControl > >
+ const uno::Sequence< uno::Reference< awt::XControl > >
aCtrls = xControlContainer->getControls();
bool bCompleteVisible = (nDialogStep == 0);
for( const uno::Reference< awt::XControl >& xControl : aCtrls )
@@ -406,7 +406,7 @@ void UnoControlContainer::dispose( )
maCListeners.disposeAndClear( aDisposeEvent );
- uno::Sequence< uno::Reference< awt::XControl > > aCtrls = getControls();
+ const uno::Sequence< uno::Reference< awt::XControl > > aCtrls = getControls();
for( uno::Reference< awt::XControl > const & control : aCtrls )
{
diff --git a/toolkit/source/controls/unocontrolmodel.cxx b/toolkit/source/controls/unocontrolmodel.cxx
index 8a287b710109..8b9b09fe489f 100644
--- a/toolkit/source/controls/unocontrolmodel.cxx
+++ b/toolkit/source/controls/unocontrolmodel.cxx
@@ -344,7 +344,7 @@ css::uno::Any UnoControlModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const
sBankSymbol = aLocaleInfo.getCurrBankSymbol();
// look for the currency entry (for this language) which has the given bank symbol
- Sequence< Currency2 > aAllCurrencies = aLocaleInfo.getAllCurrencies();
+ const Sequence< Currency2 > aAllCurrencies = aLocaleInfo.getAllCurrencies();
OUString sCurrencySymbol = aLocaleInfo.getCurrSymbol();
if ( sBankSymbol.isEmpty() )
@@ -670,7 +670,7 @@ void UnoControlModel::write( const css::uno::Reference< css::io::XObjectOutputSt
rValue >>= aSeq;
long nEntries = aSeq.getLength();
OutStream->writeLong( nEntries );
- for ( const auto& rVal : aSeq )
+ for ( const auto& rVal : std::as_const(aSeq) )
OutStream->writeUTF( rVal );
}
else if ( rType == cppu::UnoType< cppu::UnoSequenceType<cppu::UnoUnsignedShortType> >::get() )
diff --git a/toolkit/source/helper/vclunohelper.cxx b/toolkit/source/helper/vclunohelper.cxx
index 8fe3609f4b14..3e43f81502a8 100644
--- a/toolkit/source/helper/vclunohelper.cxx
+++ b/toolkit/source/helper/vclunohelper.cxx
@@ -133,7 +133,7 @@ vcl::Region VCLUnoHelper::GetRegion( const css::uno::Reference< css::awt::XRegio
aRegion = pVCLRegion->GetRegion();
else
{
- css::uno::Sequence< css::awt::Rectangle > aRects = rxRegion->getRectangles();
+ const css::uno::Sequence< css::awt::Rectangle > aRects = rxRegion->getRectangles();
for ( const auto& rRect : aRects )
aRegion.Union( VCLRectangle( rRect ) );
}