loplugin:sequenceloop in forms..oox

Change-Id: Id742001211e916e7709918e7112902a0c35bac95
Reviewed-on: https://gerrit.libreoffice.org/77501
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
diff --git a/forms/source/component/ComboBox.cxx b/forms/source/component/ComboBox.cxx
index 62a0b54..912834f 100644
--- a/forms/source/component/ComboBox.cxx
+++ b/forms/source/component/ComboBox.cxx
@@ -415,7 +415,7 @@ void SAL_CALL OComboBoxModel::read(const Reference<css::io::XObjectInputStream>&
        m_aListSource.clear();
        css::uno::Sequence<OUString> aListSource;
        _rxInStream >> aListSource;
        for (const OUString& rToken : aListSource)
        for (const OUString& rToken : std::as_const(aListSource))
            m_aListSource += rToken;
    }

@@ -642,7 +642,8 @@ void OComboBoxModel::loadData( bool _bForce )
                Reference<XNameAccess> xFieldNames = getTableFields(xConnection, m_aListSource);
                if (xFieldNames.is())
                {
                    for (const OUString& rustrNames : xFieldNames->getElementNames())
                    const Sequence<OUString> aFieldNames = xFieldNames->getElementNames();
                    for (const OUString& rustrNames : aFieldNames)
                        aStringList.push_back(rustrNames);
                }
            }
@@ -763,7 +764,7 @@ bool OComboBoxModel::commitControlValueToDbColumn( bool _bPostReset )
        if ( getPropertyValue( PROPERTY_STRINGITEMLIST ) >>= aStringItemList )
        {
            bool bFound = false;
            for (const OUString& rStringItem : aStringItemList)
            for (const OUString& rStringItem : std::as_const(aStringItemList))
            {
                if ( (bFound = rStringItem == sNewValue) )
                    break;
diff --git a/forms/source/component/DatabaseForm.cxx b/forms/source/component/DatabaseForm.cxx
index a24e9ee..4f621a7 100644
--- a/forms/source/component/DatabaseForm.cxx
+++ b/forms/source/component/DatabaseForm.cxx
@@ -305,7 +305,7 @@ ODatabaseForm::ODatabaseForm( const ODatabaseForm& _cloneSource )

            Reference< XPropertySetInfo > xDestPSI( getPropertySetInfo(), UNO_SET_THROW );

            Sequence< Property > aSourceProperties( xSourcePSI->getProperties() );
            const Sequence< Property > aSourceProperties( xSourcePSI->getProperties() );
            for ( auto const & sourceProperty : aSourceProperties )
            {
                if ( xDestPSI->hasPropertyByName( sourceProperty.Name ) )
@@ -631,7 +631,8 @@ void ODatabaseForm::AppendComponent(HtmlSuccessfulObjList& rList, const Referenc

                // Find the right control
                bool bFound = false;
                for( auto const& xControl : xControlContainer->getControls() )
                const Sequence<Reference<XControl>> aControls = xControlContainer->getControls();
                for( auto const& xControl : aControls )
                {
                    Reference<XPropertySet>  xModel(xControl->getModel(), UNO_QUERY);
                    if ((bFound = xModel == xComponentSet))
diff --git a/forms/source/component/Edit.cxx b/forms/source/component/Edit.cxx
index 3573224..4ab433f 100644
--- a/forms/source/component/Edit.cxx
+++ b/forms/source/component/Edit.cxx
@@ -418,7 +418,7 @@ namespace
                return;
            }

            Sequence< Property > aSourceProps( xSourceInfo->getProperties() );
            const Sequence< Property > aSourceProps( xSourceInfo->getProperties() );
            for ( auto const & sourceprop : aSourceProps )
            {
                if ( !xDestInfo->hasPropertyByName( sourceprop.Name ) )
diff --git a/forms/source/component/FormComponent.cxx b/forms/source/component/FormComponent.cxx
index eb4cbf3..e0c7b3e 100644
--- a/forms/source/component/FormComponent.cxx
+++ b/forms/source/component/FormComponent.cxx
@@ -2366,7 +2366,7 @@ bool OBoundControlModel::impl_approveValueBinding_nolock( const Reference< XValu
        // < SYNCHRONIZED
    }

    for ( auto const & type : aTypeCandidates )
    for ( auto const & type : std::as_const(aTypeCandidates) )
    {
        if ( _rxBinding->supportsType( type ) )
            return true;
@@ -2594,7 +2594,7 @@ void OBoundControlModel::calculateExternalValueType()
    m_aExternalValueType = Type();
    if ( !m_xExternalBinding.is() )
        return;
    Sequence< Type > aTypeCandidates( getSupportedBindingTypes() );
    const Sequence< Type > aTypeCandidates( getSupportedBindingTypes() );
    for ( auto const & typeCandidate : aTypeCandidates )
    {
        if ( m_xExternalBinding->supportsType( typeCandidate ) )
diff --git a/forms/source/component/ListBox.cxx b/forms/source/component/ListBox.cxx
index c6abd1b..95a8055 100644
--- a/forms/source/component/ListBox.cxx
+++ b/forms/source/component/ListBox.cxx
@@ -1417,7 +1417,7 @@ namespace frm
            ::std::set< sal_Int16 > aSelectionSet;

            // find the selection entries in our item list
            for ( OUString const & selectEntry : aSelectEntries )
            for ( OUString const & selectEntry : std::as_const(aSelectEntries) )
            {
                int idx = 0;
                for(const OUString& s : getStringItemList())
diff --git a/fpicker/source/office/OfficeControlAccess.cxx b/fpicker/source/office/OfficeControlAccess.cxx
index 723d8d3..29336e0 100644
--- a/fpicker/source/office/OfficeControlAccess.cxx
+++ b/fpicker/source/office/OfficeControlAccess.cxx
@@ -616,7 +616,7 @@ namespace svt
                    static_cast< ListBox* >( _pControl )->Clear();

                    // add the new ones
                    for ( auto const & item : aItems )
                    for ( auto const & item : std::as_const(aItems) )
                    {
                        static_cast< ListBox* >( _pControl )->InsertEntry( item );
                    }
diff --git a/fpicker/source/office/fpsmartcontent.cxx b/fpicker/source/office/fpsmartcontent.cxx
index 53b3a8b..0f65ac6 100644
--- a/fpicker/source/office/fpsmartcontent.cxx
+++ b/fpicker/source/office/fpsmartcontent.cxx
@@ -263,7 +263,8 @@ namespace svt
        bool bRet = false;
        try
        {
            for ( auto const& rInfo : m_pContent->queryCreatableContentsInfo() )
            const css::uno::Sequence<css::ucb::ContentInfo> aContentsInfo = m_pContent->queryCreatableContentsInfo();
            for ( auto const& rInfo : aContentsInfo )
            {
                // Simply look for the first KIND_FOLDER...
                if ( rInfo.Attributes & ContentInfoAttribute::KIND_FOLDER )
@@ -291,7 +292,8 @@ namespace svt
        {
            OUString sFolderType;

            for ( auto const& rInfo : m_pContent->queryCreatableContentsInfo() )
            const css::uno::Sequence<css::ucb::ContentInfo> aContentsInfo = m_pContent->queryCreatableContentsInfo();
            for ( auto const& rInfo : aContentsInfo )
            {
                // Simply look for the first KIND_FOLDER...
                if ( rInfo.Attributes & ContentInfoAttribute::KIND_FOLDER )
diff --git a/framework/source/jobs/jobdata.cxx b/framework/source/jobs/jobdata.cxx
index d18f262..5d51c97 100644
--- a/framework/source/jobs/jobdata.cxx
+++ b/framework/source/jobs/jobdata.cxx
@@ -504,7 +504,7 @@ std::vector< OUString > JobData::getEnabledJobsForEvent( const css::uno::Referen
    // We create an additional job name list with the same size, then the original list...
    // step over all job entries... check her timestamps... and put only job names to the
    // destination list, which represent an enabled job.
    css::uno::Sequence< OUString > lAllJobs = xJobList->getElementNames();
    const css::uno::Sequence< OUString > lAllJobs = xJobList->getElementNames();
    sal_Int32 c = lAllJobs.getLength();

    std::vector< OUString > lEnabledJobs(c);
diff --git a/framework/source/uielement/generictoolbarcontroller.cxx b/framework/source/uielement/generictoolbarcontroller.cxx
index 61ddc35..0049006 100644
--- a/framework/source/uielement/generictoolbarcontroller.cxx
+++ b/framework/source/uielement/generictoolbarcontroller.cxx
@@ -318,7 +318,7 @@ void MenuToolbarController::initialize( const css::uno::Sequence< css::uno::Any 
        Sequence< PropertyValue > aProps;
        // drop down menu info is currently the first ( and only ) menu in the menusettings container
        xMenuContainer->getByIndex(0) >>= aProps;
        for ( const auto& aProp : aProps )
        for ( const auto& aProp : std::as_const(aProps) )
        {
            if ( aProp.Name == "ItemDescriptorContainer" )
            {
diff --git a/framework/source/uielement/newmenucontroller.cxx b/framework/source/uielement/newmenucontroller.cxx
index fc01375..c02923a 100644
--- a/framework/source/uielement/newmenucontroller.cxx
+++ b/framework/source/uielement/newmenucontroller.cxx
@@ -321,7 +321,7 @@ void NewMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu > const &
        if(xMenuItemDispatch == nullptr)
            return;

        css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > > aDynamicMenuEntries =
        const css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > > aDynamicMenuEntries =
            SvtDynamicMenuOptions().GetMenu( m_bNewMenu ? EDynamicMenuType::NewMenu : EDynamicMenuType::WizardMenu );

        OUString aTitle;
diff --git a/i18npool/source/localedata/localedata.cxx b/i18npool/source/localedata/localedata.cxx
index 06ec029..433b34c 100644
--- a/i18npool/source/localedata/localedata.cxx
+++ b/i18npool/source/localedata/localedata.cxx
@@ -840,7 +840,7 @@ LocaleDataImpl::getAllCurrencies2( const Locale& rLocale )
Sequence< Currency > SAL_CALL
LocaleDataImpl::getAllCurrencies( const Locale& rLocale )
{
    Sequence< Currency2 > aCur2( getAllCurrencies2( rLocale));
    const Sequence< Currency2 > aCur2( getAllCurrencies2( rLocale));
    Sequence< Currency > aCur1( aCur2.getLength());
    Currency* p1 = aCur1.getArray();
    for (const Currency2& r2 : aCur2)
diff --git a/oox/source/core/filterbase.cxx b/oox/source/core/filterbase.cxx
index ede7b7a..8bcf91e 100644
--- a/oox/source/core/filterbase.cxx
+++ b/oox/source/core/filterbase.cxx
@@ -427,7 +427,7 @@ void SAL_CALL FilterBase::initialize( const Sequence< Any >& rArgs )
    {
        Sequence<css::beans::PropertyValue> aSeq;
        rArgs[0] >>= aSeq;
        for (const auto& rVal : aSeq)
        for (const auto& rVal : std::as_const(aSeq))
        {
            if (rVal.Name == "UserData")
            {
diff --git a/oox/source/crypto/AgileEngine.cxx b/oox/source/crypto/AgileEngine.cxx
index 883daee..7c2a0e9 100644
--- a/oox/source/crypto/AgileEngine.cxx
+++ b/oox/source/crypto/AgileEngine.cxx
@@ -85,7 +85,8 @@ public:
    {
        const OUString& rLocalName = stripNamespacePrefix(rName);

        for (const Attribute& rAttribute : aAttributeList->getUnknownAttributes())
        const css::uno::Sequence<Attribute> aUnknownAttributes = aAttributeList->getUnknownAttributes();
        for (const Attribute& rAttribute : aUnknownAttributes)
        {
            const OUString& rAttrLocalName = stripNamespacePrefix(rAttribute.Name);

diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx
index ebdac12..a592822 100644
--- a/oox/source/export/shapes.cxx
+++ b/oox/source/export/shapes.cxx
@@ -2002,19 +2002,19 @@ ShapeExport& ShapeExport::WriteOLE2Shape( const Reference< XShape >& xShape )

    OUString progID;

    for (auto const& it : grabBag)
    for (auto const& it : std::as_const(grabBag))
    {
        if (it.Name == "EmbeddedObjects")
        {
            uno::Sequence<beans::PropertyValue> objects;
            it.Value >>= objects;
            for (auto const& object : objects)
            for (auto const& object : std::as_const(objects))
            {
                if (object.Name == entryName)
                {
                    uno::Sequence<beans::PropertyValue> props;
                    object.Value >>= props;
                    for (auto const& prop : props)
                    for (auto const& prop : std::as_const(props))
                    {
                        if (prop.Name == "ProgID")
                        {