summaryrefslogtreecommitdiff
path: root/cui/source/customize
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-08-15 11:05:55 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-08-15 11:59:02 +0200
commitfe00a724a918606e5c8c2c32b155bc50b33d56bd (patch)
treec638ef9b9ca8d354a911feb82d6905f10861f0bc /cui/source/customize
parent5827e30109b683cb74efa21d154e5219fe9e2a0c (diff)
loplugin:sequenceloop in basic..cui
Change-Id: I15d825de3201808d188b461415f78a4d81b64127 Reviewed-on: https://gerrit.libreoffice.org/77494 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'cui/source/customize')
-rw-r--r--cui/source/customize/CommandCategoryListBox.cxx6
-rw-r--r--cui/source/customize/CustomNotebookbarGenerator.cxx2
-rw-r--r--cui/source/customize/cfg.cxx6
-rw-r--r--cui/source/customize/cfgutil.cxx2
4 files changed, 9 insertions, 7 deletions
diff --git a/cui/source/customize/CommandCategoryListBox.cxx b/cui/source/customize/CommandCategoryListBox.cxx
index 3335836afe3a..e361388943c4 100644
--- a/cui/source/customize/CommandCategoryListBox.cxx
+++ b/cui/source/customize/CommandCategoryListBox.cxx
@@ -351,7 +351,8 @@ void CommandCategoryListBox::categorySelected(CuiConfigFunctionListBox* pFunctio
SfxCfgKind::GROUP_SCRIPTCONTAINER, 0, static_cast<void *>(rootNode.get()) ) );
// Add main macro groups
- for ( auto const & childGroup : rootNode->getChildNodes() )
+ const css::uno::Sequence<css::uno::Reference<css::script::browse::XBrowseNode>> aChildNodes = rootNode->getChildNodes();
+ for ( auto const & childGroup : aChildNodes )
{
OUString sUIName;
childGroup->acquire();
@@ -490,7 +491,8 @@ void CommandCategoryListBox::addChildren(
m_searchOptions.searchString = filterTerm;
utl::TextSearch textSearch( m_searchOptions );
- for (auto const & child : parentNode->getChildNodes())
+ const css::uno::Sequence<css::uno::Reference<css::script::browse::XBrowseNode>> aChildNodes = parentNode->getChildNodes();
+ for (auto const & child : aChildNodes)
{
// Acquire to prevent auto-destruction
child->acquire();
diff --git a/cui/source/customize/CustomNotebookbarGenerator.cxx b/cui/source/customize/CustomNotebookbarGenerator.cxx
index 57efc2776d18..dee8e141d37c 100644
--- a/cui/source/customize/CustomNotebookbarGenerator.cxx
+++ b/cui/source/customize/CustomNotebookbarGenerator.cxx
@@ -188,7 +188,7 @@ static xmlDocPtr notebookbarXMLParser(char* pDocName, char* pUIItemID, char* pPr
return pDocPtr;
}
-void CustomNotebookbarGenerator::modifyCustomizedUIFile(Sequence<OUString> sUIItemProperties)
+void CustomNotebookbarGenerator::modifyCustomizedUIFile(const Sequence<OUString>& sUIItemProperties)
{
OUString sCustomizedUIPath = getCustomizedUIPath();
char* cCustomizedUIPath = convertToCharPointer(sCustomizedUIPath);
diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx
index c5c324a40d69..f9d67ec32ee3 100644
--- a/cui/source/customize/cfg.cxx
+++ b/cui/source/customize/cfg.cxx
@@ -711,7 +711,7 @@ OUString ContextMenuSaveInData::GetUIName( const OUString& rResourceURL )
catch ( const css::uno::Exception& )
{}
- for ( const auto& aProp : aProps )
+ for ( const auto& aProp : std::as_const(aProps) )
{
if ( aProp.Name == ITEM_DESCRIPTOR_UINAME )
{
@@ -739,7 +739,7 @@ SvxEntries* ContextMenuSaveInData::GetEntries()
catch ( const css::lang::IllegalArgumentException& )
{}
- for ( const auto& aElement : aElementsInfo )
+ for ( const auto& aElement : std::as_const(aElementsInfo) )
{
OUString aUrl;
for ( const auto& aElementProp : aElement )
@@ -787,7 +787,7 @@ SvxEntries* ContextMenuSaveInData::GetEntries()
catch ( const css::lang::IllegalArgumentException& )
{}
- for ( const auto& aElement : aParentElementsInfo )
+ for ( const auto& aElement : std::as_const(aParentElementsInfo) )
{
OUString aUrl;
for ( const auto& aElementProp : aElement )
diff --git a/cui/source/customize/cfgutil.cxx b/cui/source/customize/cfgutil.cxx
index 06249776bfca..1e675a682296 100644
--- a/cui/source/customize/cfgutil.cxx
+++ b/cui/source/customize/cfgutil.cxx
@@ -157,7 +157,7 @@ std::vector< SfxStyleInfo_Impl > SfxStylesInfo_Impl::getStyleFamilies()
return std::vector< SfxStyleInfo_Impl >();
css::uno::Reference< css::container::XNameAccess > xCont = xModel->getStyleFamilies();
- css::uno::Sequence< OUString > lFamilyNames = xCont->getElementNames();
+ const css::uno::Sequence< OUString > lFamilyNames = xCont->getElementNames();
std::vector< SfxStyleInfo_Impl > lFamilies;
for (const auto& aFamily : lFamilyNames)
{