summaryrefslogtreecommitdiff
path: root/sfx2/source/control
diff options
context:
space:
mode:
Diffstat (limited to 'sfx2/source/control')
-rw-r--r--sfx2/source/control/charmapcontrol.cxx20
-rw-r--r--sfx2/source/control/recentdocsview.cxx8
-rw-r--r--sfx2/source/control/shell.cxx9
-rw-r--r--sfx2/source/control/templatelocalview.cxx20
-rw-r--r--sfx2/source/control/unoctitm.cxx5
5 files changed, 19 insertions, 43 deletions
diff --git a/sfx2/source/control/charmapcontrol.cxx b/sfx2/source/control/charmapcontrol.cxx
index 6534a9b1efc6..c28a5d75108c 100644
--- a/sfx2/source/control/charmapcontrol.cxx
+++ b/sfx2/source/control/charmapcontrol.cxx
@@ -106,17 +106,11 @@ void SfxCharmapCtrl::getFavCharacterList()
{
//retrieve recent character list
css::uno::Sequence< OUString > rFavCharList( officecfg::Office::Common::FavoriteCharacters::FavoriteCharacterList::get() );
- for (int i = 0; i < rFavCharList.getLength(); ++i)
- {
- maFavCharList.push_back(rFavCharList[i]);
- }
+ std::copy(rFavCharList.begin(), rFavCharList.end(), std::back_inserter(maFavCharList));
//retrieve recent character font list
css::uno::Sequence< OUString > rFavCharFontList( officecfg::Office::Common::FavoriteCharacters::FavoriteCharacterFontList::get() );
- for (int i = 0; i < rFavCharFontList.getLength(); ++i)
- {
- maFavCharFontList.push_back(rFavCharFontList[i]);
- }
+ std::copy(rFavCharFontList.begin(), rFavCharFontList.end(), std::back_inserter(maFavCharFontList));
}
@@ -146,17 +140,11 @@ void SfxCharmapCtrl::getRecentCharacterList()
{
//retrieve recent character list
css::uno::Sequence< OUString > rRecentCharList( officecfg::Office::Common::RecentCharacters::RecentCharacterList::get() );
- for (int i = 0; i < rRecentCharList.getLength(); ++i)
- {
- maRecentCharList.push_back(rRecentCharList[i]);
- }
+ std::copy(rRecentCharList.begin(), rRecentCharList.end(), std::back_inserter(maRecentCharList));
//retrieve recent character font list
css::uno::Sequence< OUString > rRecentCharFontList( officecfg::Office::Common::RecentCharacters::RecentCharacterFontList::get() );
- for (int i = 0; i < rRecentCharFontList.getLength(); ++i)
- {
- maRecentCharFontList.push_back(rRecentCharFontList[i]);
- }
+ std::copy(rRecentCharFontList.begin(), rRecentCharFontList.end(), std::back_inserter(maRecentCharFontList));
}
diff --git a/sfx2/source/control/recentdocsview.cxx b/sfx2/source/control/recentdocsview.cxx
index 51674e4e808d..46314a428ab2 100644
--- a/sfx2/source/control/recentdocsview.cxx
+++ b/sfx2/source/control/recentdocsview.cxx
@@ -240,14 +240,14 @@ void RecentDocsView::Reload()
OUString aTitle;
BitmapEx aThumbnail;
- for ( int j = 0; j < rRecentEntry.getLength(); j++ )
+ for ( const auto& rProp : rRecentEntry )
{
- Any a = rRecentEntry[j].Value;
+ Any a = rProp.Value;
- if (rRecentEntry[j].Name == "URL")
+ if (rProp.Name == "URL")
a >>= aURL;
//fdo#74834: only load thumbnail if the corresponding option is not disabled in the configuration
- else if (rRecentEntry[j].Name == "Thumbnail" && officecfg::Office::Common::History::RecentDocsThumbnail::get())
+ else if (rProp.Name == "Thumbnail" && officecfg::Office::Common::History::RecentDocsThumbnail::get())
{
OUString aBase64;
a >>= aBase64;
diff --git a/sfx2/source/control/shell.cxx b/sfx2/source/control/shell.cxx
index 52c59572daa7..abdb828d7721 100644
--- a/sfx2/source/control/shell.cxx
+++ b/sfx2/source/control/shell.cxx
@@ -602,19 +602,20 @@ void SfxShell::VerbExec(SfxRequest& rReq)
bool bReadOnly = pViewShell->GetObjectShell()->IsReadOnly();
css::uno::Sequence < css::embed::VerbDescriptor > aList = pViewShell->GetVerbs();
- for (sal_Int32 n=0, nVerb=0; n<aList.getLength(); n++)
+ sal_Int32 nVerb = 0;
+ for (const auto& rVerb : aList)
{
// check for ReadOnly verbs
- if ( bReadOnly && !(aList[n].VerbAttributes & embed::VerbAttributes::MS_VERBATTR_NEVERDIRTIES) )
+ if ( bReadOnly && !(rVerb.VerbAttributes & embed::VerbAttributes::MS_VERBATTR_NEVERDIRTIES) )
continue;
// check for verbs that shouldn't appear in the menu
- if ( !(aList[n].VerbAttributes & embed::VerbAttributes::MS_VERBATTR_ONCONTAINERMENU) )
+ if ( !(rVerb.VerbAttributes & embed::VerbAttributes::MS_VERBATTR_ONCONTAINERMENU) )
continue;
if (nId == SID_VERB_START + nVerb++)
{
- pViewShell->DoVerb(aList[n].VerbID);
+ pViewShell->DoVerb(rVerb.VerbID);
rReq.Done();
return;
}
diff --git a/sfx2/source/control/templatelocalview.cxx b/sfx2/source/control/templatelocalview.cxx
index 982811f93fc4..500bacca768d 100644
--- a/sfx2/source/control/templatelocalview.cxx
+++ b/sfx2/source/control/templatelocalview.cxx
@@ -438,14 +438,8 @@ bool TemplateLocalView::IsDefaultTemplate(const OUString& rPath)
SvtModuleOptions aModOpt;
const css::uno::Sequence<OUString> &aServiceNames = aModOpt.GetAllServiceNames();
- for( sal_Int32 i=0, nCount = aServiceNames.getLength(); i < nCount; ++i )
- {
- const OUString defaultPath = SfxObjectFactory::GetStandardTemplate( aServiceNames[i] );
- if(defaultPath.match(rPath))
- return true;
- }
-
- return false;
+ return std::any_of(aServiceNames.begin(), aServiceNames.end(), [&rPath](const OUString& rName) {
+ return SfxObjectFactory::GetStandardTemplate(rName).match(rPath); });
}
BitmapEx TemplateLocalView::getDefaultThumbnail( const OUString& rPath )
@@ -1301,14 +1295,8 @@ bool SfxTemplateLocalView::IsDefaultTemplate(const OUString& rPath)
SvtModuleOptions aModOpt;
const css::uno::Sequence<OUString> &aServiceNames = aModOpt.GetAllServiceNames();
- for( sal_Int32 i=0, nCount = aServiceNames.getLength(); i < nCount; ++i )
- {
- const OUString defaultPath = SfxObjectFactory::GetStandardTemplate( aServiceNames[i] );
- if(defaultPath.match(rPath))
- return true;
- }
-
- return false;
+ return std::any_of(aServiceNames.begin(), aServiceNames.end(), [&rPath](const OUString& rName) {
+ return SfxObjectFactory::GetStandardTemplate(rName).match(rPath); });
}
void SfxTemplateLocalView::RemoveDefaultTemplateIcon(const OUString& rPath)
diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index e4e1b8d5f691..a321248cdc9b 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -667,9 +667,8 @@ void SfxDispatchController_Impl::dispatch( const css::util::URL& aURL,
{
sal_uInt32 nIndex( lNewArgs.getLength() );
- lNewArgs.realloc( lNewArgs.getLength()+aAddArgs.size() );
- for ( sal_uInt32 i = 0; i < nAddArgs; i++ )
- lNewArgs[nIndex++] = aAddArgs[i];
+ lNewArgs.realloc( nIndex + nAddArgs );
+ std::copy(aAddArgs.begin(), aAddArgs.end(), std::next(lNewArgs.begin(), nIndex));
}
// Overwrite possible detected synchron argument, if real listener exists (currently no other way)