summaryrefslogtreecommitdiff
path: root/sc/source/ui/docshell
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-05-06 10:14:38 +0200
committerJochen Nitschke <j.nitschke+logerrit@ok.de>2016-05-07 12:24:31 +0000
commit9613b493172fe9aa8efd9c9c090f82ca2e89cf21 (patch)
tree3cc0d212aea1de270160e295a70c9f08f2e84334 /sc/source/ui/docshell
parent464348e82d8cbb0a6d3e5638da3f737f3e6f2d00 (diff)
clang-tidy modernize-loop-convert in sc
Change-Id: I620028d69b11ea0469efd7b02ac7bbc7edab1066 Reviewed-on: https://gerrit.libreoffice.org/24690 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
Diffstat (limited to 'sc/source/ui/docshell')
-rw-r--r--sc/source/ui/docshell/datastream.cxx3
-rw-r--r--sc/source/ui/docshell/docfunc.cxx6
-rw-r--r--sc/source/ui/docshell/documentlinkmgr.cxx24
-rw-r--r--sc/source/ui/docshell/externalrefmgr.cxx3
4 files changed, 17 insertions, 19 deletions
diff --git a/sc/source/ui/docshell/datastream.cxx b/sc/source/ui/docshell/datastream.cxx
index 8440c71af158..cee52271c4d5 100644
--- a/sc/source/ui/docshell/datastream.cxx
+++ b/sc/source/ui/docshell/datastream.cxx
@@ -234,9 +234,8 @@ private:
}
// Read & store new lines from stream.
- for (size_t i = 0, n = pLines->size(); i < n; ++i)
+ for (DataStream::Line & rLine : *pLines)
{
- DataStream::Line& rLine = (*pLines)[i];
rLine.maCells.clear();
mpStream->ReadLine(rLine.maLine);
#if ENABLE_ORCUS
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx
index e7918c6efa01..398a761cf61b 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -3432,10 +3432,10 @@ bool ScDocFunc::SetWidthOrHeight(
bool bShow = nSizeTwips > 0 || eMode != SC_SIZE_DIRECT;
bool bOutline = false;
- for (size_t i = 0, n = rRanges.size(); i < n; ++i)
+ for (const sc::ColRowSpan& rRange : rRanges)
{
- SCCOLROW nStartNo = rRanges[i].mnStart;
- SCCOLROW nEndNo = rRanges[i].mnEnd;
+ SCCOLROW nStartNo = rRange.mnStart;
+ SCCOLROW nEndNo = rRange.mnEnd;
if ( !bWidth ) // Hoehen immer blockweise
{
diff --git a/sc/source/ui/docshell/documentlinkmgr.cxx b/sc/source/ui/docshell/documentlinkmgr.cxx
index 3b17a662f271..02f00e9068df 100644
--- a/sc/source/ui/docshell/documentlinkmgr.cxx
+++ b/sc/source/ui/docshell/documentlinkmgr.cxx
@@ -98,9 +98,9 @@ bool DocumentLinkManager::idleCheckLinks()
bool bAnyLeft = false;
const sfx2::SvBaseLinks& rLinks = mpImpl->mpLinkManager->GetLinks();
- for (size_t i = 0, n = rLinks.size(); i < n; ++i)
+ for (const auto & rLink : rLinks)
{
- sfx2::SvBaseLink* pBase = rLinks[i].get();
+ sfx2::SvBaseLink* pBase = rLink.get();
ScDdeLink* pDdeLink = dynamic_cast<ScDdeLink*>(pBase);
if (!pDdeLink || !pDdeLink->NeedsUpdate())
continue;
@@ -119,9 +119,9 @@ bool DocumentLinkManager::hasDdeLinks() const
return false;
const sfx2::SvBaseLinks& rLinks = mpImpl->mpLinkManager->GetLinks();
- for (size_t i = 0, n = rLinks.size(); i < n; ++i)
+ for (const auto & rLink : rLinks)
{
- sfx2::SvBaseLink* pBase = rLinks[i].get();
+ sfx2::SvBaseLink* pBase = rLink.get();
if (dynamic_cast<ScDdeLink*>(pBase))
return true;
}
@@ -140,9 +140,9 @@ bool DocumentLinkManager::updateDdeLinks( vcl::Window* pWin )
// If the update takes longer, reset all values so that nothing
// old (wrong) is left behind
bool bAny = false;
- for (size_t i = 0, n = rLinks.size(); i < n; ++i)
+ for (const auto & rLink : rLinks)
{
- sfx2::SvBaseLink* pBase = rLinks[i].get();
+ sfx2::SvBaseLink* pBase = rLink.get();
ScDdeLink* pDdeLink = dynamic_cast<ScDdeLink*>(pBase);
if (!pDdeLink)
continue;
@@ -183,9 +183,9 @@ void DocumentLinkManager::updateDdeLink( const OUString& rAppl, const OUString&
sfx2::LinkManager* pMgr = mpImpl->mpLinkManager.get();
const sfx2::SvBaseLinks& rLinks = pMgr->GetLinks();
- for (size_t i = 0, n = rLinks.size(); i < n; ++i)
+ for (const auto & rLink : rLinks)
{
- ::sfx2::SvBaseLink* pBase = rLinks[i].get();
+ ::sfx2::SvBaseLink* pBase = rLink.get();
ScDdeLink* pDdeLink = dynamic_cast<ScDdeLink*>(pBase);
if (!pDdeLink)
continue;
@@ -207,9 +207,9 @@ size_t DocumentLinkManager::getDdeLinkCount() const
size_t nDdeCount = 0;
const sfx2::SvBaseLinks& rLinks = mpImpl->mpLinkManager->GetLinks();
- for (size_t i = 0, n = rLinks.size(); i < n; ++i)
+ for (const auto & rLink : rLinks)
{
- ::sfx2::SvBaseLink* pBase = rLinks[i].get();
+ ::sfx2::SvBaseLink* pBase = rLink.get();
ScDdeLink* pDdeLink = dynamic_cast<ScDdeLink*>(pBase);
if (!pDdeLink)
continue;
@@ -226,9 +226,9 @@ void DocumentLinkManager::disconnectDdeLinks()
return;
const sfx2::SvBaseLinks& rLinks = mpImpl->mpLinkManager->GetLinks();
- for (size_t i = 0, n = rLinks.size(); i < n; ++i)
+ for (const auto & rLink : rLinks)
{
- ::sfx2::SvBaseLink* pBase = rLinks[i].get();
+ ::sfx2::SvBaseLink* pBase = rLink.get();
ScDdeLink* pDdeLink = dynamic_cast<ScDdeLink*>(pBase);
if (pDdeLink)
pDdeLink->Disconnect();
diff --git a/sc/source/ui/docshell/externalrefmgr.cxx b/sc/source/ui/docshell/externalrefmgr.cxx
index 87d51ee52721..471ff0086707 100644
--- a/sc/source/ui/docshell/externalrefmgr.cxx
+++ b/sc/source/ui/docshell/externalrefmgr.cxx
@@ -1312,9 +1312,8 @@ void ScExternalRefCache::clearCacheTables(sal_uInt16 nFileId)
// Clear all cache table content, but keep the tables.
std::vector<TableTypeRef>& rTabs = pDocItem->maTables;
- for (size_t i = 0, n = rTabs.size(); i < n; ++i)
+ for (TableTypeRef & pTab : rTabs)
{
- TableTypeRef pTab = rTabs[i];
if (!pTab)
continue;