[Libreoffice-commits] core.git: 5 commits - scaddins/source sccomp/source scripting/source sdext/source sd/qa sd/source sfx2/source starmath/source stoc/source svgio/qa svl/source svtools/source svx/source
Noel Grandin (via logerrit)
logerrit at kemper.freedesktop.org
Thu Aug 15 18:24:48 UTC 2019
scaddins/source/analysis/analysishelper.cxx | 4 -
sccomp/source/solver/CoinMPSolver.cxx | 4 -
sccomp/source/solver/LpsolveSolver.cxx | 6 +-
sccomp/source/solver/SwarmSolver.cxx | 2
scripting/source/basprov/basprov.cxx | 2
scripting/source/dlgprov/dlgevtatt.cxx | 2
scripting/source/dlgprov/dlgprov.cxx | 2
scripting/source/provider/BrowseNodeFactoryImpl.cxx | 8 +--
scripting/source/vbaevents/eventhelper.cxx | 4 -
sd/qa/unit/export-tests.cxx | 2
sd/source/core/CustomAnimationEffect.cxx | 2
sd/source/core/CustomAnimationPreset.cxx | 8 +--
sd/source/core/TransitionPreset.cxx | 2
sd/source/core/drawdoc.cxx | 6 +-
sd/source/core/stlpool.cxx | 2
sd/source/filter/eppt/eppt.cxx | 2
sd/source/filter/eppt/epptso.cxx | 2
sd/source/filter/eppt/pptexanimations.cxx | 2
sd/source/filter/eppt/pptx-animations.cxx | 2
sd/source/filter/ppt/pptinanimations.cxx | 2
sd/source/ui/dlg/PhotoAlbumDialog.cxx | 2
sd/source/ui/dlg/tpaction.cxx | 2
sd/source/ui/framework/configuration/ConfigurationController.cxx | 2
sd/source/ui/framework/factories/ViewShellWrapper.cxx | 2
sd/source/ui/framework/tools/FrameworkHelper.cxx | 2
sd/source/ui/remotecontrol/Server.cxx | 2
sd/source/ui/sidebar/RecentlyUsedMasterPages.cxx | 4 -
sd/source/ui/slideshow/PaneHider.cxx | 2
sd/source/ui/tools/ConfigurationAccess.cxx | 2
sd/source/ui/unoidl/SdUnoSlideView.cxx | 2
sd/source/ui/unoidl/unoobj.cxx | 2
sd/source/ui/unoidl/unopage.cxx | 4 -
sdext/source/minimizer/fileopendialog.cxx | 4 -
sdext/source/minimizer/impoptimizer.cxx | 2
sdext/source/minimizer/pagecollector.cxx | 2
sdext/source/presenter/PresenterConfigurationAccess.cxx | 6 +-
sdext/source/presenter/PresenterTheme.cxx | 2
sfx2/source/appl/appopen.cxx | 2
sfx2/source/appl/appserv.cxx | 2
sfx2/source/appl/fileobj.cxx | 2
sfx2/source/appl/newhelp.cxx | 2
sfx2/source/bastyp/fltfnc.cxx | 8 +--
sfx2/source/bastyp/frmhtmlw.cxx | 2
sfx2/source/control/recentdocsview.cxx | 2
sfx2/source/control/shell.cxx | 2
sfx2/source/control/unoctitm.cxx | 3 -
sfx2/source/dialog/dinfdlg.cxx | 16 +++----
sfx2/source/dialog/dockwin.cxx | 2
sfx2/source/dialog/filedlghelper.cxx | 2
sfx2/source/dialog/mailmodel.cxx | 2
sfx2/source/doc/docfac.cxx | 2
sfx2/source/doc/docfile.cxx | 2
sfx2/source/doc/docinf.cxx | 2
sfx2/source/doc/docmacromode.cxx | 2
sfx2/source/doc/doctemplates.cxx | 2
sfx2/source/doc/guisaveas.cxx | 4 -
sfx2/source/doc/objmisc.cxx | 2
sfx2/source/doc/objserv.cxx | 2
sfx2/source/doc/objstor.cxx | 11 ++---
sfx2/source/doc/sfxbasemodel.cxx | 4 -
sfx2/source/doc/templatedlg.cxx | 2
sfx2/source/doc/watermarkitem.cxx | 2
sfx2/source/doc/zoomitem.cxx | 2
sfx2/source/inet/inettbc.cxx | 2
sfx2/source/notebookbar/NotebookbarTabControl.cxx | 2
sfx2/source/notebookbar/SfxNotebookBar.cxx | 2
sfx2/source/notify/eventsupplier.cxx | 4 -
sfx2/source/sidebar/ResourceManager.cxx | 2
sfx2/source/view/classificationhelper.cxx | 4 -
sfx2/source/view/sfxbasecontroller.cxx | 2
sfx2/source/view/viewprn.cxx | 2
starmath/source/cfgitem.cxx | 2
starmath/source/unomodel.cxx | 2
stoc/source/defaultregistry/defaultregistry.cxx | 2
stoc/source/implementationregistration/implreg.cxx | 22 +++++-----
stoc/source/inspect/introspection.cxx | 6 +-
stoc/source/servicemanager/servicemanager.cxx | 12 ++---
svgio/qa/cppunit/SvgImportTest.cxx | 4 -
svl/source/items/grabbagitem.cxx | 2
svl/source/items/srchitem.cxx | 2
svl/source/numbers/zforlist.cxx | 4 -
svl/source/passwordcontainer/passwordcontainer.cxx | 4 -
svtools/source/config/extcolorcfg.cxx | 4 -
svtools/source/config/fontsubstconfig.cxx | 2
svtools/source/contnr/DocumentInfoPreview.cxx | 2
svtools/source/control/inettbc.cxx | 4 -
svtools/source/dialogs/addresstemplate.cxx | 11 ++---
svtools/source/dialogs/colrdlg.cxx | 2
svtools/source/dialogs/insdlg.cxx | 2
svtools/source/filter/DocumentToGraphicRenderer.cxx | 2
svtools/source/filter/SvFilterOptionsDialog.cxx | 4 -
svtools/source/java/javainteractionhandler.cxx | 2
svtools/source/misc/embedhlp.cxx | 4 -
svtools/source/misc/imagemgr.cxx | 2
svtools/source/misc/langtab.cxx | 2
svtools/source/uno/unoevent.cxx | 2
svx/source/accessibility/lookupcolorname.cxx | 2
svx/source/core/graphichelper.cxx | 4 -
svx/source/customshapes/EnhancedCustomShape2d.cxx | 4 -
svx/source/customshapes/EnhancedCustomShapeEngine.cxx | 2
svx/source/dialog/ClassificationCommon.cxx | 2
svx/source/fmcomp/gridcell.cxx | 8 +--
svx/source/form/dataaccessdescriptor.cxx | 2
svx/source/form/databaselocationinput.cxx | 2
svx/source/form/datanavi.cxx | 8 +--
svx/source/form/filtnav.cxx | 2
svx/source/form/fmexch.cxx | 2
svx/source/form/fmshimp.cxx | 6 +-
svx/source/form/formcontroller.cxx | 18 ++++----
svx/source/form/navigatortree.cxx | 2
svx/source/form/tabwin.cxx | 2
svx/source/gallery2/galbrws2.cxx | 2
svx/source/items/galleryitem.cxx | 2
svx/source/items/viewlayoutitem.cxx | 2
svx/source/items/zoomslideritem.cxx | 2
svx/source/mnuctrls/smarttagmenu.cxx | 2
svx/source/smarttags/SmartTagMgr.cxx | 2
svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx | 2
svx/source/unogallery/unogalthemeprovider.cxx | 2
svx/source/xml/xmlxtexp.cxx | 2
svx/source/xoutdev/xattr.cxx | 6 +-
svx/source/xoutdev/xattrbmp.cxx | 2
122 files changed, 208 insertions(+), 207 deletions(-)
New commits:
commit 7b4f643f4feb28fdc92b3da7a95d0f1c7286d01a
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Thu Aug 15 14:19:08 2019 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Thu Aug 15 20:23:20 2019 +0200
loplugin:sequenceloop in svtools..svx
Change-Id: I81b54f6db69491492b2bc16f48b2296ad96e137d
Reviewed-on: https://gerrit.libreoffice.org/77529
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/svtools/source/config/extcolorcfg.cxx b/svtools/source/config/extcolorcfg.cxx
index 634344521d77..5ff453f2a903 100644
--- a/svtools/source/config/extcolorcfg.cxx
+++ b/svtools/source/config/extcolorcfg.cxx
@@ -77,7 +77,7 @@ class ExtendedColorConfig_Impl : public utl::ConfigItem, public SfxBroadcaster
static bool m_bBroadcastWhenUnlocked;
uno::Sequence< OUString> GetPropertyNames(const OUString& rScheme);
- void FillComponentColors(uno::Sequence < OUString >& _rComponents,const TDisplayNames& _rDisplayNames);
+ void FillComponentColors(const uno::Sequence < OUString >& _rComponents,const TDisplayNames& _rDisplayNames);
virtual void ImplCommit() override;
@@ -307,7 +307,7 @@ void ExtendedColorConfig_Impl::Load(const OUString& rScheme)
}
}
-void ExtendedColorConfig_Impl::FillComponentColors(uno::Sequence < OUString >& _rComponents,const TDisplayNames& _rDisplayNames)
+void ExtendedColorConfig_Impl::FillComponentColors(const uno::Sequence < OUString >& _rComponents,const TDisplayNames& _rDisplayNames)
{
const OUString sColorEntries("/Entries");
for(OUString const & component : _rComponents)
diff --git a/svtools/source/config/fontsubstconfig.cxx b/svtools/source/config/fontsubstconfig.cxx
index ffcc6399002d..34a11f6147b7 100644
--- a/svtools/source/config/fontsubstconfig.cxx
+++ b/svtools/source/config/fontsubstconfig.cxx
@@ -59,7 +59,7 @@ SvtFontSubstConfig::SvtFontSubstConfig() :
bIsEnabled = *o3tl::doAccess<bool>(aValues.getConstArray()[0]);
OUString sPropPrefix(cFontPairs);
- Sequence<OUString> aNodeNames = GetNodeNames(sPropPrefix, ConfigNameFormat::LocalPath);
+ const Sequence<OUString> aNodeNames = GetNodeNames(sPropPrefix, ConfigNameFormat::LocalPath);
Sequence<OUString> aPropNames(aNodeNames.getLength() * 4);
OUString* pNames = aPropNames.getArray();
sal_Int32 nName = 0;
diff --git a/svtools/source/contnr/DocumentInfoPreview.cxx b/svtools/source/contnr/DocumentInfoPreview.cxx
index 22d29b2a65ce..59bb509117c2 100644
--- a/svtools/source/contnr/DocumentInfoPreview.cxx
+++ b/svtools/source/contnr/DocumentInfoPreview.cxx
@@ -103,7 +103,7 @@ void ODocumentInfoPreview::fill(
xDocProps->getUserDefinedProperties(), css::uno::UNO_QUERY_THROW);
css::uno::Reference< css::beans::XPropertySetInfo > info(
user->getPropertySetInfo());
- css::uno::Sequence< css::beans::Property > props(info->getProperties());
+ const css::uno::Sequence< css::beans::Property > props(info->getProperties());
for (const auto& rProp : props) {
OUString name(rProp.Name);
css::uno::Any aAny(user->getPropertyValue(name));
diff --git a/svtools/source/control/inettbc.cxx b/svtools/source/control/inettbc.cxx
index 8373d346fd8d..1787f280fdad 100644
--- a/svtools/source/control/inettbc.cxx
+++ b/svtools/source/control/inettbc.cxx
@@ -1479,7 +1479,7 @@ void SvtURLBox::UpdatePicklistForSmartProtocol_Impl()
return;
// read history pick list
- Sequence< Sequence< PropertyValue > > seqPicklist = SvtHistoryOptions().GetList( ePICKLIST );
+ const Sequence< Sequence< PropertyValue > > seqPicklist = SvtHistoryOptions().GetList( ePICKLIST );
INetURLObject aCurObj;
for( const Sequence< PropertyValue >& rPropertySet : seqPicklist )
@@ -2045,7 +2045,7 @@ void URLBox::UpdatePicklistForSmartProtocol_Impl()
return;
// read history pick list
- Sequence< Sequence< PropertyValue > > seqPicklist = SvtHistoryOptions().GetList( ePICKLIST );
+ const Sequence< Sequence< PropertyValue > > seqPicklist = SvtHistoryOptions().GetList( ePICKLIST );
INetURLObject aCurObj;
for( const Sequence< PropertyValue >& rPropertySet : seqPicklist )
diff --git a/svtools/source/dialogs/addresstemplate.cxx b/svtools/source/dialogs/addresstemplate.cxx
index d1cc5caa6f5b..708a4efbea4c 100644
--- a/svtools/source/dialogs/addresstemplate.cxx
+++ b/svtools/source/dialogs/addresstemplate.cxx
@@ -700,17 +700,16 @@ void AssignmentPersistentData::ImplCommit()
m_xDatasource->clear();
// fill the datasources listbox
- Sequence< OUString > aDatasourceNames;
try
{
- aDatasourceNames = m_xDatabaseContext->getElementNames();
+ const css::uno::Sequence<OUString> aElementNames = m_xDatabaseContext->getElementNames();
+ for (const OUString& rDatasourceName : aElementNames)
+ m_xDatasource->append_text(rDatasourceName);
}
catch(Exception&)
{
OSL_FAIL("AddressBookSourceDialog::initializeDatasources: caught an exception while asking for the data source names!");
}
- for (const OUString& rDatasourceName : aDatasourceNames)
- m_xDatasource->append_text(rDatasourceName);
}
IMPL_LINK(AddressBookSourceDialog, OnFieldScroll, weld::ScrolledWindow&, rScrollBar, void)
@@ -806,7 +805,7 @@ void AssignmentPersistentData::ImplCommit()
bool bKnowOldTable = false;
// fill the table list
- for (const OUString& rTableName : aTableNames)
+ for (const OUString& rTableName : std::as_const(aTableNames))
{
m_xTable->append_text(rTableName);
if (rTableName == sOldTable)
@@ -873,7 +872,7 @@ void AssignmentPersistentData::ImplCommit()
pListbox->set_id(0, OUString::number(i));
// the field names
- for (const OUString& rColumnName : aColumnNames)
+ for (const OUString& rColumnName : std::as_const(aColumnNames))
pListbox->append_text(rColumnName);
if (!aInitialSelection->isEmpty() && (aColumnNameSet.end() != aColumnNameSet.find(*aInitialSelection)))
diff --git a/svtools/source/dialogs/colrdlg.cxx b/svtools/source/dialogs/colrdlg.cxx
index 1000e0dc5c1d..2608690b413e 100644
--- a/svtools/source/dialogs/colrdlg.cxx
+++ b/svtools/source/dialogs/colrdlg.cxx
@@ -84,7 +84,7 @@ short SvColorDialog::Execute(weld::Window* pParent)
if( ret )
{
props = xPropertyAccess->getPropertyValues();
- for( const auto& rProp : props )
+ for( const auto& rProp : std::as_const(props) )
{
if( rProp.Name == sColor )
{
diff --git a/svtools/source/dialogs/insdlg.cxx b/svtools/source/dialogs/insdlg.cxx
index 28fcc05b3685..291d3cd92fd9 100644
--- a/svtools/source/dialogs/insdlg.cxx
+++ b/svtools/source/dialogs/insdlg.cxx
@@ -106,7 +106,7 @@ void SvObjectServerList::FillInsertObjects()
if( xNameAccess.is())
{
- uno::Sequence< OUString > seqNames= xNameAccess->getElementNames();
+ const uno::Sequence< OUString > seqNames= xNameAccess->getElementNames();
OUString aStringProductName( "%PRODUCTNAME" );
sal_Int32 nStringProductNameLength = aStringProductName.getLength();
diff --git a/svtools/source/filter/DocumentToGraphicRenderer.cxx b/svtools/source/filter/DocumentToGraphicRenderer.cxx
index 39b8e40426d4..bec55b93fbe3 100644
--- a/svtools/source/filter/DocumentToGraphicRenderer.cxx
+++ b/svtools/source/filter/DocumentToGraphicRenderer.cxx
@@ -151,7 +151,7 @@ Size DocumentToGraphicRenderer::getDocumentSizeIn100mm(sal_Int32 nCurrentPage,
sal_Int32 nPages = mxRenderable->getRendererCount( selection, renderProperties );
if (nPages >= nCurrentPage)
{
- Sequence< beans::PropertyValue > aResult = mxRenderable->getRenderer(nCurrentPage - 1, selection, renderProperties );
+ const Sequence< beans::PropertyValue > aResult = mxRenderable->getRenderer(nCurrentPage - 1, selection, renderProperties );
for( const auto& rProperty : aResult )
{
if ( rProperty.Name == "PageSize" )
diff --git a/svtools/source/filter/SvFilterOptionsDialog.cxx b/svtools/source/filter/SvFilterOptionsDialog.cxx
index 7651eeecbede..55501fb8a77f 100644
--- a/svtools/source/filter/SvFilterOptionsDialog.cxx
+++ b/svtools/source/filter/SvFilterOptionsDialog.cxx
@@ -175,7 +175,7 @@ void SvFilterOptionsDialog::setPropertyValues( const uno::Sequence< beans::Prope
{
maMediaDescriptor = aProps;
- for ( const auto& rProp : maMediaDescriptor )
+ for ( const auto& rProp : std::as_const(maMediaDescriptor) )
{
if ( rProp.Name == "FilterData" )
{
@@ -199,7 +199,7 @@ sal_Int16 SvFilterOptionsDialog::execute()
OUString aInternalFilterName;
uno::Reference<graphic::XGraphic> xGraphic;
- for ( const auto& rProp : maMediaDescriptor )
+ for ( const auto& rProp : std::as_const(maMediaDescriptor) )
{
const OUString& rName = rProp.Name;
if ( rName == "FilterName" )
diff --git a/svtools/source/java/javainteractionhandler.cxx b/svtools/source/java/javainteractionhandler.cxx
index f20433c28878..5d287b508988 100644
--- a/svtools/source/java/javainteractionhandler.cxx
+++ b/svtools/source/java/javainteractionhandler.cxx
@@ -93,7 +93,7 @@ void SAL_CALL JavaInteractionHandler::release( ) throw ()
void SAL_CALL JavaInteractionHandler::handle( const Reference< XInteractionRequest >& Request )
{
Any anyExc = Request->getRequest();
- Sequence< Reference< XInteractionContinuation > > aSeqCont = Request->getContinuations();
+ const Sequence< Reference< XInteractionContinuation > > aSeqCont = Request->getContinuations();
Reference< XInteractionAbort > abort;
Reference< XInteractionRetry > retry;
diff --git a/svtools/source/misc/embedhlp.cxx b/svtools/source/misc/embedhlp.cxx
index f9a131acc37e..f6dd90343726 100644
--- a/svtools/source/misc/embedhlp.cxx
+++ b/svtools/source/misc/embedhlp.cxx
@@ -854,13 +854,13 @@ OUString EmbeddedObjectRef::GetChartType()
if( ! xDiagram.is())
return OUString();
uno::Reference< chart2::XCoordinateSystemContainer > xCooSysCnt( xDiagram, uno::UNO_QUERY_THROW );
- uno::Sequence< uno::Reference< chart2::XCoordinateSystem > > aCooSysSeq( xCooSysCnt->getCoordinateSystems());
+ const uno::Sequence< uno::Reference< chart2::XCoordinateSystem > > aCooSysSeq( xCooSysCnt->getCoordinateSystems());
// IA2 CWS. Unused: int nCoordinateCount = aCooSysSeq.getLength();
bool bGetChartType = false;
for( const auto& rCooSys : aCooSysSeq )
{
uno::Reference< chart2::XChartTypeContainer > xCTCnt( rCooSys, uno::UNO_QUERY_THROW );
- uno::Sequence< uno::Reference< chart2::XChartType > > aChartTypes( xCTCnt->getChartTypes());
+ const uno::Sequence< uno::Reference< chart2::XChartType > > aChartTypes( xCTCnt->getChartTypes());
int nDimesionCount = rCooSys->getDimension();
if( nDimesionCount == 3 )
Style += "3D ";
diff --git a/svtools/source/misc/imagemgr.cxx b/svtools/source/misc/imagemgr.cxx
index 9026b65e62d8..9941c5051db6 100644
--- a/svtools/source/misc/imagemgr.cxx
+++ b/svtools/source/misc/imagemgr.cxx
@@ -232,7 +232,7 @@ static OUString GetImageExtensionByFactory_Impl( const OUString& rURL )
if ( !aInternalType.isEmpty() && xAccess->hasByName( aInternalType ) )
{
xAccess->getByName( aInternalType ) >>= aTypeProps;
- for ( const css::beans::PropertyValue& rProp : aTypeProps )
+ for ( const css::beans::PropertyValue& rProp : std::as_const(aTypeProps) )
{
if (rProp.Name == "Extensions")
{
diff --git a/svtools/source/misc/langtab.cxx b/svtools/source/misc/langtab.cxx
index 62d31910da7d..c10561f8f87c 100644
--- a/svtools/source/misc/langtab.cxx
+++ b/svtools/source/misc/langtab.cxx
@@ -172,7 +172,7 @@ SvtLanguageTableImpl::SvtLanguageTableImpl()
}
auto xNA = officecfg::VCL::ExtraLanguages::get();
- uno::Sequence <OUString> rElementNames = xNA->getElementNames();
+ const uno::Sequence <OUString> rElementNames = xNA->getElementNames();
for (const OUString& rBcp47 : rElementNames)
{
OUString aName;
diff --git a/svtools/source/uno/unoevent.cxx b/svtools/source/uno/unoevent.cxx
index 91e1a880f613..13c8d482d07a 100644
--- a/svtools/source/uno/unoevent.cxx
+++ b/svtools/source/uno/unoevent.cxx
@@ -151,7 +151,7 @@ void getMacroFromAny(
OUString sScriptVal;
OUString sMacroVal;
OUString sLibVal;
- for (const PropertyValue& aValue : aSequence)
+ for (const PropertyValue& aValue : std::as_const(aSequence))
{
if (aValue.Name == sEventType)
{
diff --git a/svx/source/accessibility/lookupcolorname.cxx b/svx/source/accessibility/lookupcolorname.cxx
index c33cb9b3be23..feffea69fe18 100644
--- a/svx/source/accessibility/lookupcolorname.cxx
+++ b/svx/source/accessibility/lookupcolorname.cxx
@@ -78,7 +78,7 @@ ColorNameMap::ColorNameMap() {
// Fill the map to convert from numerical color values to names.
if (xNA.is())
- for (const auto& rName : aNames)
+ for (const auto& rName : std::as_const(aNames))
{
// Get the numerical value for the i-th color name.
try
diff --git a/svx/source/core/graphichelper.cxx b/svx/source/core/graphichelper.cxx
index e9fa4c819a24..7302d752d072 100644
--- a/svx/source/core/graphichelper.cxx
+++ b/svx/source/core/graphichelper.cxx
@@ -149,7 +149,7 @@ bool lcl_ExecuteFilterDialog( const Sequence< PropertyValue >& rPropsForDialog,
if( xFilterDialog->execute() )
{
bStatus = true;
- Sequence< PropertyValue > aPropsFromDialog = xFilterProperties->getPropertyValues();
+ const Sequence< PropertyValue > aPropsFromDialog = xFilterProperties->getPropertyValues();
for ( const auto& rProp : aPropsFromDialog )
{
if (rProp.Name == "FilterData")
@@ -297,7 +297,7 @@ OUString GraphicHelper::ExportGraphic(weld::Window* pParent, const Graphic& rGra
sal_Int32 nWidth = 0;
sal_Int32 nHeight = 0;
- for (const auto& rProp : aFilterData)
+ for (const auto& rProp : std::as_const(aFilterData))
{
if (rProp.Name == "PixelWidth")
{
diff --git a/svx/source/customshapes/EnhancedCustomShape2d.cxx b/svx/source/customshapes/EnhancedCustomShape2d.cxx
index cb226c3c9333..c5b296941ebb 100644
--- a/svx/source/customshapes/EnhancedCustomShape2d.cxx
+++ b/svx/source/customshapes/EnhancedCustomShape2d.cxx
@@ -2040,7 +2040,7 @@ void EnhancedCustomShape2d::CreateSubPath(
sal_Int32 nSegInfoSize = seqSegments.getLength();
if ( !nSegInfoSize )
{
- for ( const EnhancedCustomShapeParameterPair& rCoordinate : seqCoordinates )
+ for ( const EnhancedCustomShapeParameterPair& rCoordinate : std::as_const(seqCoordinates) )
{
const Point aTempPoint(GetPoint( rCoordinate, true, true ));
aNewB2DPolygon.append(basegfx::B2DPoint(aTempPoint.X(), aTempPoint.Y()));
@@ -2996,7 +2996,7 @@ void EnhancedCustomShape2d::ApplyGluePoints( SdrObject* pObj )
{
if ( pObj )
{
- for ( const auto& rGluePoint : seqGluePoints )
+ for ( const auto& rGluePoint : std::as_const(seqGluePoints) )
{
SdrGluePoint aGluePoint;
diff --git a/svx/source/customshapes/EnhancedCustomShapeEngine.cxx b/svx/source/customshapes/EnhancedCustomShapeEngine.cxx
index 7e7bcca224a8..95cb473a86a2 100644
--- a/svx/source/customshapes/EnhancedCustomShapeEngine.cxx
+++ b/svx/source/customshapes/EnhancedCustomShapeEngine.cxx
@@ -123,7 +123,7 @@ void SAL_CALL EnhancedCustomShapeEngine::initialize( const Sequence< Any >& aArg
if ( rArgument >>= aParameter )
break;
}
- for ( const beans::PropertyValue& rProp : aParameter )
+ for ( const beans::PropertyValue& rProp : std::as_const(aParameter) )
{
if ( rProp.Name == "CustomShape" )
rProp.Value >>= mxShape;
diff --git a/svx/source/dialog/ClassificationCommon.cxx b/svx/source/dialog/ClassificationCommon.cxx
index c8e37076f531..7c609b4d70fe 100644
--- a/svx/source/dialog/ClassificationCommon.cxx
+++ b/svx/source/dialog/ClassificationCommon.cxx
@@ -68,7 +68,7 @@ bool containsProperty(uno::Sequence<beans::Property> const& rProperties, OUStrin
void removeAllProperties(uno::Reference<beans::XPropertyContainer> const& rxPropertyContainer)
{
uno::Reference<beans::XPropertySet> xPropertySet(rxPropertyContainer, uno::UNO_QUERY);
- uno::Sequence<beans::Property> aProperties
+ const uno::Sequence<beans::Property> aProperties
= xPropertySet->getPropertySetInfo()->getProperties();
for (const beans::Property& rProperty : aProperties)
diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx
index ab5705fd4cab..db802b41a2d6 100644
--- a/svx/source/fmcomp/gridcell.cxx
+++ b/svx/source/fmcomp/gridcell.cxx
@@ -2424,7 +2424,7 @@ void DbComboBox::SetList(const Any& rItems)
css::uno::Sequence<OUString> aTest;
if (rItems >>= aTest)
{
- for (const OUString& rString : aTest)
+ for (const OUString& rString : std::as_const(aTest))
pField->InsertEntry(rString);
// tell the grid control that this controller is invalid and has to be re-initialized
@@ -2545,7 +2545,7 @@ void DbListBox::SetList(const Any& rItems)
{
if (aTest.hasElements())
{
- for (const OUString& rString : aTest)
+ for (const OUString& rString : std::as_const(aTest))
pField->InsertEntry(rString);
m_rColumn.getModel()->getPropertyValue(FM_PROP_VALUE_SEQ) >>= m_aValueList;
@@ -2707,13 +2707,13 @@ void DbFilterField::SetList(const Any& rItems, bool bComboBox)
if (bComboBox)
{
ComboBox* pField = static_cast<ComboBox*>(m_pWindow.get());
- for (const OUString& rString : aTest)
+ for (const OUString& rString : std::as_const(aTest))
pField->InsertEntry(rString);
}
else
{
ListBox* pField = static_cast<ListBox*>(m_pWindow.get());
- for (const OUString& rString : aTest)
+ for (const OUString& rString : std::as_const(aTest))
pField->InsertEntry(rString);
m_rColumn.getModel()->getPropertyValue(FM_PROP_VALUE_SEQ) >>= m_aValueList;
diff --git a/svx/source/form/dataaccessdescriptor.cxx b/svx/source/form/dataaccessdescriptor.cxx
index 361be0c11ce7..acad7b4a78f6 100644
--- a/svx/source/form/dataaccessdescriptor.cxx
+++ b/svx/source/form/dataaccessdescriptor.cxx
@@ -133,7 +133,7 @@ namespace svx
}
// build a PropertyValue sequence with the current values
- Sequence< Property > aProperties = xPropInfo->getProperties();
+ const Sequence< Property > aProperties = xPropInfo->getProperties();
Sequence< PropertyValue > aValues(aProperties.getLength());
PropertyValue* pValues = aValues.getArray();
diff --git a/svx/source/form/databaselocationinput.cxx b/svx/source/form/databaselocationinput.cxx
index 96093e8134ca..620ab6af29d9 100644
--- a/svx/source/form/databaselocationinput.cxx
+++ b/svx/source/form/databaselocationinput.cxx
@@ -94,7 +94,7 @@ namespace svx
// forward the allowed extensions to the input control
OUStringBuffer aExtensionList;
- for ( auto const & extension : m_aFilterExtensions )
+ for ( auto const & extension : std::as_const(m_aFilterExtensions) )
{
aExtensionList.append( extension );
aExtensionList.append( ';' );
diff --git a/svx/source/form/datanavi.cxx b/svx/source/form/datanavi.cxx
index 8390adda415c..263e405937c5 100644
--- a/svx/source/form/datanavi.cxx
+++ b/svx/source/form/datanavi.cxx
@@ -1901,7 +1901,7 @@ namespace svxform
if ( xContainer.is() )
{
m_xDataContainer = xContainer;
- Sequence< OUString > aNameList = m_xDataContainer->getElementNames();
+ const Sequence< OUString > aNameList = m_xDataContainer->getElementNames();
for ( const OUString& rName : aNameList )
{
Any aAny = m_xDataContainer->getByName( rName );
@@ -2405,7 +2405,7 @@ namespace svxform
try
{
// get property names & infos, and iterate over target properties
- Sequence< Property > aProperties = xTo->getPropertySetInfo()->getProperties();
+ const Sequence< Property > aProperties = xTo->getPropertySetInfo()->getProperties();
Reference< XPropertySetInfo > xFromInfo = xFrom->getPropertySetInfo();
for ( const Property& rProperty : aProperties )
{
@@ -2669,7 +2669,7 @@ namespace svxform
xModel->getDataTypeRepository();
if ( xDataTypes.is() )
{
- Sequence< OUString > aNameList = xDataTypes->getElementNames();
+ const Sequence< OUString > aNameList = xDataTypes->getElementNames();
for ( const OUString& rName : aNameList )
m_xDataTypeLB->append_text(rName);
}
@@ -2958,7 +2958,7 @@ namespace svxform
try
{
int nRow = 0;
- Sequence< OUString > aAllNames = m_rNamespaces->getElementNames();
+ const Sequence< OUString > aAllNames = m_rNamespaces->getElementNames();
for ( const OUString& sPrefix : aAllNames )
{
if ( m_rNamespaces->hasByName( sPrefix ) )
diff --git a/svx/source/form/filtnav.cxx b/svx/source/form/filtnav.cxx
index e68594ffd4af..1ea13ebe31c0 100644
--- a/svx/source/form/filtnav.cxx
+++ b/svx/source/form/filtnav.cxx
@@ -556,7 +556,7 @@ void FmFilterModel::Update(const Reference< XIndexAccess > & xControllers, FmPar
// insert the existing filters for the form
OUString aTitle(SvxResId(RID_STR_FILTER_FILTER_FOR));
- Sequence< Sequence< OUString > > aExpressions = xFilterController->getPredicateExpressions();
+ const Sequence< Sequence< OUString > > aExpressions = xFilterController->getPredicateExpressions();
for ( auto const & conjunctionTerm : aExpressions )
{
// we always display one row, even if there's no term to be displayed
diff --git a/svx/source/form/fmexch.cxx b/svx/source/form/fmexch.cxx
index 139aeb4ffeb6..ce1087a26eab 100644
--- a/svx/source/form/fmexch.cxx
+++ b/svx/source/form/fmexch.cxx
@@ -250,7 +250,7 @@ namespace svxform
ListBoxEntrySet aEmpty;
m_aSelectedEntries.swap( aEmpty );
- for (const css::uno::Sequence<sal_uInt32>& rPaths : m_aControlPaths)
+ for (const css::uno::Sequence<sal_uInt32>& rPaths : std::as_const(m_aControlPaths))
{
SvTreeListEntry* pSearch = pRoot;
for (const sal_uInt32 nThisPath : rPaths)
diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx
index 553c03cbeb18..2d42276f187e 100644
--- a/svx/source/form/fmshimp.cxx
+++ b/svx/source/form/fmshimp.cxx
@@ -402,7 +402,7 @@ namespace
for (const ScriptEventDescriptor& rCurrent : rTransferIfAvailable)
{
// search the model/control idl classes for the event described by pCurrent
- for (Sequence< Type>* pCurrentArray : { &aModelListeners, &aControlListeners })
+ for (const Sequence< Type>* pCurrentArray : { &aModelListeners, &aControlListeners })
{
for (const Type& rCurrentListener : *pCurrentArray)
{
@@ -2823,7 +2823,7 @@ Reference< XControl> FmXFormShell::impl_getControl_Lock(const Reference<XControl
{
Reference< XControlContainer> xControlContainer(getControlContainerForView_Lock(), UNO_SET_THROW);
- Sequence< Reference< XControl > > seqControls( xControlContainer->getControls() );
+ const Sequence< Reference< XControl > > seqControls( xControlContainer->getControls() );
// ... that I can then search
for (Reference< XControl > const & control : seqControls)
{
@@ -3342,7 +3342,7 @@ void FmXFormShell::CreateExternalView_Lock()
aColumnProps.realloc(nExistentDescs + aProps.getLength());
pColumnProps = aColumnProps.getArray() + nExistentDescs;
- for (const Property& rProp : aProps)
+ for (const Property& rProp : std::as_const(aProps))
{
if (rProp.Name == FM_PROP_LABEL)
// already set
diff --git a/svx/source/form/formcontroller.cxx b/svx/source/form/formcontroller.cxx
index 9043ae73ac64..39d2f8f6a81d 100644
--- a/svx/source/form/formcontroller.cxx
+++ b/svx/source/form/formcontroller.cxx
@@ -1985,7 +1985,7 @@ void FormController::setContainer(const Reference< XControlContainer > & xContai
m_aFilterComponents.clear();
// collecting the controls
- for ( const Reference< XControl >& rControl : m_aControls )
+ for ( const Reference< XControl >& rControl : std::as_const(m_aControls) )
implControlRemoved( rControl, true );
// make database-specific things
@@ -2001,7 +2001,7 @@ void FormController::setContainer(const Reference< XControlContainer > & xContai
// What controls belong to the container?
if (xContainer.is() && xTabModel.is())
{
- Sequence< Reference< XControlModel > > aModels = xTabModel->getControlModels();
+ const Sequence< Reference< XControlModel > > aModels = xTabModel->getControlModels();
Sequence< Reference< XControl > > aAllControls = xContainer->getControls();
sal_Int32 nCount = aModels.getLength();
@@ -2066,7 +2066,7 @@ Sequence< Reference< XControl > > FormController::getControls()
if (!xModel.is())
return m_aControls;
- Sequence< Reference< XControlModel > > aControlModels = xModel->getControlModels();
+ const Sequence< Reference< XControlModel > > aControlModels = xModel->getControlModels();
sal_Int32 nModels = aControlModels.getLength();
Sequence< Reference< XControl > > aNewControls(nModels);
@@ -2175,7 +2175,7 @@ void FormController::setLocks()
{
OSL_ENSURE( !impl_isDisposed_nofail(), "FormController: already disposed!" );
// lock/unlock all controls connected to a data source
- for ( const Reference< XControl >& rControl : m_aControls )
+ for ( const Reference< XControl >& rControl : std::as_const(m_aControls) )
setControlLock( rControl );
}
@@ -2313,7 +2313,7 @@ void FormController::startListening()
m_bModified = false;
// now register at bound fields
- for ( const Reference< XControl >& rControl : m_aControls )
+ for ( const Reference< XControl >& rControl : std::as_const(m_aControls) )
startControlModifyListening( rControl );
}
@@ -2324,7 +2324,7 @@ void FormController::stopListening()
m_bModified = false;
// now register at bound fields
- for ( const Reference< XControl >& rControl : m_aControls )
+ for ( const Reference< XControl >& rControl : std::as_const(m_aControls) )
stopControlModifyListening( rControl );
}
@@ -2635,7 +2635,7 @@ void FormController::unload()
void FormController::removeBoundFieldListener()
{
- for ( const Reference< XControl >& rControl : m_aControls )
+ for ( const Reference< XControl >& rControl : std::as_const(m_aControls) )
{
Reference< XPropertySet > xProp( rControl, UNO_QUERY );
if ( xProp.is() )
@@ -3005,7 +3005,7 @@ void FormController::setFilter(::std::vector<FmFieldInfo>& rFieldInfos)
if (m_xComposer.is())
{
- Sequence< Sequence < PropertyValue > > aFilterRows = m_xComposer->getStructuredFilter();
+ const Sequence< Sequence < PropertyValue > > aFilterRows = m_xComposer->getStructuredFilter();
// ok, we receive the list of filters as sequence of fieldnames, value
// now we have to transform the fieldname into UI names, that could be a label of the field or
@@ -3526,7 +3526,7 @@ Reference< XControl > FormController::locateControl( const Reference< XControlMo
{
try
{
- Sequence< Reference< XControl > > aControls( getControls() );
+ const Sequence< Reference< XControl > > aControls( getControls() );
for ( auto const & control : aControls )
{
diff --git a/svx/source/form/navigatortree.cxx b/svx/source/form/navigatortree.cxx
index 2e2fa562dd67..b1cee44678bf 100644
--- a/svx/source/form/navigatortree.cxx
+++ b/svx/source/form/navigatortree.cxx
@@ -966,7 +966,7 @@ namespace svxform
// should only contain hidden controls
#endif // (OSL_DEBUG_LEVEL > 0)
Reference< XPropertySetInfo > xPropInfo( xCurrent->getPropertySetInfo());
- Sequence< Property> seqAllCurrentProps = xPropInfo->getProperties();
+ const Sequence< Property> seqAllCurrentProps = xPropInfo->getProperties();
for (Property const & currentProp : seqAllCurrentProps)
{
if (((currentProp.Attributes & PropertyAttribute::READONLY) == 0) && (currentProp.Name != FM_PROP_NAME))
diff --git a/svx/source/form/tabwin.cxx b/svx/source/form/tabwin.cxx
index fd8fe32c4628..dd8296696964 100644
--- a/svx/source/form/tabwin.cxx
+++ b/svx/source/form/tabwin.cxx
@@ -89,7 +89,7 @@ struct ColumnInfo
static void lcl_addToList( SvTreeListBox& _rListBox, const uno::Reference< container::XNameAccess>& i_xColumns )
{
- uno::Sequence< OUString > aEntries = i_xColumns->getElementNames();
+ const uno::Sequence< OUString > aEntries = i_xColumns->getElementNames();
for ( const OUString& rEntry : aEntries )
{
uno::Reference< beans::XPropertySet> xColumn(i_xColumns->getByName(rEntry),UNO_QUERY_THROW);
diff --git a/svx/source/gallery2/galbrws2.cxx b/svx/source/gallery2/galbrws2.cxx
index 92734278eb85..88e95b540f93 100644
--- a/svx/source/gallery2/galbrws2.cxx
+++ b/svx/source/gallery2/galbrws2.cxx
@@ -192,7 +192,7 @@ void SAL_CALL GalleryThemePopup::statusChanged(
else if ( ( rEvent.State >>= sItems ) && sItems.hasElements() )
{
sal_uInt16 nId = 1;
- for ( const OUString& rStr : sItems )
+ for ( const OUString& rStr : std::as_const(sItems) )
{
mpBackgroundPopup->InsertItem( nId, rStr );
nId++;
diff --git a/svx/source/items/galleryitem.cxx b/svx/source/items/galleryitem.cxx
index 56d1de655c34..07e88d07adcf 100644
--- a/svx/source/items/galleryitem.cxx
+++ b/svx/source/items/galleryitem.cxx
@@ -80,7 +80,7 @@ bool SvxGalleryItem::PutValue( const css::uno::Any& rVal, sal_uInt8 /* nMemberId
css::uno::Reference< css::lang::XComponent > xDrawing;
css::uno::Reference< css::graphic::XGraphic > xGraphic;
- for ( const css::beans::PropertyValue& rProp : aSeq )
+ for ( const css::beans::PropertyValue& rProp : std::as_const(aSeq) )
{
if ( rProp.Name == SVXGALLERYITEM_TYPE )
{
diff --git a/svx/source/items/viewlayoutitem.cxx b/svx/source/items/viewlayoutitem.cxx
index 0d4f714f6104..1d31d37f029d 100644
--- a/svx/source/items/viewlayoutitem.cxx
+++ b/svx/source/items/viewlayoutitem.cxx
@@ -113,7 +113,7 @@ bool SvxViewLayoutItem::PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId
bool bBookMode = false;
bool bAllConverted( true );
sal_Int16 nConvertedCount( 0 );
- for ( const auto& rProp : aSeq )
+ for ( const auto& rProp : std::as_const(aSeq) )
{
if ( rProp.Name == VIEWLAYOUT_PARAM_COLUMNS )
{
diff --git a/svx/source/items/zoomslideritem.cxx b/svx/source/items/zoomslideritem.cxx
index faeeb67a7bb4..ad53388b22a5 100644
--- a/svx/source/items/zoomslideritem.cxx
+++ b/svx/source/items/zoomslideritem.cxx
@@ -121,7 +121,7 @@ bool SvxZoomSliderItem::PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId
sal_Int16 nConvertedCount( 0 );
sal_Int32 nMinZoom( 0 ), nMaxZoom( 0 );
- for ( const auto& rProp : aSeq )
+ for ( const auto& rProp : std::as_const(aSeq) )
{
if ( rProp.Name == ZOOMSLIDER_PARAM_CURRENTZOOM )
{
diff --git a/svx/source/mnuctrls/smarttagmenu.cxx b/svx/source/mnuctrls/smarttagmenu.cxx
index 106234bde46c..dd55876b85ed 100644
--- a/svx/source/mnuctrls/smarttagmenu.cxx
+++ b/svx/source/mnuctrls/smarttagmenu.cxx
@@ -76,7 +76,7 @@ void SmartTagMenuController::statusChanged( const css::frame::FeatureStateEvent&
OUString aApplicationName;
OUString aRangeText;
- for ( const auto& aProperty : aProperties )
+ for ( const auto& aProperty : std::as_const(aProperties) )
{
if ( aProperty.Name == "ActionComponents" )
aProperty.Value >>= aActionComponents;
diff --git a/svx/source/smarttags/SmartTagMgr.cxx b/svx/source/smarttags/SmartTagMgr.cxx
index be65e6d0fff7..640fb8a7938c 100644
--- a/svx/source/smarttags/SmartTagMgr.cxx
+++ b/svx/source/smarttags/SmartTagMgr.cxx
@@ -431,7 +431,7 @@ void SmartTagMgr::ReadConfiguration( bool bExcludedTypes, bool bRecognize )
Sequence< OUString > aValues;
aAny >>= aValues;
- for ( const auto& rValue : aValues )
+ for ( const auto& rValue : std::as_const(aValues) )
maDisabledSmartTagTypes.insert( rValue );
}
diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx
index 84eb7b700548..b5cb64c7af02 100644
--- a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx
+++ b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx
@@ -120,7 +120,7 @@ void DictionaryList::refillFromDictionary( sal_Int32 nTextConversionOptions )
if(!m_xDictionary.is())
return;
- Sequence< OUString > aLeftList( m_xDictionary->getConversionEntries( linguistic2::ConversionDirection_FROM_LEFT ) );
+ const Sequence< OUString > aLeftList( m_xDictionary->getConversionEntries( linguistic2::ConversionDirection_FROM_LEFT ) );
Reference< linguistic2::XConversionPropertyType > xPropertyType( m_xDictionary, uno::UNO_QUERY );
diff --git a/svx/source/unogallery/unogalthemeprovider.cxx b/svx/source/unogallery/unogalthemeprovider.cxx
index a0b72e997435..58c4234ef899 100644
--- a/svx/source/unogallery/unogalthemeprovider.cxx
+++ b/svx/source/unogallery/unogalthemeprovider.cxx
@@ -129,7 +129,7 @@ void SAL_CALL GalleryThemeProvider::initialize( const uno::Sequence< uno::Any >&
break;
}
- for( const beans::PropertyValue& rProp : aParams )
+ for( const beans::PropertyValue& rProp : std::as_const(aParams) )
{
if ( rProp.Name == "ProvideHiddenThemes" )
rProp.Value >>= mbHiddenThemes;
diff --git a/svx/source/xml/xmlxtexp.cxx b/svx/source/xml/xmlxtexp.cxx
index 8175f3f7589e..400146ce579b 100644
--- a/svx/source/xml/xmlxtexp.cxx
+++ b/svx/source/xml/xmlxtexp.cxx
@@ -372,7 +372,7 @@ bool SvxXMLXTableExportComponent::exportTable() throw()
SvXMLElementExport aElem( *this, XML_NAMESPACE_OOO, pEleName, true, true );
- Sequence< OUString > aNames = mxTable->getElementNames();
+ const Sequence< OUString > aNames = mxTable->getElementNames();
Any aAny;
for( const OUString& rName : aNames )
diff --git a/svx/source/xoutdev/xattr.cxx b/svx/source/xoutdev/xattr.cxx
index 9c4727447c3f..af477725dc23 100644
--- a/svx/source/xoutdev/xattr.cxx
+++ b/svx/source/xoutdev/xattr.cxx
@@ -742,7 +742,7 @@ bool XLineDashItem::PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId )
css::drawing::LineDash aLineDash;
OUString aName;
bool bLineDash( false );
- for ( const auto& rProp : aPropSeq )
+ for ( const auto& rProp : std::as_const(aPropSeq) )
{
if ( rProp.Name == "Name" )
rProp.Value >>= aName;
@@ -2105,7 +2105,7 @@ bool XFillGradientItem::PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId
css::awt::Gradient aGradient2;
OUString aName;
bool bGradient( false );
- for ( const auto& rProp : aPropSeq )
+ for ( const auto& rProp : std::as_const(aPropSeq) )
{
if ( rProp.Name == "Name" )
rProp.Value >>= aName;
@@ -2498,7 +2498,7 @@ bool XFillHatchItem::PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId )
css::drawing::Hatch aUnoHatch;
OUString aName;
bool bHatch( false );
- for ( const auto& rProp : aPropSeq )
+ for ( const auto& rProp : std::as_const(aPropSeq) )
{
if ( rProp.Name == "Name" )
rProp.Value >>= aName;
diff --git a/svx/source/xoutdev/xattrbmp.cxx b/svx/source/xoutdev/xattrbmp.cxx
index bb284e903e36..448005de3879 100644
--- a/svx/source/xoutdev/xattrbmp.cxx
+++ b/svx/source/xoutdev/xattrbmp.cxx
@@ -265,7 +265,7 @@ bool XFillBitmapItem::PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId )
uno::Sequence< beans::PropertyValue > aPropSeq;
if( rVal >>= aPropSeq )
{
- for ( const auto& rProp : aPropSeq )
+ for ( const auto& rProp : std::as_const(aPropSeq) )
{
if ( rProp.Name == "Name" )
bSetName = (rProp.Value >>= aName);
commit c504780e7883e911916689c12709d64d78125422
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Thu Aug 15 13:56:26 2019 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Thu Aug 15 20:23:04 2019 +0200
loplugin:sequenceloop in starmath..svl
Change-Id: I473a8eec9cbf6d44b55ffd6f2233bf39cf6217da
Reviewed-on: https://gerrit.libreoffice.org/77528
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/starmath/source/cfgitem.cxx b/starmath/source/cfgitem.cxx
index 4636df044b08..a8f246423c21 100644
--- a/starmath/source/cfgitem.cxx
+++ b/starmath/source/cfgitem.cxx
@@ -559,7 +559,7 @@ void SmMathConfig::LoadFontFormatList()
else
pFontFormatList->Clear();
- Sequence< OUString > aNodes( GetNodeNames( FONT_FORMAT_LIST ) );
+ const Sequence< OUString > aNodes( GetNodeNames( FONT_FORMAT_LIST ) );
for (const OUString& rNode : aNodes)
{
diff --git a/starmath/source/unomodel.cxx b/starmath/source/unomodel.cxx
index 8f200542829e..c271f079d9d3 100644
--- a/starmath/source/unomodel.cxx
+++ b/starmath/source/unomodel.cxx
@@ -638,7 +638,7 @@ void SmModel::_setPropertyValues(const PropertyMapEntry** ppEntries, const Any*
SmModule *pp = SM_MOD();
SmSymbolManager &rManager = pp->GetSymbolManager();
- for (const SymbolDescriptor& rDescriptor : aSequence)
+ for (const SymbolDescriptor& rDescriptor : std::as_const(aSequence))
{
vcl::Font aFont;
aFont.SetFamilyName ( rDescriptor.sFontName );
diff --git a/stoc/source/defaultregistry/defaultregistry.cxx b/stoc/source/defaultregistry/defaultregistry.cxx
index 69cd40406944..bfa698b13b91 100644
--- a/stoc/source/defaultregistry/defaultregistry.cxx
+++ b/stoc/source/defaultregistry/defaultregistry.cxx
@@ -770,7 +770,7 @@ Sequence< Reference< XRegistryKey > > SAL_CALL NestedKeyImpl::openKeys( )
std::transform(localSeq.begin(), localSeq.end(), retSeq.begin(), lKeyNameToRegKey);
sal_uInt32 k = local;
- for (const auto& rDef : defaultSeq)
+ for (const auto& rDef : std::as_const(defaultSeq))
{
bool insert = std::none_of(retSeq.begin(), std::next(retSeq.begin(), local),
[&rDef](const Reference<XRegistryKey>& rKey) { return rKey->getKeyName() == rDef; });
diff --git a/stoc/source/implementationregistration/implreg.cxx b/stoc/source/implementationregistration/implreg.cxx
index 545e2cd6820b..c3d0f1e38820 100644
--- a/stoc/source/implementationregistration/implreg.cxx
+++ b/stoc/source/implementationregistration/implreg.cxx
@@ -91,7 +91,7 @@ void deleteAllLinkReferences(const Reference < XSimpleRegistry >& xReg,
if (!(xKey.is() && (xKey->getValueType() == RegistryValueType_ASCIILIST)))
return;
- Sequence<OUString> linkNames = xKey->getAsciiListValue();
+ const Sequence<OUString> linkNames = xKey->getAsciiListValue();
if (!linkNames.hasElements())
return;
@@ -216,7 +216,7 @@ OUString searchImplForLink(
Reference < XRegistryKey > xKey = xRootKey->openKey( slash_IMPLEMENTATIONS );
if (xKey.is())
{
- Sequence< Reference < XRegistryKey > > subKeys( xKey->openKeys() );
+ const Sequence< Reference < XRegistryKey > > subKeys( xKey->openKeys() );
OUString key_name( slash_UNO + linkName );
for (const Reference < XRegistryKey >& xImplKey : subKeys)
@@ -526,7 +526,7 @@ void prepareUserKeys(const Reference < XSimpleRegistry >& xDest,
}
} else
{
- Sequence< Reference < XRegistryKey> > subKeys = xKey->openKeys();
+ const Sequence< Reference < XRegistryKey> > subKeys = xKey->openKeys();
if (subKeys.hasElements())
{
@@ -581,7 +581,7 @@ void deleteAllImplementations( const Reference < XSimpleRegistry >& xReg,
{
bool hasLocationUrl = false;
- for (const Reference < XRegistryKey> & xImplKey : subKeys)
+ for (const Reference < XRegistryKey> & xImplKey : std::as_const(subKeys))
{
Reference < XRegistryKey > xKey = xImplKey->openKey(
slash_UNO_slash_LOCATION );
@@ -605,7 +605,7 @@ void deleteAllImplementations( const Reference < XSimpleRegistry >& xReg,
xKey = xImplKey->openKey( slash_UNO );
if (xKey.is())
{
- Sequence< Reference < XRegistryKey > > subKeys2 = xKey->openKeys();
+ const Sequence< Reference < XRegistryKey > > subKeys2 = xKey->openKeys();
for (const Reference < XRegistryKey > & rSubKey2 : subKeys2)
{
@@ -721,7 +721,7 @@ void deleteAllServiceEntries( const Reference < XSimpleRegistry >& xReg,
{
bool hasNoImplementations = false;
- for (const Reference < XRegistryKey > & xServiceKey : subKeys)
+ for (const Reference < XRegistryKey > & xServiceKey : std::as_const(subKeys))
{
if (xServiceKey->getValueType() == RegistryValueType_ASCIILIST)
{
@@ -902,7 +902,7 @@ void prepareRegistry(
Reference< XComponentContext > const & xContext )
// throw ( InvalidRegistryException, CannotRegisterImplementationException, RuntimeException )
{
- Sequence< Reference < XRegistryKey > > subKeys = xSource->openKeys();
+ const Sequence< Reference < XRegistryKey > > subKeys = xSource->openKeys();
if (!subKeys.hasElements())
{
@@ -918,7 +918,7 @@ void prepareRegistry(
if (xKey.is())
{
// update entries in SERVICES section
- Sequence< Reference < XRegistryKey > > serviceKeys = xKey->openKeys();
+ const Sequence< Reference < XRegistryKey > > serviceKeys = xKey->openKeys();
OUString implName = xImplKey->getKeyName().copy(1);
sal_Int32 firstDot = implName.indexOf('/');
@@ -941,7 +941,7 @@ void prepareRegistry(
xKey = xImplKey->openKey( slash_UNO );
if (xKey.is())
{
- Sequence< Reference < XRegistryKey > > subKeys2 = xKey->openKeys();
+ const Sequence< Reference < XRegistryKey > > subKeys2 = xKey->openKeys();
for (const Reference < XRegistryKey >& rSubKey2 : subKeys2)
{
@@ -976,7 +976,7 @@ void prepareRegistry(
if (xKey.is() && (xKey->getValueType() == RegistryValueType_ASCIILIST))
{
// update link entries in REGISTRY_LINKS section
- Sequence<OUString> linkNames = xKey->getAsciiListValue();
+ const Sequence<OUString> linkNames = xKey->getAsciiListValue();
for (const OUString& rLinkName : linkNames)
{
@@ -1020,7 +1020,7 @@ void findImplementations( const Reference < XRegistryKey > & xSource,
try
{
- Sequence< Reference < XRegistryKey > > subKeys = xSource->openKeys();
+ const Sequence< Reference < XRegistryKey > > subKeys = xSource->openKeys();
for (const Reference < XRegistryKey >& rSubKey : subKeys)
{
diff --git a/stoc/source/inspect/introspection.cxx b/stoc/source/inspect/introspection.cxx
index ecfd5684004e..b5cebfd268d5 100644
--- a/stoc/source/inspect/introspection.cxx
+++ b/stoc/source/inspect/introspection.cxx
@@ -1754,7 +1754,7 @@ css::uno::Reference<css::beans::XIntrospectionAccess> Implementation::inspect(
aClassSeq.realloc( nIfaceCount + 1 );
aClassSeq.getArray()[ nIfaceCount ] = xImplClass2;
- for( const Reference<XIdlClass>& rxIfaceClass : aClassSeq )
+ for( const Reference<XIdlClass>& rxIfaceClass : std::as_const(aClassSeq) )
{
if (!seen.insert(rxIfaceClass->getName()).second) {
continue;
@@ -1763,7 +1763,7 @@ css::uno::Reference<css::beans::XIntrospectionAccess> Implementation::inspect(
// 2. Register fields as properties
// Get fields
- Sequence< Reference<XIdlField> > fields = rxIfaceClass->getFields();
+ const Sequence< Reference<XIdlField> > fields = rxIfaceClass->getFields();
for( const Reference<XIdlField>& xField : fields )
{
@@ -2355,7 +2355,7 @@ css::uno::Reference<css::beans::XIntrospectionAccess> Implementation::inspect(
}
// Get fields
- Sequence< Reference<XIdlField> > fields = xClassRef->getFields();
+ const Sequence< Reference<XIdlField> > fields = xClassRef->getFields();
for( const Reference<XIdlField>& xField : fields )
{
diff --git a/stoc/source/servicemanager/servicemanager.cxx b/stoc/source/servicemanager/servicemanager.cxx
index 2af11198678a..880b478ec847 100644
--- a/stoc/source/servicemanager/servicemanager.cxx
+++ b/stoc/source/servicemanager/servicemanager.cxx
@@ -773,7 +773,7 @@ Reference< XInterface > OServiceManager::createInstanceWithContext(
}
#endif
- Sequence< Reference< XInterface > > factories(
+ const Sequence< Reference< XInterface > > factories(
queryServiceFactories( rServiceSpecifier, xContext ) );
for ( Reference< XInterface > const & xFactory : factories )
{
@@ -825,7 +825,7 @@ Reference< XInterface > OServiceManager::createInstanceWithArgumentsAndContext(
}
#endif
- Sequence< Reference< XInterface > > factories(
+ const Sequence< Reference< XInterface > > factories(
queryServiceFactories( rServiceSpecifier, xContext ) );
for ( Reference< XInterface > const & xFactory : factories )
{
@@ -1038,7 +1038,7 @@ void OServiceManager::insert( const Any & Element )
m_ImplementationNameMap[ aImplName ] = xEle;
//put into the service map
- Sequence< OUString > aServiceNames = xInfo->getSupportedServiceNames();
+ const Sequence< OUString > aServiceNames = xInfo->getSupportedServiceNames();
for( const OUString& rServiceName : aServiceNames )
{
m_ServiceMap.emplace(
@@ -1122,7 +1122,7 @@ void OServiceManager::remove( const Any & Element )
if( !xSF.is() )
return;
- Sequence< OUString > aServiceNames = xSF->getSupportedServiceNames();
+ const Sequence< OUString > aServiceNames = xSF->getSupportedServiceNames();
for( const OUString& rServiceName : aServiceNames )
{
pair<HashMultimap_OWString_Interface::iterator, HashMultimap_OWString_Interface::iterator> p =
@@ -1305,7 +1305,7 @@ Sequence<OUString> ORegistryServiceManager::getFromServiceName(
Reference<XInterface > ORegistryServiceManager::loadWithServiceName(
const OUString& serviceName, Reference< XComponentContext > const & xContext )
{
- Sequence<OUString> implEntries = getFromServiceName( serviceName );
+ const Sequence<OUString> implEntries = getFromServiceName( serviceName );
for (const auto& rEntry : implEntries)
{
Reference< XInterface > x( loadWithImplementationName( rEntry, xContext ) );
@@ -1411,7 +1411,7 @@ Reference<XEnumeration > ORegistryServiceManager::createContentEnumeration(
check_undisposed();
MutexGuard aGuard(m_mutex);
// get all implementation names registered under this service name from the registry
- Sequence<OUString> aImpls = getFromServiceName( aServiceName );
+ const Sequence<OUString> aImpls = getFromServiceName( aServiceName );
// load and insert all factories specified by the registry
for( const OUString& aImplName : aImpls )
{
diff --git a/svgio/qa/cppunit/SvgImportTest.cxx b/svgio/qa/cppunit/SvgImportTest.cxx
index be3f719ab1d2..501df9c21ea1 100644
--- a/svgio/qa/cppunit/SvgImportTest.cxx
+++ b/svgio/qa/cppunit/SvgImportTest.cxx
@@ -639,7 +639,7 @@ void Test::testBehaviourWhenWidthAndHeightIsOrIsNotSet()
// the container.
{
- Primitive2DSequence aSequence = parseSvg("svgio/qa/cppunit/data/Drawing_WithWidthHeight.svg");
+ const Primitive2DSequence aSequence = parseSvg("svgio/qa/cppunit/data/Drawing_WithWidthHeight.svg");
CPPUNIT_ASSERT(aSequence.hasElements());
geometry::RealRectangle2D aRealRect;
@@ -663,7 +663,7 @@ void Test::testBehaviourWhenWidthAndHeightIsOrIsNotSet()
}
{
- Primitive2DSequence aSequence = parseSvg("svgio/qa/cppunit/data/Drawing_NoWidthHeight.svg");
+ const Primitive2DSequence aSequence = parseSvg("svgio/qa/cppunit/data/Drawing_NoWidthHeight.svg");
CPPUNIT_ASSERT(aSequence.hasElements());
diff --git a/svl/source/items/grabbagitem.cxx b/svl/source/items/grabbagitem.cxx
index 191d7b35c74b..83c0323450ab 100644
--- a/svl/source/items/grabbagitem.cxx
+++ b/svl/source/items/grabbagitem.cxx
@@ -43,7 +43,7 @@ bool SfxGrabBagItem::PutValue(const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
if (rVal >>= aValue)
{
m_aMap.clear();
- for (beans::PropertyValue const& aPropertyValue : aValue)
+ for (beans::PropertyValue const& aPropertyValue : std::as_const(aValue))
{
m_aMap[aPropertyValue.Name] = aPropertyValue.Value;
}
diff --git a/svl/source/items/srchitem.cxx b/svl/source/items/srchitem.cxx
index 5443cc06539b..4fd9ead794af 100644
--- a/svl/source/items/srchitem.cxx
+++ b/svl/source/items/srchitem.cxx
@@ -508,7 +508,7 @@ bool SvxSearchItem::PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId )
if ( ( rVal >>= aSeq ) && ( aSeq.getLength() == SRCH_PARAMS ) )
{
sal_Int16 nConvertedCount( 0 );
- for ( const auto& rProp : aSeq )
+ for ( const auto& rProp : std::as_const(aSeq) )
{
if ( rProp.Name == SRCH_PARA_OPTIONS )
{
diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx
index bd35c725d5db..e862b45f5db4 100644
--- a/svl/source/numbers/zforlist.cxx
+++ b/svl/source/numbers/zforlist.cxx
@@ -2798,7 +2798,7 @@ void SvNumberFormatter::ImpGenerateAdditionalFormats( sal_uInt32 CLOffset,
// There is no harm though, on first invocation ImpGetDefaultFormat() will
// use the first default encountered.
aFormatSeq = rNumberFormatCode->getAllFormatCodes( aLocale );
- for ( const auto& rFormat : aFormatSeq )
+ for ( const auto& rFormat : std::as_const(aFormatSeq) )
{
if ( nPos - CLOffset >= SV_COUNTRY_LANGUAGE_OFFSET )
{
@@ -3842,7 +3842,7 @@ void SvNumberFormatter::ImpInitCurrencyTable()
std::make_unique<NfCurrencyEntry>(*pLocaleData, LANGUAGE_SYSTEM));
sal_uInt16 nCurrencyPos = 1;
- css::uno::Sequence< css::lang::Locale > xLoc = LocaleDataWrapper::getInstalledLocaleNames();
+ const css::uno::Sequence< css::lang::Locale > xLoc = LocaleDataWrapper::getInstalledLocaleNames();
sal_Int32 nLocaleCount = xLoc.getLength();
SAL_INFO( "svl.numbers", "number of locales: \"" << nLocaleCount << "\"" );
NfCurrencyTable &rCurrencyTable = theCurrencyTable::get();
diff --git a/svl/source/passwordcontainer/passwordcontainer.cxx b/svl/source/passwordcontainer/passwordcontainer.cxx
index 0c6c1b29abde..55f959cfc3a5 100644
--- a/svl/source/passwordcontainer/passwordcontainer.cxx
+++ b/svl/source/passwordcontainer/passwordcontainer.cxx
@@ -1091,7 +1091,7 @@ sal_Bool SAL_CALL PasswordContainer::changeMasterPassword( const uno::Reference<
if ( !aPass.isEmpty() )
{
// get all the persistent entries if it is possible
- Sequence< UrlRecord > aPersistent = getAllPersistent( uno::Reference< task::XInteractionHandler >() );
+ const Sequence< UrlRecord > aPersistent = getAllPersistent( uno::Reference< task::XInteractionHandler >() );
// remove the master password and the entries persistence
removeMasterPassword();
@@ -1194,7 +1194,7 @@ sal_Bool SAL_CALL PasswordContainer::useDefaultMasterPassword( const uno::Refere
if ( !aPass.isEmpty() )
{
// get all the persistent entries if it is possible
- Sequence< UrlRecord > aPersistent = getAllPersistent( uno::Reference< task::XInteractionHandler >() );
+ const Sequence< UrlRecord > aPersistent = getAllPersistent( uno::Reference< task::XInteractionHandler >() );
// remove the master password and the entries persistence
removeMasterPassword();
commit 56a9a3a2d7f64c277b3dadd5a910a1183a47ac69
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Thu Aug 15 13:12:30 2019 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Thu Aug 15 20:22:51 2019 +0200
loplugin:sequenceloop in sdext..sfx2
Change-Id: If9924566b21e50cad7a12d781ac5d337de0684ab
Reviewed-on: https://gerrit.libreoffice.org/77526
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/sdext/source/minimizer/fileopendialog.cxx b/sdext/source/minimizer/fileopendialog.cxx
index 5afe2165f17e..2ca2f4ec483d 100644
--- a/sdext/source/minimizer/fileopendialog.cxx
+++ b/sdext/source/minimizer/fileopendialog.cxx
@@ -72,7 +72,7 @@ FileOpenDialog::FileOpenDialog( const Reference< XComponentContext >& rxContext
// collecting a list of impress filters
Reference< XNameAccess > xFilters( rxContext->getServiceManager()->createInstanceWithContext(
"com.sun.star.document.FilterFactory", rxContext ), UNO_QUERY_THROW );
- Sequence< OUString > aFilterList( xFilters->getElementNames() );
+ const Sequence< OUString > aFilterList( xFilters->getElementNames() );
for ( const auto& rFilter : aFilterList )
{
try
@@ -82,7 +82,7 @@ FileOpenDialog::FileOpenDialog( const Reference< XComponentContext >& rxContext
{
FilterEntry aFilterEntry;
bool bImpressFilter = false;
- for ( const PropertyValue& rProperty : aFilterProperties )
+ for ( const PropertyValue& rProperty : std::as_const(aFilterProperties) )
{
bool bStop = false;
switch( TKGet( rProperty.Name ) )
diff --git a/sdext/source/minimizer/impoptimizer.cxx b/sdext/source/minimizer/impoptimizer.cxx
index ab92521a569f..e801d3816355 100644
--- a/sdext/source/minimizer/impoptimizer.cxx
+++ b/sdext/source/minimizer/impoptimizer.cxx
@@ -591,7 +591,7 @@ void ImpOptimizer::Optimize( const Sequence< PropertyValue >& rArguments )
{
css::uno::Sequence< css::beans::PropertyValue > aSettings;
rArgument.Value >>= aSettings;
- for ( const auto& rSetting : aSettings )
+ for ( const auto& rSetting : std::as_const(aSettings) )
{
switch( TKGet( rSetting.Name ) )
{
diff --git a/sdext/source/minimizer/pagecollector.cxx b/sdext/source/minimizer/pagecollector.cxx
index 7bed0b56ec24..b1673a18866b 100644
--- a/sdext/source/minimizer/pagecollector.cxx
+++ b/sdext/source/minimizer/pagecollector.cxx
@@ -44,7 +44,7 @@ void PageCollector::CollectCustomShowPages( const css::uno::Reference< css::fram
if ( aXCont.is() )
{
// creating a list of every page that is used within our customshow
- Sequence< OUString> aNameSeq( aXCont->getElementNames() );
+ const Sequence< OUString> aNameSeq( aXCont->getElementNames() );
for ( OUString const & i :aNameSeq )
{
if ( i == rCustomShowName )
diff --git a/sdext/source/presenter/PresenterConfigurationAccess.cxx b/sdext/source/presenter/PresenterConfigurationAccess.cxx
index 1331addbffa1..12bd8496960b 100644
--- a/sdext/source/presenter/PresenterConfigurationAccess.cxx
+++ b/sdext/source/presenter/PresenterConfigurationAccess.cxx
@@ -181,7 +181,7 @@ void PresenterConfigurationAccess::ForAll (
return;
::std::vector<Any> aValues(rArguments.size());
- Sequence<OUString> aKeys (rxContainer->getElementNames());
+ const Sequence<OUString> aKeys (rxContainer->getElementNames());
for (const OUString& rsKey : aKeys)
{
bool bHasAllValues (true);
@@ -213,7 +213,7 @@ void PresenterConfigurationAccess::ForAll (
{
if (rxContainer.is())
{
- Sequence<OUString> aKeys (rxContainer->getElementNames());
+ const Sequence<OUString> aKeys (rxContainer->getElementNames());
for (const OUString& rsKey : aKeys)
{
Reference<beans::XPropertySet> xSet (rxContainer->getByName(rsKey), UNO_QUERY);
@@ -229,7 +229,7 @@ Any PresenterConfigurationAccess::Find (
{
if (rxContainer.is())
{
- Sequence<OUString> aKeys (rxContainer->getElementNames());
+ const Sequence<OUString> aKeys (rxContainer->getElementNames());
for (const auto& rKey : aKeys)
{
Reference<beans::XPropertySet> xProperties (
diff --git a/sdext/source/presenter/PresenterTheme.cxx b/sdext/source/presenter/PresenterTheme.cxx
index 53522ec77e1a..d35bc828437c 100644
--- a/sdext/source/presenter/PresenterTheme.cxx
+++ b/sdext/source/presenter/PresenterTheme.cxx
@@ -758,7 +758,7 @@ std::shared_ptr<PresenterTheme::Theme> ReadContext::ReadTheme (
if (xThemes.is())
{
// Iterate over all themes and search the one with the given name.
- Sequence<OUString> aKeys (xThemes->getElementNames());
+ const Sequence<OUString> aKeys (xThemes->getElementNames());
for (const OUString& rsKey : aKeys)
{
Reference<container::XHierarchicalNameAccess> xTheme (
diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx
index 1c778623b51f..fde6a67522d3 100644
--- a/sfx2/source/appl/appopen.cxx
+++ b/sfx2/source/appl/appopen.cxx
@@ -866,7 +866,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
// get registered protocol handlers from configuration
Reference < XNameAccess > xAccess(officecfg::Office::ProtocolHandler::HandlerSet::get());
- Sequence < OUString > aNames = xAccess->getElementNames();
+ const Sequence < OUString > aNames = xAccess->getElementNames();
for ( const auto& rName : aNames )
{
Reference < XPropertySet > xSet;
diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx
index fc9c5b08fc52..88a2cd388c16 100644
--- a/sfx2/source/appl/appserv.cxx
+++ b/sfx2/source/appl/appserv.cxx
@@ -895,7 +895,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
}
// Backup visible toolbar list and hide all toolbars
- Sequence<Reference<XUIElement>> aUIElements = xLayoutManager->getElements();
+ const Sequence<Reference<XUIElement>> aUIElements = xLayoutManager->getElements();
for ( const Reference< XUIElement >& xUIElement : aUIElements )
{
Reference< XPropertySet > xPropertySet( xUIElement, UNO_QUERY );
diff --git a/sfx2/source/appl/fileobj.cxx b/sfx2/source/appl/fileobj.cxx
index 799fbb2ffdbb..2c42c5a59e33 100644
--- a/sfx2/source/appl/fileobj.cxx
+++ b/sfx2/source/appl/fileobj.cxx
@@ -225,7 +225,7 @@ static OUString impl_getFilter( const OUString& _rURL )
if ( !sType.isEmpty() )
{
// Honor a selected/detected filter.
- for (const auto& rDescr : aDescrList)
+ for (const auto& rDescr : std::as_const(aDescrList))
{
if (rDescr.Name == "FilterName")
{
diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx
index a491d3ec02a2..2019b5fe8972 100644
--- a/sfx2/source/appl/newhelp.cxx
+++ b/sfx2/source/appl/newhelp.cxx
@@ -1116,7 +1116,7 @@ bool SearchTabPage_Impl::OpenKeyword( const OUString& rKeyword )
static void GetBookmarkEntry_Impl
(
- Sequence< PropertyValue >& aBookmarkEntry,
+ const Sequence< PropertyValue >& aBookmarkEntry,
OUString& rTitle,
OUString& rURL
)
diff --git a/sfx2/source/bastyp/fltfnc.cxx b/sfx2/source/bastyp/fltfnc.cxx
index b5970c7ac874..1fec7f92d379 100644
--- a/sfx2/source/bastyp/fltfnc.cxx
+++ b/sfx2/source/bastyp/fltfnc.cxx
@@ -434,7 +434,7 @@ ErrCode SfxFilterMatcher::GuessFilterControlDefaultUI( SfxMedium& rMedium, std:
uno::Sequence< beans::PropertyValue > lDescriptor = aDescriptor.getAsConstPropertyValueList();
sTypeName = xDetection->queryTypeByDescriptor(lDescriptor, true); // lDescriptor is used as In/Out param ... don't use aDescriptor.getAsConstPropertyValueList() directly!
- for (const auto& rProp : lDescriptor)
+ for (const auto& rProp : std::as_const(lDescriptor))
{
if (rProp.Name == "FilterName")
// Type detection picked a preferred filter for this format.
@@ -926,7 +926,7 @@ void SfxFilterContainer::ReadSingleFilter_Impl(
bool bEnabled = true ;
// first get directly available properties
- for( const auto& rFilterProperty : lFilterProperties )
+ for( const auto& rFilterProperty : std::as_const(lFilterProperties) )
{
if ( rFilterProperty.Name == "FileFormatVersion" )
{
@@ -982,7 +982,7 @@ void SfxFilterContainer::ReadSingleFilter_Impl(
if( aResult >>= lTypeProperties )
{
// get indirect available properties then (types)
- for( const auto& rTypeProperty : lTypeProperties )
+ for( const auto& rTypeProperty : std::as_const(lTypeProperties) )
{
if ( rTypeProperty.Name == "ClipboardFormat" )
{
@@ -1104,7 +1104,7 @@ void SfxFilterContainer::ReadFilters_Impl( bool bUpdate )
if( xFilterCFG.is() && xTypeCFG.is() )
{
// select right query to get right set of filters for search module
- uno::Sequence< OUString > lFilterNames = xFilterCFG->getElementNames();
+ const uno::Sequence< OUString > lFilterNames = xFilterCFG->getElementNames();
if ( lFilterNames.hasElements() )
{
// If list of filters already exist ...
diff --git a/sfx2/source/bastyp/frmhtmlw.cxx b/sfx2/source/bastyp/frmhtmlw.cxx
index 0cff220f48ae..c1e4063dffd6 100644
--- a/sfx2/source/bastyp/frmhtmlw.cxx
+++ b/sfx2/source/bastyp/frmhtmlw.cxx
@@ -211,7 +211,7 @@ void SfxFrameHTMLWriter::Out_DocInfo( SvStream& rStrm, const OUString& rBaseURL,
uno::Reference<beans::XPropertySetInfo> xPropInfo =
xUserDefinedProps->getPropertySetInfo();
DBG_ASSERT(xPropInfo.is(), "UserDefinedProperties Info is null");
- uno::Sequence<beans::Property> props = xPropInfo->getProperties();
+ const uno::Sequence<beans::Property> props = xPropInfo->getProperties();
for (const auto& rProp : props)
{
try
diff --git a/sfx2/source/control/recentdocsview.cxx b/sfx2/source/control/recentdocsview.cxx
index 96dbd90b1fb3..414f1236ce9f 100644
--- a/sfx2/source/control/recentdocsview.cxx
+++ b/sfx2/source/control/recentdocsview.cxx
@@ -235,7 +235,7 @@ void RecentDocsView::Reload()
Sequence< Sequence< PropertyValue > > aHistoryList = SvtHistoryOptions().GetList( ePICKLIST );
for ( int i = 0; i < aHistoryList.getLength(); i++ )
{
- Sequence< PropertyValue >& rRecentEntry = aHistoryList[i];
+ const Sequence< PropertyValue >& rRecentEntry = aHistoryList[i];
OUString aURL;
OUString aTitle;
diff --git a/sfx2/source/control/shell.cxx b/sfx2/source/control/shell.cxx
index abdb828d7721..ca312f61a0d9 100644
--- a/sfx2/source/control/shell.cxx
+++ b/sfx2/source/control/shell.cxx
@@ -601,7 +601,7 @@ void SfxShell::VerbExec(SfxRequest& rReq)
return;
bool bReadOnly = pViewShell->GetObjectShell()->IsReadOnly();
- css::uno::Sequence < css::embed::VerbDescriptor > aList = pViewShell->GetVerbs();
+ const css::uno::Sequence < css::embed::VerbDescriptor > aList = pViewShell->GetVerbs();
sal_Int32 nVerb = 0;
for (const auto& rVerb : aList)
{
diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index 9588ff61d551..6908f64aaa61 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -958,7 +958,8 @@ void SfxDispatchController_Impl::StateChanged( sal_uInt16 nSID, SfxItemState eSt
InterceptLOKStateChangeEvent(pDispatcher->GetFrame(), aEvent, pState);
}
- for (const OUString& rName: pDispatch->GetListeners().getContainedTypes())
+ const css::uno::Sequence<OUString> aContainedTypes = pDispatch->GetListeners().getContainedTypes();
+ for (const OUString& rName: aContainedTypes)
{
if (rName == aDispatchURL.Main || rName == aDispatchURL.Complete)
sendStatusChanged(rName, aEvent);
diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index 34d685e61128..011135fab81b 100644
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -1028,7 +1028,7 @@ void SfxDocumentPage::Reset( const SfxItemSet* rSet )
// Check for cmis properties where otherwise unavailable
if ( rInfoItem.isCmisDocument( ) )
{
- uno::Sequence< document::CmisProperty > aCmisProps = rInfoItem.GetCmisProperties();
+ const uno::Sequence< document::CmisProperty > aCmisProps = rInfoItem.GetCmisProperties();
for ( const auto& rCmisProp : aCmisProps )
{
if ( rCmisProp.Id == "cmis:contentStreamLength" &&
@@ -1879,7 +1879,7 @@ IMPL_LINK_NOARG(SfxCustomPropertiesPage, AddHdl, weld::Button&, void)
// indeed the info are deleted by ClearCustomProperties
// each time SfxDocumentInfoItem destructor is called
SfxDocumentInfoItem pInfo;
- Sequence< beans::PropertyValue > aPropertySeq = m_xPropertiesCtrl->GetCustomProperties();
+ const Sequence< beans::PropertyValue > aPropertySeq = m_xPropertiesCtrl->GetCustomProperties();
for ( const auto& rProperty : aPropertySeq )
{
if ( !rProperty.Name.isEmpty() )
@@ -1920,7 +1920,7 @@ bool SfxCustomPropertiesPage::FillItemSet( SfxItemSet* rSet )
}
pInfo->ClearCustomProperties();
- Sequence< beans::PropertyValue > aPropertySeq = m_xPropertiesCtrl->GetCustomProperties();
+ const Sequence< beans::PropertyValue > aPropertySeq = m_xPropertiesCtrl->GetCustomProperties();
for ( const auto& rProperty : aPropertySeq )
{
if ( !rProperty.Name.isEmpty() )
@@ -2049,7 +2049,7 @@ void CmisPropertiesWindow::AddLine( const OUString& sId, const OUString& sName,
Sequence< sal_Int64 > seqValue;
rAny >>= seqValue;
sal_uInt32 nIndex = m_aNumberFormatter.GetFormatIndex( NF_NUMBER_SYSTEM );
- for ( const auto& rValue : seqValue )
+ for ( const auto& rValue : std::as_const(seqValue) )
{
OUString sValue;
m_aNumberFormatter.GetInputLineString( rValue, nIndex, sValue );
@@ -2063,7 +2063,7 @@ void CmisPropertiesWindow::AddLine( const OUString& sId, const OUString& sName,
Sequence< double > seqValue;
rAny >>= seqValue;
sal_uInt32 nIndex = m_aNumberFormatter.GetFormatIndex( NF_NUMBER_SYSTEM );
- for ( const auto& rValue : seqValue )
+ for ( const auto& rValue : std::as_const(seqValue) )
{
OUString sValue;
m_aNumberFormatter.GetInputLineString( rValue, nIndex, sValue );
@@ -2077,7 +2077,7 @@ void CmisPropertiesWindow::AddLine( const OUString& sId, const OUString& sName,
{
Sequence<sal_Bool> seqValue;
rAny >>= seqValue;
- for ( const auto& rValue : seqValue )
+ for ( const auto& rValue : std::as_const(seqValue) )
{
std::unique_ptr<CmisYesNo> pYesNo(new CmisYesNo(m_xBox.get(), rValue));
pYesNo->m_xYesButton->set_sensitive( bUpdatable );
@@ -2089,7 +2089,7 @@ void CmisPropertiesWindow::AddLine( const OUString& sId, const OUString& sName,
{
Sequence< OUString > seqValue;
rAny >>= seqValue;
- for ( const auto& rValue : seqValue )
+ for ( const auto& rValue : std::as_const(seqValue) )
{
std::unique_ptr<CmisValue> pValue(new CmisValue(m_xBox.get(), rValue));
pValue->m_xValueEdit->set_editable(bUpdatable);
@@ -2100,7 +2100,7 @@ void CmisPropertiesWindow::AddLine( const OUString& sId, const OUString& sName,
{
Sequence< util::DateTime > seqValue;
rAny >>= seqValue;
- for ( const auto& rValue : seqValue )
+ for ( const auto& rValue : std::as_const(seqValue) )
{
std::unique_ptr<CmisDateTime> pDateTime(new CmisDateTime(m_xBox.get(), rValue));
pDateTime->m_xDateField->set_sensitive(bUpdatable);
diff --git a/sfx2/source/dialog/dockwin.cxx b/sfx2/source/dialog/dockwin.cxx
index d38a361b5a2a..faa103d55e04 100644
--- a/sfx2/source/dialog/dockwin.cxx
+++ b/sfx2/source/dialog/dockwin.cxx
@@ -102,7 +102,7 @@ static bool lcl_getWindowState( const uno::Reference< container::XNameAccess >&
a = xWindowStateMgr->getByName( rResourceURL );
if ( a >>= aWindowState )
{
- for ( const auto& rProp : aWindowState )
+ for ( const auto& rProp : std::as_const(aWindowState) )
{
if ( rProp.Name == "UIName" )
{
diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx
index 198043cac4a9..402923c8dfa1 100644
--- a/sfx2/source/dialog/filedlghelper.cxx
+++ b/sfx2/source/dialog/filedlghelper.cxx
@@ -410,7 +410,7 @@ bool FileDialogHelper_Impl::CheckFilterOptionsCapability( const std::shared_ptr<
if ( aAny >>= aProps )
{
OUString aServiceName;
- for( const auto& rProp : aProps )
+ for( const auto& rProp : std::as_const(aProps) )
{
if( rProp.Name == "UIComponent" )
{
diff --git a/sfx2/source/dialog/mailmodel.cxx b/sfx2/source/dialog/mailmodel.cxx
index 31ee48bf6e0b..901c435f6d94 100644
--- a/sfx2/source/dialog/mailmodel.cxx
+++ b/sfx2/source/dialog/mailmodel.cxx
@@ -146,7 +146,7 @@ SfxMailModel::SaveResult SfxMailModel::ShowFilterOptionsDialog(
if ( aAny >>= aProps )
{
- for( const auto& rProp : aProps )
+ for( const auto& rProp : std::as_const(aProps) )
{
if( rProp.Name == "UIComponent" )
{
diff --git a/sfx2/source/doc/docfac.cxx b/sfx2/source/doc/docfac.cxx
index 43514b1bc68e..07631e90c76e 100644
--- a/sfx2/source/doc/docfac.cxx
+++ b/sfx2/source/doc/docfac.cxx
@@ -176,7 +176,7 @@ void SfxObjectFactory::SetSystemTemplate( const OUString& rServiceName, const OU
OUString aActualFilterTypeName;
uno::Sequence< beans::PropertyValue > aActuralFilterData;
xFilterFactory->getByName( aActualFilter ) >>= aActuralFilterData;
- for ( const auto& rProp : aActuralFilterData )
+ for ( const auto& rProp : std::as_const(aActuralFilterData) )
if ( rProp.Name == "Type" )
rProp.Value >>= aActualFilterTypeName;
::comphelper::SequenceAsHashMap aProps1( xTypeDetection->getByName( aActualFilterTypeName ) );
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index f2782b99de40..a78cacb43d13 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -3501,7 +3501,7 @@ void SfxMedium::AddVersion_Impl( util::RevisionTag& rRevision )
// To determine a unique name for the stream
std::vector<sal_uInt32> aLongs;
sal_Int32 nLength = pImpl->aVersions.getLength();
- for ( const auto& rVersion : pImpl->aVersions )
+ for ( const auto& rVersion : std::as_const(pImpl->aVersions) )
{
sal_uInt32 nVer = static_cast<sal_uInt32>( rVersion.Identifier.copy(7).toInt32());
size_t n;
diff --git a/sfx2/source/doc/docinf.cxx b/sfx2/source/doc/docinf.cxx
index 71dbff9a64ed..d14b2af5adc9 100644
--- a/sfx2/source/doc/docinf.cxx
+++ b/sfx2/source/doc/docinf.cxx
@@ -273,7 +273,7 @@ bool SaveOlePropertySet(
uno::Reference<beans::XPropertySetInfo> xPropInfo =
xUserDefinedProps->getPropertySetInfo();
DBG_ASSERT(xPropInfo.is(), "UserDefinedProperties Info is null");
- uno::Sequence<beans::Property> props = xPropInfo->getProperties();
+ const uno::Sequence<beans::Property> props = xPropInfo->getProperties();
for (const auto& rProp : props)
{
try
diff --git a/sfx2/source/doc/docmacromode.cxx b/sfx2/source/doc/docmacromode.cxx
index d43c1b1be065..13954b06f6d8 100644
--- a/sfx2/source/doc/docmacromode.cxx
+++ b/sfx2/source/doc/docmacromode.cxx
@@ -310,7 +310,7 @@ namespace sfx2
{
const OUString aStdLibName( "Standard" );
const OUString aVBAProject( "VBAProject" );
- Sequence< OUString > aElements = xContainer->getElementNames();
+ const Sequence< OUString > aElements = xContainer->getElementNames();
for( const OUString& aElement : aElements )
{
if( aElement == aStdLibName || aElement == aVBAProject )
diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx
index 6780825e7dcd..c30544803603 100644
--- a/sfx2/source/doc/doctemplates.cxx
+++ b/sfx2/source/doc/doctemplates.cxx
@@ -1766,7 +1766,7 @@ bool SfxDocTplService_Impl::storeTemplate( const OUString& rGroupName,
uno::Sequence< beans::PropertyValue > aFilterData;
xFilterFactory->getByName( aFilterName ) >>= aFilterData;
OUString aTypeName;
- for ( const auto& rProp : aFilterData )
+ for ( const auto& rProp : std::as_const(aFilterData) )
if ( rProp.Name == "Type" )
rProp.Value >>= aTypeName;
diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx
index 8dec12dda161..f875591e0a50 100644
--- a/sfx2/source/doc/guisaveas.cxx
+++ b/sfx2/source/doc/guisaveas.cxx
@@ -606,7 +606,7 @@ bool ModelData_Impl::ExecuteFilterDialog_Impl( const OUString& aFilterName )
sal_uInt32(ERRCODE_IO_ABORT));
}
- uno::Sequence< beans::PropertyValue > aPropsFromDialog =
+ const uno::Sequence< beans::PropertyValue > aPropsFromDialog =
xFilterProperties->getPropertyValues();
for ( const auto& rProp : aPropsFromDialog )
GetMediaDescr()[rProp.Name] = rProp.Value;
@@ -1734,7 +1734,7 @@ void SfxStoringHelper::SetDocInfoState(
xDocPropsToFill->getUserDefinedProperties(), uno::UNO_QUERY);
uno::Reference< beans::XPropertyContainer > xContainer( xSet, uno::UNO_QUERY );
uno::Reference< beans::XPropertySetInfo > xSetInfo = xSet->getPropertySetInfo();
- uno::Sequence< beans::Property > lProps = xSetInfo->getProperties();
+ const uno::Sequence< beans::Property > lProps = xSetInfo->getProperties();
for (const beans::Property& rProp : lProps)
{
uno::Any aValue = xPropSet->getPropertyValue( rProp.Name );
diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index a61e1e8b42e1..6fc2027bc2df 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -258,7 +258,7 @@ bool SfxObjectShell::IsModified()
if (pImpl->mpObjectContainer)
{
- uno::Sequence < OUString > aNames = GetEmbeddedObjectContainer().GetObjectNames();
+ const uno::Sequence < OUString > aNames = GetEmbeddedObjectContainer().GetObjectNames();
for ( const auto& rName : aNames )
{
uno::Reference < embed::XEmbeddedObject > xObj = GetEmbeddedObjectContainer().GetEmbeddedObject( rName );
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index 69e106319b16..8cc196c015ce 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -1127,7 +1127,7 @@ void SfxObjectShell::GetState_Impl(SfxItemSet &rSet)
{
bool bShow = false;
Reference< XCmisDocument > xCmisDoc( GetModel(), uno::UNO_QUERY );
- uno::Sequence< document::CmisProperty> aCmisProperties = xCmisDoc->getCmisProperties();
+ const uno::Sequence< document::CmisProperty> aCmisProperties = xCmisDoc->getCmisProperties();
if ( xCmisDoc->isVersionable( ) && aCmisProperties.hasElements( ) )
{
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 82653292a818..6a659b5242a8 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -1439,7 +1439,7 @@ bool SfxObjectShell::SaveTo_Impl
{
try
{
- Sequence < util::RevisionTag > aVersions = rMedium.GetVersionList();
+ const Sequence < util::RevisionTag > aVersions = rMedium.GetVersionList();
if ( aVersions.hasElements() )
{
// copy the version streams
@@ -2225,7 +2225,7 @@ bool SfxObjectShell::ImportFrom(SfxMedium& rMedium,
// #i119492# During loading, some OLE objects like chart will be set
// modified flag, so needs to reset the flag to false after loading
bool bRtn = xLoader->filter( aArgs );
- uno::Sequence < OUString > aNames = GetEmbeddedObjectContainer().GetObjectNames();
+ const uno::Sequence < OUString > aNames = GetEmbeddedObjectContainer().GetObjectNames();
for ( const auto& rName : aNames )
{
uno::Reference < embed::XEmbeddedObject > xObj = GetEmbeddedObjectContainer().GetEmbeddedObject( rName );
@@ -3141,7 +3141,7 @@ bool SfxObjectShell::SaveCompletedChildren()
if ( pImpl->mpObjectContainer )
{
- uno::Sequence < OUString > aNames = GetEmbeddedObjectContainer().GetObjectNames();
+ const uno::Sequence < OUString > aNames = GetEmbeddedObjectContainer().GetObjectNames();
for ( const auto& rName : aNames )
{
uno::Reference < embed::XEmbeddedObject > xObj = GetEmbeddedObjectContainer().GetEmbeddedObject( rName );
@@ -3248,7 +3248,7 @@ static bool StoragesOfUnknownMediaTypeAreCopied_Impl( const uno::Reference< embe
try
{
- uno::Sequence< OUString > aSubElements = xSource->getElementNames();
+ const uno::Sequence< OUString > aSubElements = xSource->getElementNames();
for ( const auto& rSubElement : aSubElements )
{
if ( xSource->isStorageElement( rSubElement ) )
@@ -3370,7 +3370,8 @@ bool SfxObjectShell::CopyStoragesOfUnknownMediaType(const uno::Reference< embed:
try
{
- for (const OUString& rSubElement : xSource->getElementNames())
+ const css::uno::Sequence<OUString> aSubElementNames = xSource->getElementNames();
+ for (const OUString& rSubElement : aSubElementNames)
{
if (std::find(rExceptions.begin(), rExceptions.end(), rSubElement) != rExceptions.end())
continue;
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index 7742d5edbc91..4ef95f9aa672 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -1021,7 +1021,7 @@ Sequence< beans::PropertyValue > SAL_CALL SfxBaseModel::getArgs()
Sequence< beans::PropertyValue > aFinalCache;
sal_Int32 nFinalLength = 0;
- for ( const auto& rOrg : m_pData->m_seqArguments )
+ for ( const auto& rOrg : std::as_const(m_pData->m_seqArguments) )
{
auto bNew = std::none_of(seqArgsOld.begin(), seqArgsOld.end(),
[&rOrg](const beans::PropertyValue& rOld){ return rOld.Name == rOrg.Name; });
@@ -3316,7 +3316,7 @@ Sequence< OUString > SAL_CALL SfxBaseModel::getDocumentSubStoragesNames()
Reference < embed::XStorage > xStorage = m_pData->m_pObjectShell->GetStorage();
if ( xStorage.is() )
{
- Sequence< OUString > aTemp = xStorage->getElementNames();
+ const Sequence< OUString > aTemp = xStorage->getElementNames();
sal_Int32 nResultSize = 0;
for ( const auto& rName : aTemp )
{
diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index ee00f17da016..300af208d924 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -900,7 +900,7 @@ void SfxTemplateManagerDlg::OnTemplateImportCategory(const OUString& sCategory)
if ( nCode != ERRCODE_NONE )
return;
- css::uno::Sequence<OUString> aFiles = aFileDlg.GetSelectedFiles();
+ const css::uno::Sequence<OUString> aFiles = aFileDlg.GetSelectedFiles();
if (!aFiles.hasElements())
return;
diff --git a/sfx2/source/doc/watermarkitem.cxx b/sfx2/source/doc/watermarkitem.cxx
index d6978ff153d9..e672fc838c87 100644
--- a/sfx2/source/doc/watermarkitem.cxx
+++ b/sfx2/source/doc/watermarkitem.cxx
@@ -60,7 +60,7 @@ bool SfxWatermarkItem::PutValue( const css::uno::Any& rVal, sal_uInt8 /*nMemberI
if ( rVal >>= aSequence )
{
- for(const auto& aEntry : aSequence)
+ for(const auto& aEntry : std::as_const(aSequence))
{
if(aEntry.Name == "Text")
aEntry.Value >>= m_aText;
diff --git a/sfx2/source/doc/zoomitem.cxx b/sfx2/source/doc/zoomitem.cxx
index 474ea51f68c6..4ae3c3547eab 100644
--- a/sfx2/source/doc/zoomitem.cxx
+++ b/sfx2/source/doc/zoomitem.cxx
@@ -108,7 +108,7 @@ bool SvxZoomItem::PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId )
sal_Int16 nTypeTmp( 0 );
bool bAllConverted( true );
sal_Int16 nConvertedCount( 0 );
- for ( const auto& rProp : aSeq )
+ for ( const auto& rProp : std::as_const(aSeq) )
{
if ( rProp.Name == ZOOM_PARAM_VALUE )
{
diff --git a/sfx2/source/inet/inettbc.cxx b/sfx2/source/inet/inettbc.cxx
index 68d862eeced6..f126f4218a1a 100644
--- a/sfx2/source/inet/inettbc.cxx
+++ b/sfx2/source/inet/inettbc.cxx
@@ -205,7 +205,7 @@ void SfxURLToolBoxControl_Impl::StateChanged
SvtURLBox* pURLBox = GetURLBox();
pURLBox->Clear();
- css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > > lList = SvtHistoryOptions().GetList(ePICKLIST);
+ const css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > > lList = SvtHistoryOptions().GetList(ePICKLIST);
for (const css::uno::Sequence< css::beans::PropertyValue >& lProps : lList)
{
for (const auto& rProp : lProps)
diff --git a/sfx2/source/notebookbar/NotebookbarTabControl.cxx b/sfx2/source/notebookbar/NotebookbarTabControl.cxx
index 66ece2417be2..f9dd28131e11 100644
--- a/sfx2/source/notebookbar/NotebookbarTabControl.cxx
+++ b/sfx2/source/notebookbar/NotebookbarTabControl.cxx
@@ -304,7 +304,7 @@ void NotebookbarTabControl::FillShortcutsToolBox(Reference<XComponentContext> co
sal_uInt16 nType = ItemType::DEFAULT;
bool bVisible = true;
- for ( const auto& aProp: aPropSequence )
+ for ( const auto& aProp: std::as_const(aPropSequence) )
{
if ( aProp.Name == "CommandURL" )
aProp.Value >>= aCommandURL;
diff --git a/sfx2/source/notebookbar/SfxNotebookBar.cxx b/sfx2/source/notebookbar/SfxNotebookBar.cxx
index eafa8d955da6..4bdce004ad91 100644
--- a/sfx2/source/notebookbar/SfxNotebookBar.cxx
+++ b/sfx2/source/notebookbar/SfxNotebookBar.cxx
@@ -55,7 +55,7 @@ static void NotebookbarAddonValues(
for (int nIdx = 0; nIdx < aAddonsItems.GetAddonsNotebookBarCount(); nIdx++)
{
- css::uno::Sequence<css::uno::Sequence<css::beans::PropertyValue>> aExtension
+ const css::uno::Sequence<css::uno::Sequence<css::beans::PropertyValue>> aExtension
= aAddonsItems.GetAddonsNotebookBarPart(nIdx);
for (const css::uno::Sequence<css::beans::PropertyValue>& rExtensionVal : aExtension)
{
diff --git a/sfx2/source/notify/eventsupplier.cxx b/sfx2/source/notify/eventsupplier.cxx
index fffe1fe39de0..e21130d6022c 100644
--- a/sfx2/source/notify/eventsupplier.cxx
+++ b/sfx2/source/notify/eventsupplier.cxx
@@ -192,7 +192,7 @@ void SfxEvents_Impl::Execute( uno::Any const & aEventData, const document::Docum
if ( !aProperties.hasElements() )
return;
- for ( const auto& rProp : aProperties )
+ for ( const auto& rProp : std::as_const(aProperties) )
{
if ( rProp.Name == PROP_EVENT_TYPE )
rProp.Value >>= aType;
@@ -348,7 +348,7 @@ std::unique_ptr<SvxMacro> SfxEvents_Impl::ConvertToMacro( const uno::Any& rEleme
if ( !aProperties.hasElements() )
return pMacro;
- for ( const auto& rProp : aProperties )
+ for ( const auto& rProp : std::as_const(aProperties) )
{
if ( rProp.Name == PROP_EVENT_TYPE )
rProp.Value >>= aType;
diff --git a/sfx2/source/sidebar/ResourceManager.cxx b/sfx2/source/sidebar/ResourceManager.cxx
index 9c6f7f1f442a..587d260ebd5a 100644
--- a/sfx2/source/sidebar/ResourceManager.cxx
+++ b/sfx2/source/sidebar/ResourceManager.cxx
@@ -484,7 +484,7 @@ void ResourceManager::ReadContextList (
if (!(aValue >>= aValues))
return;
- for (const OUString& sValue : aValues)
+ for (const OUString& sValue : std::as_const(aValues))
{
sal_Int32 nCharacterIndex (0);
const OUString sApplicationName (sValue.getToken(0, ',', nCharacterIndex).trim());
diff --git a/sfx2/source/view/classificationhelper.cxx b/sfx2/source/view/classificationhelper.cxx
index db1f0090c4ec..6102879c3d6d 100644
--- a/sfx2/source/view/classificationhelper.cxx
+++ b/sfx2/source/view/classificationhelper.cxx
@@ -482,7 +482,7 @@ bool SfxClassificationHelper::IsClassified(const uno::Reference<document::XDocum
return false;
uno::Reference<beans::XPropertySet> xPropertySet(xPropertyContainer, uno::UNO_QUERY);
- uno::Sequence<beans::Property> aProperties = xPropertySet->getPropertySetInfo()->getProperties();
+ const uno::Sequence<beans::Property> aProperties = xPropertySet->getPropertySetInfo()->getProperties();
for (const beans::Property& rProperty : aProperties)
{
if (rProperty.Name.startsWith("urn:bails:"))
@@ -569,7 +569,7 @@ SfxClassificationHelper::SfxClassificationHelper(const uno::Reference<document::
return;
uno::Reference<beans::XPropertySet> xPropertySet(xPropertyContainer, uno::UNO_QUERY);
- uno::Sequence<beans::Property> aProperties = xPropertySet->getPropertySetInfo()->getProperties();
+ const uno::Sequence<beans::Property> aProperties = xPropertySet->getPropertySetInfo()->getProperties();
for (const beans::Property& rProperty : aProperties)
{
if (!rProperty.Name.startsWith("urn:bails:"))
diff --git a/sfx2/source/view/sfxbasecontroller.cxx b/sfx2/source/view/sfxbasecontroller.cxx
index c5503a3c2aa5..956ce26fc4b4 100644
--- a/sfx2/source/view/sfxbasecontroller.cxx
+++ b/sfx2/source/view/sfxbasecontroller.cxx
@@ -1368,7 +1368,7 @@ void SfxBaseController::ShowInfoBars( )
if ( !xCmisDoc.is( ) || !xCmisDoc->canCheckOut( ) )
return;
- uno::Sequence< document::CmisProperty> aCmisProperties = xCmisDoc->getCmisProperties( );
+ const uno::Sequence< document::CmisProperty> aCmisProperties = xCmisDoc->getCmisProperties( );
if ( !(xCmisDoc->isVersionable( ) && aCmisProperties.hasElements( )) )
return;
diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx
index 4590d32743e6..9be92b23ba15 100644
--- a/sfx2/source/view/viewprn.cxx
+++ b/sfx2/source/view/viewprn.cxx
@@ -140,7 +140,7 @@ SfxPrinterController::SfxPrinterController( const VclPtr<Printer>& i_rPrinter,
aRenderOptions[2].Value <<= true;
try
{
- Sequence< beans::PropertyValue > aRenderParms( mxRenderable->getRenderer( 0 , getSelectionObject(), aRenderOptions ) );
+ const Sequence< beans::PropertyValue > aRenderParms( mxRenderable->getRenderer( 0 , getSelectionObject(), aRenderOptions ) );
for( const auto& rRenderParm : aRenderParms )
{
if ( rRenderParm.Name == "ExtraPrintUIOptions" )
commit 2a6f30194afb745df7412b95b53f8165b237da71
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Thu Aug 15 12:53:43 2019 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Thu Aug 15 20:22:34 2019 +0200
loplugin:sequenceloop in sd
Change-Id: Ibd809c8e48cd08123194071bf6f179a836f84cde
Reviewed-on: https://gerrit.libreoffice.org/77525
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx
index 803caeb163e2..ac99607322f5 100644
--- a/sd/qa/unit/export-tests.cxx
+++ b/sd/qa/unit/export-tests.cxx
@@ -1047,7 +1047,7 @@ void SdExportTest::testBulletsAsImage()
awt::Size aSize;
sal_Int16 nNumberingType = -1;
- for (beans::PropertyValue const & rProperty : aProperties)
+ for (beans::PropertyValue const & rProperty : std::as_const(aProperties))
{
if (rProperty.Name == "NumberingType")
{
diff --git a/sd/source/core/CustomAnimationEffect.cxx b/sd/source/core/CustomAnimationEffect.cxx
index f38e91f245cc..a6f75ee9cdc0 100644
--- a/sd/source/core/CustomAnimationEffect.cxx
+++ b/sd/source/core/CustomAnimationEffect.cxx
@@ -155,7 +155,7 @@ void CustomAnimationEffect::setNode( const css::uno::Reference< css::animations:
mxNode = xNode;
mxAudio.clear();
- Sequence< NamedValue > aUserData( mxNode->getUserData() );
+ const Sequence< NamedValue > aUserData( mxNode->getUserData() );
for( const NamedValue& rProp : aUserData )
{
diff --git a/sd/source/core/CustomAnimationPreset.cxx b/sd/source/core/CustomAnimationPreset.cxx
index bf8214d909b6..b068fe1ff7d3 100644
--- a/sd/source/core/CustomAnimationPreset.cxx
+++ b/sd/source/core/CustomAnimationPreset.cxx
@@ -92,7 +92,7 @@ void implImportLabels( const Reference< XMultiServiceFactory >& xConfigProvider,
if( xConfigAccess.is() )
{
Reference< XNameAccess > xNameAccess;
- Sequence< OUString > aNames( xConfigAccess->getElementNames() );
+ const Sequence< OUString > aNames( xConfigAccess->getElementNames() );
for(const OUString& rName : aNames)
{
xConfigAccess->getByName( rName ) >>= xNameAccess;
@@ -295,7 +295,7 @@ void CustomAnimationPresets::importEffects()
uno::Sequence< OUString > aFiles;
xNameAccess->getByName( "EffectFiles" ) >>= aFiles;
- for( const auto& rFile : aFiles )
+ for( const auto& rFile : std::as_const(aFiles) )
{
OUString aURL = comphelper::getExpandedUri(xContext, rFile);
@@ -403,7 +403,7 @@ void CustomAnimationPresets::importPresets( const Reference< XMultiServiceFactor
{
Reference< XNameAccess > xCategoryAccess;
- Sequence< OUString > aNames( xTypeAccess->getElementNames() );
+ const Sequence< OUString > aNames( xTypeAccess->getElementNames() );
for(const OUString& rName : aNames)
{
xTypeAccess->getByName( rName ) >>= xCategoryAccess;
@@ -418,7 +418,7 @@ void CustomAnimationPresets::importPresets( const Reference< XMultiServiceFactor
EffectDescriptorList aEffectsList;
- for( const OUString& rEffectName : aEffects )
+ for( const OUString& rEffectName : std::as_const(aEffects) )
{
CustomAnimationPresetPtr pEffect = getEffectDescriptor( rEffectName );
if( pEffect.get() )
diff --git a/sd/source/core/TransitionPreset.cxx b/sd/source/core/TransitionPreset.cxx
index b543d6dfd6c9..19728f35c37e 100644
--- a/sd/source/core/TransitionPreset.cxx
+++ b/sd/source/core/TransitionPreset.cxx
@@ -206,7 +206,7 @@ bool TransitionPreset::importTransitionPresetList( TransitionPresetList& rList )
uno::Sequence< OUString > aFiles;
xNameAccess->getByName("TransitionFiles") >>= aFiles;
- for( const auto& rFile : aFiles )
+ for( const auto& rFile : std::as_const(aFiles) )
{
OUString aURL = comphelper::getExpandedUri(xContext, rFile);
diff --git a/sd/source/core/drawdoc.cxx b/sd/source/core/drawdoc.cxx
index 775838653b68..b80423fca738 100644
--- a/sd/source/core/drawdoc.cxx
+++ b/sd/source/core/drawdoc.cxx
@@ -559,7 +559,7 @@ void lcl_copyUserDefinedProperties(SfxObjectShell* pSource, SfxObjectShell* pDes
uno::Reference<beans::XPropertyContainer> xSourcePropertyContainer = xSource->getUserDefinedProperties();
uno::Reference<beans::XPropertyContainer> xDestinationPropertyContainer = xDestination->getUserDefinedProperties();
uno::Reference<beans::XPropertySet> xSourcePropertySet(xSourcePropertyContainer, uno::UNO_QUERY);
- uno::Sequence<beans::Property> aProperties = xSourcePropertySet->getPropertySetInfo()->getProperties();
+ const uno::Sequence<beans::Property> aProperties = xSourcePropertySet->getPropertySetInfo()->getProperties();
for (const beans::Property& rProperty : aProperties)
{
@@ -1106,7 +1106,7 @@ void SdDrawDocument::InitLayoutVector()
::comphelper::getProcessComponentContext() );
// get file list from configuration
- Sequence< OUString > aFiles(
+ const Sequence< OUString > aFiles(
officecfg::Office::Impress::Misc::LayoutListFiles::get(xContext) );
OUString sFilename;
@@ -1145,7 +1145,7 @@ void SdDrawDocument::InitObjectVector()
::comphelper::getProcessComponentContext() );
// get file list from configuration
- Sequence< OUString > aFiles(
+ const Sequence< OUString > aFiles(
officecfg::Office::Impress::Misc::PresObjListFiles::get(xContext) );
OUString sFilename;
diff --git a/sd/source/core/stlpool.cxx b/sd/source/core/stlpool.cxx
index 2665860a2ef2..1004b8e6f988 100644
--- a/sd/source/core/stlpool.cxx
+++ b/sd/source/core/stlpool.cxx
@@ -541,7 +541,7 @@ void SdStyleSheetPool::CopyTableStyles(SdStyleSheetPool const & rSourcePool)
{
Reference< XNameAccess> xSourceNames( xSourceTableStyle, UNO_QUERY_THROW );
- Sequence< OUString > aStyleNames( xSourceNames->getElementNames() );
+ const Sequence< OUString > aStyleNames( xSourceNames->getElementNames() );
Reference< XNameReplace > xTargetNames( xNewTableStyle, UNO_QUERY );
diff --git a/sd/source/filter/eppt/eppt.cxx b/sd/source/filter/eppt/eppt.cxx
index 2b2b886aa4b7..d9c6b62656b5 100644
--- a/sd/source/filter/eppt/eppt.cxx
+++ b/sd/source/filter/eppt/eppt.cxx
@@ -835,7 +835,7 @@ bool PPTWriter::ImplCreateDocument()
css::uno::Reference< css::container::XNameContainer > aXCont( aXCPSup->getCustomPresentations() );
if ( aXCont.is() )
{
- css::uno::Sequence< OUString> aNameSeq( aXCont->getElementNames() );
+ const css::uno::Sequence< OUString> aNameSeq( aXCont->getElementNames() );
if ( aNameSeq.hasElements() )
{
mpPptEscherEx->OpenContainer( EPP_NamedShows );
diff --git a/sd/source/filter/eppt/epptso.cxx b/sd/source/filter/eppt/epptso.cxx
index b06d73b24ec2..ff614afe9999 100644
--- a/sd/source/filter/eppt/epptso.cxx
+++ b/sd/source/filter/eppt/epptso.cxx
@@ -1246,7 +1246,7 @@ void PPTWriter::ImplWriteTextStyleAtom( SvStream& rOut, int nTextInstance, sal_u
if ( nTextRulerAtomFlags & 4 )
{
pRuleOut->WriteUInt16( nTabCount );
- for ( const css::style::TabStop& rTabStop : pPara->maTabStop )
+ for ( const css::style::TabStop& rTabStop : std::as_const(pPara->maTabStop) )
{
sal_uInt16 nPosition = static_cast<sal_uInt16>( ( rTabStop.Position / 4.40972 ) + nTextOfs );
sal_uInt16 nType;
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list