summaryrefslogtreecommitdiff
path: root/sc/source/ui/view/cellsh1.cxx
diff options
context:
space:
mode:
authorArkadiy Illarionov <qarkai@gmail.com>2018-12-22 19:54:56 +0300
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-12-25 18:36:29 +0100
commit48b35ed43db87d21a943e66cfa4f59213dcfe3a1 (patch)
tree1352839eee90888fa987baec1887b4d3f5414cc5 /sc/source/ui/view/cellsh1.cxx
parent68259f3663ba61a5f15f04793ac32a200100a8a5 (diff)
Simplify containers iterations in sc/source/ui/{view,xmlsource}
Use range-based loop or replace with STL functions Change-Id: I5604325cd25c099d3b5580956417620f298faa1e Reviewed-on: https://gerrit.libreoffice.org/65572 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/ui/view/cellsh1.cxx')
-rw-r--r--sc/source/ui/view/cellsh1.cxx15
1 files changed, 6 insertions, 9 deletions
diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx
index 0005ae903d63..5ad819c34da8 100644
--- a/sc/source/ui/view/cellsh1.cxx
+++ b/sc/source/ui/view/cellsh1.cxx
@@ -1966,11 +1966,10 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
bool bContainsExistingCondFormat = false;
if(bContainsCondFormat)
{
- for (std::vector<sal_uInt32>::const_iterator itr = rCondFormats.begin(), itrEnd = rCondFormats.end();
- itr != itrEnd; ++itr)
+ for (const auto& rCondFormat : rCondFormats)
{
// check if at least one existing conditional format has the same range
- pCondFormat = pList->GetFormat(*itr);
+ pCondFormat = pList->GetFormat(rCondFormat);
if(!pCondFormat)
continue;
@@ -2176,10 +2175,9 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
if (!aNames.empty())
{
OUStringBuffer aBuffer;
- for (std::vector<OUString>::const_iterator itr = aNames.begin();
- itr != aNames.end(); ++itr)
+ for (const auto& rName : aNames)
{
- aBuffer.append(*itr).append(' ');
+ aBuffer.append(rName).append(' ');
}
pHdl->InsertFunction( aBuffer.makeStringAndClear(), false ); // without "()"
}
@@ -2373,10 +2371,9 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
OUString aUndo = ScResId( bShowNote ? STR_UNDO_SHOWALLNOTES : STR_UNDO_HIDEALLNOTES );
pData->GetDocShell()->GetUndoManager()->EnterListAction( aUndo, aUndo, 0, pData->GetViewShell()->GetViewShellId() );
- for(std::vector<sc::NoteEntry>::const_iterator itr = aNotes.begin(),
- itrEnd = aNotes.end(); itr != itrEnd; ++itr)
+ for(const auto& rNote : aNotes)
{
- const ScAddress& rAdr = itr->maPos;
+ const ScAddress& rAdr = rNote.maPos;
pData->GetDocShell()->GetDocFunc().ShowNote( rAdr, bShowNote );
}