summaryrefslogtreecommitdiff
path: root/scripting
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-08-20 11:16:20 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-08-20 13:05:02 +0200
commitff6e8c73adef7c86db12287948025954a4fc7746 (patch)
treeebd53edfbd8e6349b0dab9a92cedb9968a2454c9 /scripting
parentb2423a480785db6f4883d6314690b22b69d55c22 (diff)
loplugin:constvars in sccomp..sd
Change-Id: Ic4b2a1d23da80a5b0976692f490c29a7169be3ef Reviewed-on: https://gerrit.libreoffice.org/77793 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'scripting')
-rw-r--r--scripting/source/provider/BrowseNodeFactoryImpl.cxx2
-rw-r--r--scripting/source/provider/MasterScriptProvider.cxx3
-rw-r--r--scripting/source/stringresource/stringresource.cxx6
3 files changed, 6 insertions, 5 deletions
diff --git a/scripting/source/provider/BrowseNodeFactoryImpl.cxx b/scripting/source/provider/BrowseNodeFactoryImpl.cxx
index 92ce1be6c273..83d3cbec80aa 100644
--- a/scripting/source/provider/BrowseNodeFactoryImpl.cxx
+++ b/scripting/source/provider/BrowseNodeFactoryImpl.cxx
@@ -190,7 +190,7 @@ public:
Sequence< Reference< browse::XBrowseNode > > children( m_hBNA->size() );
sal_Int32 index = 0;
- for ( auto& str : m_vStr )
+ for ( const auto& str : m_vStr )
{
children[ index ].set( m_hBNA->find( str )->second );
++index;
diff --git a/scripting/source/provider/MasterScriptProvider.cxx b/scripting/source/provider/MasterScriptProvider.cxx
index 8fb19dc8ac09..7a5475541179 100644
--- a/scripting/source/provider/MasterScriptProvider.cxx
+++ b/scripting/source/provider/MasterScriptProvider.cxx
@@ -456,7 +456,8 @@ template <typename Proc> bool FindProviderAndApply(ProviderCache& rCache, Proc p
auto pass = [&rCache, &p]() -> bool
{
bool bResult = false;
- for (auto& rProv : rCache.getAllProviders())
+ const Sequence<Reference<provider::XScriptProvider>> aAllProviders = rCache.getAllProviders();
+ for (const auto& rProv : aAllProviders)
{
Reference<container::XNameContainer> xCont(rProv, UNO_QUERY);
if (!xCont.is())
diff --git a/scripting/source/stringresource/stringresource.cxx b/scripting/source/stringresource/stringresource.cxx
index b74f76c23906..2da2fe5be1e1 100644
--- a/scripting/source/stringresource/stringresource.cxx
+++ b/scripting/source/stringresource/stringresource.cxx
@@ -272,7 +272,7 @@ Sequence< Locale > StringResourceImpl::getLocales( )
Sequence< Locale > aLocalSeq( nSize );
Locale* pLocales = aLocalSeq.getArray();
int iTarget = 0;
- for( auto& pLocaleItem : m_aLocaleItemVector )
+ for( const auto& pLocaleItem : m_aLocaleItemVector )
{
pLocales[iTarget] = pLocaleItem->m_locale;
iTarget++;
@@ -489,7 +489,7 @@ void StringResourceImpl::removeLocale( const Locale& locale )
m_pDefaultLocaleItem == pRemoveItem )
{
LocaleItem* pFallbackItem = nullptr;
- for( auto& pLocaleItem : m_aLocaleItemVector )
+ for( const auto& pLocaleItem : m_aLocaleItemVector )
{
if( pLocaleItem.get() != pRemoveItem )
{
@@ -610,7 +610,7 @@ LocaleItem* StringResourceImpl::getClosestMatchItemForLocale( const Locale& loca
::std::vector< Locale > aLocales( m_aLocaleItemVector.size());
size_t i = 0;
- for( auto& pLocaleItem : m_aLocaleItemVector )
+ for( const auto& pLocaleItem : m_aLocaleItemVector )
{
aLocales[i] = (pLocaleItem ? pLocaleItem->m_locale : Locale());
++i;