diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-08-15 15:01:55 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-08-15 20:23:50 +0200 |
commit | 2dfb192edfd1ab10e9d39e265e26ac6db93ac755 (patch) | |
tree | 2b8faf5b57cfeb9ceb636783406caf64694a0ff9 | |
parent | 3c6cb83b80b502975dce89c02401a064872b5ea3 (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>
-rw-r--r-- | test/source/beans/xpropertyset.cxx | 2 | ||||
-rw-r--r-- | test/source/sheet/xdatabaserange.cxx | 2 | ||||
-rw-r--r-- | test/source/sheet/xfunctiondescriptions.cxx | 4 | ||||
-rw-r--r-- | test/source/sheet/xsheetcellrangecontainer.cxx | 4 | ||||
-rw-r--r-- | test/source/sheet/xsheetfilterableex.cxx | 2 | ||||
-rw-r--r-- | test/source/sheet/xsheetpagebreak.cxx | 4 | ||||
-rw-r--r-- | test/source/text/textsettings.cxx | 2 | ||||
-rw-r--r-- | toolkit/source/awt/vclxtoolkit.cxx | 4 | ||||
-rw-r--r-- | toolkit/source/awt/vclxwindow1.cxx | 2 | ||||
-rw-r--r-- | toolkit/source/awt/vclxwindows.cxx | 4 | ||||
-rw-r--r-- | toolkit/source/controls/controlmodelcontainerbase.cxx | 10 | ||||
-rw-r--r-- | toolkit/source/controls/dialogcontrol.cxx | 4 | ||||
-rw-r--r-- | toolkit/source/controls/geometrycontrolmodel.cxx | 4 | ||||
-rw-r--r-- | toolkit/source/controls/stdtabcontroller.cxx | 4 | ||||
-rw-r--r-- | toolkit/source/controls/tabpagecontainer.cxx | 2 | ||||
-rw-r--r-- | toolkit/source/controls/tabpagemodel.cxx | 2 | ||||
-rw-r--r-- | toolkit/source/controls/unocontrolcontainer.cxx | 4 | ||||
-rw-r--r-- | toolkit/source/controls/unocontrolmodel.cxx | 4 | ||||
-rw-r--r-- | toolkit/source/helper/vclunohelper.cxx | 2 |
19 files changed, 33 insertions, 33 deletions
diff --git a/test/source/beans/xpropertyset.cxx b/test/source/beans/xpropertyset.cxx index c1638ca0e548..4abb48c44d88 100644 --- a/test/source/beans/xpropertyset.cxx +++ b/test/source/beans/xpropertyset.cxx @@ -273,7 +273,7 @@ void XPropertySet::fillPropsToTest(const uno::Reference<beans::XPropertySetInfo> if (maPropsToTest.initialized) return; - uno::Sequence<beans::Property> aProps = xPropInfo->getProperties(); + const uno::Sequence<beans::Property> aProps = xPropInfo->getProperties(); // some properties should not be changed in a unspecific way. // TODO: Maybe we should mark these properties read-only, instead of diff --git a/test/source/sheet/xdatabaserange.cxx b/test/source/sheet/xdatabaserange.cxx index 756d204ff597..074f4c178338 100644 --- a/test/source/sheet/xdatabaserange.cxx +++ b/test/source/sheet/xdatabaserange.cxx @@ -64,7 +64,7 @@ void XDatabaseRange::testGetSubtotalDescriptor() void XDatabaseRange::testGetSortDescriptor() { uno::Reference< sheet::XDatabaseRange > xDBRange(init("SortDescriptor"), UNO_QUERY_THROW); - uno::Sequence< beans::PropertyValue > xSortDescr = xDBRange->getSortDescriptor(); + const uno::Sequence< beans::PropertyValue > xSortDescr = xDBRange->getSortDescriptor(); for (const beans::PropertyValue& aProp : xSortDescr) { //std::cout << "Prop " << i << " Name: " << OUString(aProp.Name) << std::endl; diff --git a/test/source/sheet/xfunctiondescriptions.cxx b/test/source/sheet/xfunctiondescriptions.cxx index 5c53b52971ac..d8cfd17d28f4 100644 --- a/test/source/sheet/xfunctiondescriptions.cxx +++ b/test/source/sheet/xfunctiondescriptions.cxx @@ -42,7 +42,7 @@ void XFunctionDescriptions::testGetById() OUString aName1; uno::Sequence<beans::PropertyValue> aProps1; CPPUNIT_ASSERT(xFD->getByIndex(nNumber) >>= aProps1); - for (const auto& aProp : aProps1) + for (const auto& aProp : std::as_const(aProps1)) { if (aProp.Name == "Id") aId1 = aProp.Value.get<sal_Int32>(); @@ -53,7 +53,7 @@ void XFunctionDescriptions::testGetById() // fetch the same descriptions by its id sal_Int32 aId2 = 0; OUString aName2; - uno::Sequence<beans::PropertyValue> aProps2 = xFD->getById(aId1); + const uno::Sequence<beans::PropertyValue> aProps2 = xFD->getById(aId1); CPPUNIT_ASSERT_MESSAGE("Received empty FunctionDescriptions from getById()", aProps2.hasElements()); for (const auto& aProp : aProps2) diff --git a/test/source/sheet/xsheetcellrangecontainer.cxx b/test/source/sheet/xsheetcellrangecontainer.cxx index be3c7453a2a0..3dfa1a5eecd9 100644 --- a/test/source/sheet/xsheetcellrangecontainer.cxx +++ b/test/source/sheet/xsheetcellrangecontainer.cxx @@ -42,7 +42,7 @@ void XSheetCellRangeContainer::testAddRemoveRangeAddress() CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to remove CellRangeAddress (count)", cnt - 1, xSCRC->getCount()); - uno::Sequence<table::CellRangeAddress> aAfterRemoveAddr = xSCRC->getRangeAddresses(); + const uno::Sequence<table::CellRangeAddress> aAfterRemoveAddr = xSCRC->getRangeAddresses(); for (auto const& addr : aAfterRemoveAddr) { CPPUNIT_ASSERT_MESSAGE("Unable to remove CellRangeAddress (entry)", aAddr[0] != addr); @@ -71,7 +71,7 @@ void XSheetCellRangeContainer::testAddRemoveRangeAddresses() CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to remove CellRangeAddresses (count)", cnt - 2, xSCRC->getCount()); - uno::Sequence<table::CellRangeAddress> aAfterRemoveAddr = xSCRC->getRangeAddresses(); + const uno::Sequence<table::CellRangeAddress> aAfterRemoveAddr = xSCRC->getRangeAddresses(); for (auto const& addr : aAfterRemoveAddr) { CPPUNIT_ASSERT_MESSAGE("Unable to remove CellRangeAddresses (entry: first)", diff --git a/test/source/sheet/xsheetfilterableex.cxx b/test/source/sheet/xsheetfilterableex.cxx index 46759b224ae3..5730bde11e18 100644 --- a/test/source/sheet/xsheetfilterableex.cxx +++ b/test/source/sheet/xsheetfilterableex.cxx @@ -35,7 +35,7 @@ void XSheetFilterableEx::testCreateFilterDescriptorByObject() uno::Reference<sheet::XSheetFilterDescriptor> xSFD = xSFEx->createFilterDescriptorByObject(xSF); CPPUNIT_ASSERT_MESSAGE("no XSheetFilterDescriptor", xSFD.is()); - uno::Sequence<sheet::TableFilterField> xTFF = xSFD->getFilterFields(); + const uno::Sequence<sheet::TableFilterField> xTFF = xSFD->getFilterFields(); CPPUNIT_ASSERT_MESSAGE("The gained XSheetFilterDescriptor is empty", xTFF.hasElements()); for (const auto& field : xTFF) diff --git a/test/source/sheet/xsheetpagebreak.cxx b/test/source/sheet/xsheetpagebreak.cxx index 656a33a0cb0b..7f96aa3be557 100644 --- a/test/source/sheet/xsheetpagebreak.cxx +++ b/test/source/sheet/xsheetpagebreak.cxx @@ -44,7 +44,7 @@ void XSheetPageBreak::testRemoveAllManualPageBreaks() xSheetPageBreak->removeAllManualPageBreaks(); - uno::Sequence< sheet::TablePageBreakData > xColPageBreak = xSheetPageBreak->getColumnPageBreaks(); + const uno::Sequence< sheet::TablePageBreakData > xColPageBreak = xSheetPageBreak->getColumnPageBreaks(); sal_Int32 manualColPageBreaks = 0; for ( const auto & data : xColPageBreak ) { @@ -54,7 +54,7 @@ void XSheetPageBreak::testRemoveAllManualPageBreaks() CPPUNIT_ASSERT_EQUAL_MESSAGE("Found manual column page break", sal_Int32(0), manualColPageBreaks); - uno::Sequence< sheet::TablePageBreakData > xRowPageBreak = xSheetPageBreak->getRowPageBreaks(); + const uno::Sequence< sheet::TablePageBreakData > xRowPageBreak = xSheetPageBreak->getRowPageBreaks(); sal_Int32 manualRowPageBreaks = 0; for ( const auto & data : xRowPageBreak ) { diff --git a/test/source/text/textsettings.cxx b/test/source/text/textsettings.cxx index 8371ed54c38d..6e64264f0e0f 100644 --- a/test/source/text/textsettings.cxx +++ b/test/source/text/textsettings.cxx @@ -31,7 +31,7 @@ bool isPropertyReadOnly(css::uno::Reference<css::beans::XPropertySet> const& rxP { css::uno::Reference<css::beans::XPropertySetInfo> xPropertySetInfo( rxPropertySet->getPropertySetInfo()); - css::uno::Sequence<css::beans::Property> xProperties = xPropertySetInfo->getProperties(); + const css::uno::Sequence<css::beans::Property> xProperties = xPropertySetInfo->getProperties(); for (auto const& rProperty : xProperties) { 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 ) ); } |