summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-08-15 12:53:43 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-08-15 20:22:34 +0200
commit2a6f30194afb745df7412b95b53f8165b237da71 (patch)
tree7d7e99066931addf8bd3908f1c8fb7c47b38c4ac /sd
parentf23f9d38db7e0b586130af88c7424cc3d85bc2d2 (diff)
loplugin:sequenceloop in sd
Change-Id: Ibd809c8e48cd08123194071bf6f179a836f84cde Reviewed-on: https://gerrit.libreoffice.org/77525 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd')
-rw-r--r--sd/qa/unit/export-tests.cxx2
-rw-r--r--sd/source/core/CustomAnimationEffect.cxx2
-rw-r--r--sd/source/core/CustomAnimationPreset.cxx8
-rw-r--r--sd/source/core/TransitionPreset.cxx2
-rw-r--r--sd/source/core/drawdoc.cxx6
-rw-r--r--sd/source/core/stlpool.cxx2
-rw-r--r--sd/source/filter/eppt/eppt.cxx2
-rw-r--r--sd/source/filter/eppt/epptso.cxx2
-rw-r--r--sd/source/filter/eppt/pptexanimations.cxx2
-rw-r--r--sd/source/filter/eppt/pptx-animations.cxx2
-rw-r--r--sd/source/filter/ppt/pptinanimations.cxx2
-rw-r--r--sd/source/ui/dlg/PhotoAlbumDialog.cxx2
-rw-r--r--sd/source/ui/dlg/tpaction.cxx2
-rw-r--r--sd/source/ui/framework/configuration/ConfigurationController.cxx2
-rw-r--r--sd/source/ui/framework/factories/ViewShellWrapper.cxx2
-rw-r--r--sd/source/ui/framework/tools/FrameworkHelper.cxx2
-rw-r--r--sd/source/ui/remotecontrol/Server.cxx2
-rw-r--r--sd/source/ui/sidebar/RecentlyUsedMasterPages.cxx4
-rw-r--r--sd/source/ui/slideshow/PaneHider.cxx2
-rw-r--r--sd/source/ui/tools/ConfigurationAccess.cxx2
-rw-r--r--sd/source/ui/unoidl/SdUnoSlideView.cxx2
-rw-r--r--sd/source/ui/unoidl/unoobj.cxx2
-rw-r--r--sd/source/ui/unoidl/unopage.cxx4
23 files changed, 30 insertions, 30 deletions
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;
diff --git a/sd/source/filter/eppt/pptexanimations.cxx b/sd/source/filter/eppt/pptexanimations.cxx
index efba0899de89..1b316006d15f 100644
--- a/sd/source/filter/eppt/pptexanimations.cxx
+++ b/sd/source/filter/eppt/pptexanimations.cxx
@@ -741,7 +741,7 @@ Reference< XAnimationNode > AnimationExporter::createAfterEffectNodeClone( const
bool AnimationExporter::GetNodeType( const Reference< XAnimationNode >& xNode, sal_Int16& nType )
{
// trying to get the nodetype
- Sequence< NamedValue > aUserData = xNode->getUserData();
+ const Sequence< NamedValue > aUserData = xNode->getUserData();
for( const NamedValue& rProp : aUserData )
{
if ( rProp.Name == "node-type" )
diff --git a/sd/source/filter/eppt/pptx-animations.cxx b/sd/source/filter/eppt/pptx-animations.cxx
index f1872a5ce52e..9e1aaa0ce821 100644
--- a/sd/source/filter/eppt/pptx-animations.cxx
+++ b/sd/source/filter/eppt/pptx-animations.cxx
@@ -731,7 +731,7 @@ void PPTXAnimationExport::WriteAnimationCondList(const Any& rAny, sal_Int32 nTok
Sequence<Any> aCondSeq;
if (rAny >>= aCondSeq)
{
- for (const auto& rCond : aCondSeq)
+ for (const auto& rCond : std::as_const(aCondSeq))
{
Cond aCond(rCond, bIsMainSeqChild);
if (aCond.isValid())
diff --git a/sd/source/filter/ppt/pptinanimations.cxx b/sd/source/filter/ppt/pptinanimations.cxx
index 6967bde74689..abf16b9cb41c 100644
--- a/sd/source/filter/ppt/pptinanimations.cxx
+++ b/sd/source/filter/ppt/pptinanimations.cxx
@@ -553,7 +553,7 @@ bool AnimationImporter::convertAnimationNode( const Reference< XAnimationNode >&
bool bAfterEffect = false;
sal_Int32 nMasterRel = 0;
- for( const NamedValue& rValue : aUserData )
+ for( const NamedValue& rValue : std::as_const(aUserData) )
{
if ( rValue.Name == "after-effect" )
{
diff --git a/sd/source/ui/dlg/PhotoAlbumDialog.cxx b/sd/source/ui/dlg/PhotoAlbumDialog.cxx
index 60d9a9d1c1f6..4af7c2f3c5ce 100644
--- a/sd/source/ui/dlg/PhotoAlbumDialog.cxx
+++ b/sd/source/ui/dlg/PhotoAlbumDialog.cxx
@@ -519,7 +519,7 @@ IMPL_LINK_NOARG(SdPhotoAlbumDialog, FileHdl, weld::Button&, void)
if ( aDlg.Execute() == ERRCODE_NONE )
{
- Sequence< OUString > aFilesArr = aDlg.GetSelectedFiles();
+ const Sequence< OUString > aFilesArr = aDlg.GetSelectedFiles();
if( aFilesArr.hasElements() )
{
sUrl = aDlg.GetDisplayDirectory();
diff --git a/sd/source/ui/dlg/tpaction.cxx b/sd/source/ui/dlg/tpaction.cxx
index a99f1fcd2ef9..d7e74eb12ccf 100644
--- a/sd/source/ui/dlg/tpaction.cxx
+++ b/sd/source/ui/dlg/tpaction.cxx
@@ -207,7 +207,7 @@ void SdTPAction::Construct()
aVerbs = xObj->getSupportedVerbs();
}
- for( const embed::VerbDescriptor& aVerb : aVerbs )
+ for( const embed::VerbDescriptor& aVerb : std::as_const(aVerbs) )
{
if( aVerb.VerbAttributes & embed::VerbAttributes::MS_VERBATTR_ONCONTAINERMENU )
{
diff --git a/sd/source/ui/framework/configuration/ConfigurationController.cxx b/sd/source/ui/framework/configuration/ConfigurationController.cxx
index d0d381d3032d..acde0a0cc5f4 100644
--- a/sd/source/ui/framework/configuration/ConfigurationController.cxx
+++ b/sd/source/ui/framework/configuration/ConfigurationController.cxx
@@ -253,7 +253,7 @@ void SAL_CALL ConfigurationController::requestResourceActivation (
{
// Get a list of the matching resources and create deactivation
// requests for them.
- Sequence<Reference<XResourceId> > aResourceList (
+ const Sequence<Reference<XResourceId> > aResourceList (
mpImplementation->mxRequestedConfiguration->getResources(
rxResourceId->getAnchor(),
rxResourceId->getResourceTypePrefix(),
diff --git a/sd/source/ui/framework/factories/ViewShellWrapper.cxx b/sd/source/ui/framework/factories/ViewShellWrapper.cxx
index 95557819e8c7..b63941541982 100644
--- a/sd/source/ui/framework/factories/ViewShellWrapper.cxx
+++ b/sd/source/ui/framework/factories/ViewShellWrapper.cxx
@@ -117,7 +117,7 @@ sal_Bool SAL_CALL ViewShellWrapper::select( const css::uno::Any& aSelection )
rSelector.DeselectAllPages();
Sequence<Reference<drawing::XDrawPage> > xPages;
aSelection >>= xPages;
- for (const auto& rPage : xPages)
+ for (const auto& rPage : std::as_const(xPages))
{
Reference<beans::XPropertySet> xSet (rPage, UNO_QUERY);
if (xSet.is())
diff --git a/sd/source/ui/framework/tools/FrameworkHelper.cxx b/sd/source/ui/framework/tools/FrameworkHelper.cxx
index 830be7136bba..1f51a6bba052 100644
--- a/sd/source/ui/framework/tools/FrameworkHelper.cxx
+++ b/sd/source/ui/framework/tools/FrameworkHelper.cxx
@@ -752,7 +752,7 @@ OUString FrameworkHelper::ResourceIdToString (const Reference<XResourceId>& rxRe
sString.append(rxResourceId->getResourceURL());
if (rxResourceId->hasAnchor())
{
- Sequence<OUString> aAnchorURLs (rxResourceId->getAnchorURLs());
+ const Sequence<OUString> aAnchorURLs (rxResourceId->getAnchorURLs());
for (const auto& rAnchorURL : aAnchorURLs)
{
sString.append(" | ");
diff --git a/sd/source/ui/remotecontrol/Server.cxx b/sd/source/ui/remotecontrol/Server.cxx
index d93db30203cf..4171da6f4d84 100644
--- a/sd/source/ui/remotecontrol/Server.cxx
+++ b/sd/source/ui/remotecontrol/Server.cxx
@@ -146,7 +146,7 @@ void RemoteServer::execute()
// Check if we already have this server.
Reference< XNameAccess > const xConfig = officecfg::Office::Impress::Misc::AuthorisedRemotes::get();
- Sequence< OUString > aNames = xConfig->getElementNames();
+ const Sequence< OUString > aNames = xConfig->getElementNames();
bool aFound = false;
for ( const auto& rName : aNames )
{
diff --git a/sd/source/ui/sidebar/RecentlyUsedMasterPages.cxx b/sd/source/ui/sidebar/RecentlyUsedMasterPages.cxx
index 65e1d58062ec..a5ce3f997aba 100644
--- a/sd/source/ui/sidebar/RecentlyUsedMasterPages.cxx
+++ b/sd/source/ui/sidebar/RecentlyUsedMasterPages.cxx
@@ -134,7 +134,7 @@ void RecentlyUsedMasterPages::LoadPersistentValues()
OUString sName;
// Read the names and URLs of the master pages.
- Sequence<OUString> aKeys (xSet->getElementNames());
+ const Sequence<OUString> aKeys (xSet->getElementNames());
mvMasterPages.clear();
mvMasterPages.reserve(aKeys.getLength());
for (const auto& rKey : aKeys)
@@ -194,7 +194,7 @@ void RecentlyUsedMasterPages::SavePersistentValues()
return;
// Clear the set.
- Sequence<OUString> aKeys (xSet->getElementNames());
+ const Sequence<OUString> aKeys (xSet->getElementNames());
for (const auto& rKey : aKeys)
xSet->removeByName (rKey);
diff --git a/sd/source/ui/slideshow/PaneHider.cxx b/sd/source/ui/slideshow/PaneHider.cxx
index a8d12a0b3123..3905317c6129 100644
--- a/sd/source/ui/slideshow/PaneHider.cxx
+++ b/sd/source/ui/slideshow/PaneHider.cxx
@@ -60,7 +60,7 @@ PaneHider::PaneHider (const ViewShell& rViewShell, SlideshowImpl* pSlideShow)
if (mxConfiguration.is())
{
// Iterate over the resources and deactivate the panes.
- Sequence<Reference<XResourceId> > aResources (
+ const Sequence<Reference<XResourceId> > aResources (
mxConfiguration->getResources(
nullptr,
framework::FrameworkHelper::msPaneURLPrefix,
diff --git a/sd/source/ui/tools/ConfigurationAccess.cxx b/sd/source/ui/tools/ConfigurationAccess.cxx
index 12d3af927d9d..c2623b53ecdd 100644
--- a/sd/source/ui/tools/ConfigurationAccess.cxx
+++ b/sd/source/ui/tools/ConfigurationAccess.cxx
@@ -131,7 +131,7 @@ void ConfigurationAccess::ForAll (
return;
::std::vector<Any> aValues(rArguments.size());
- Sequence<OUString> aKeys (rxContainer->getElementNames());
+ const Sequence<OUString> aKeys (rxContainer->getElementNames());
for (const OUString& rsKey : aKeys)
{
Reference<container::XNameAccess> xSetItem (rxContainer->getByName(rsKey), UNO_QUERY);
diff --git a/sd/source/ui/unoidl/SdUnoSlideView.cxx b/sd/source/ui/unoidl/SdUnoSlideView.cxx
index 01c6d0d923e7..df6750e38947 100644
--- a/sd/source/ui/unoidl/SdUnoSlideView.cxx
+++ b/sd/source/ui/unoidl/SdUnoSlideView.cxx
@@ -58,7 +58,7 @@ sal_Bool SAL_CALL SdUnoSlideView::select (const Any& aSelection)
rSelector.DeselectAllPages();
Sequence<Reference<drawing::XDrawPage> > xPages;
aSelection >>= xPages;
- for (const auto& rPage : xPages)
+ for (const auto& rPage : std::as_const(xPages))
{
Reference<beans::XPropertySet> xSet (rPage, UNO_QUERY);
if (xSet.is())
diff --git a/sd/source/ui/unoidl/unoobj.cxx b/sd/source/ui/unoidl/unoobj.cxx
index 7c80b329a275..1c6751feab76 100644
--- a/sd/source/ui/unoidl/unoobj.cxx
+++ b/sd/source/ui/unoidl/unoobj.cxx
@@ -1141,7 +1141,7 @@ void SAL_CALL SdUnoEventsAccess::replaceByName( const OUString& aName, const uno
OUString aStrLibrary;
OUString aStrBookmark;
- for( const beans::PropertyValue& rProperty : aProperties )
+ for( const beans::PropertyValue& rProperty : std::as_const(aProperties) )
{
if( !( nFound & FoundFlags::EventType ) && rProperty.Name == gaStrEventType )
{
diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx
index 97b8dc05c8cf..6e7bca18d24f 100644
--- a/sd/source/ui/unoidl/unopage.cxx
+++ b/sd/source/ui/unoidl/unopage.cxx
@@ -2459,7 +2459,7 @@ void SdDrawPage::setBackground( const Any& rValue )
Reference< beans::XPropertySet > xDestSet( static_cast<beans::XPropertySet*>(pBackground) );
Reference< beans::XPropertySetInfo > xDestSetInfo( xDestSet->getPropertySetInfo() );
- Sequence< beans::Property > aProperties( xDestSetInfo->getProperties() );
+ const Sequence< beans::Property > aProperties( xDestSetInfo->getProperties() );
for( const beans::Property& rProp : aProperties )
{
@@ -2827,7 +2827,7 @@ void SdMasterPage::setBackground( const Any& rValue )
Reference< beans::XPropertySet > xDestSet( static_cast<beans::XPropertySet*>(pBackground) );
Reference< beans::XPropertySetInfo > xDestSetInfo( xDestSet->getPropertySetInfo(), UNO_SET_THROW );
- uno::Sequence< beans::Property> aProperties( xDestSetInfo->getProperties() );
+ const uno::Sequence< beans::Property> aProperties( xDestSetInfo->getProperties() );
for( const beans::Property& rProp : aProperties )
{