summaryrefslogtreecommitdiff
path: root/starmath/source/accessibility.cxx
diff options
context:
space:
mode:
authorArkadiy Illarionov <qarkai@gmail.com>2018-11-27 22:17:40 +0300
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-11-29 12:06:44 +0100
commit0ded54c33f01d18d2cd06547bd8307bd140cf28f (patch)
treee250a9a8bb89b2042d9a0bc09f80bf65757eec19 /starmath/source/accessibility.cxx
parent7d311ea864e7cfeb1c8f4ca417911db20d13361e (diff)
Simplify containers iterations in slideshow, sot, starmath, stoc
Use range-based loop or replace with STL functions Change-Id: I94792c28b283a0998bf813317e5beb37d93e0c23 Reviewed-on: https://gerrit.libreoffice.org/64125 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'starmath/source/accessibility.cxx')
-rw-r--r--starmath/source/accessibility.cxx20
1 files changed, 10 insertions, 10 deletions
diff --git a/starmath/source/accessibility.cxx b/starmath/source/accessibility.cxx
index 5e4993298a1e..345c70efcc16 100644
--- a/starmath/source/accessibility.cxx
+++ b/starmath/source/accessibility.cxx
@@ -1040,39 +1040,39 @@ static SfxItemState GetSvxEditEngineItemState( EditEngine const & rEditEngine, c
const SfxPoolItem* pParaItem = nullptr;
- for(std::vector<EECharAttrib>::const_iterator i = aAttribs.begin(); i < aAttribs.end(); ++i)
+ for(const auto& rAttrib : aAttribs)
{
- OSL_ENSURE( i->pAttr, "GetCharAttribs gives corrupt data" );
+ OSL_ENSURE( rAttrib.pAttr, "GetCharAttribs gives corrupt data" );
- const bool bEmptyPortion = (i->nStart == i->nEnd);
- if( (!bEmptyPortion && (i->nStart >= nEndPos)) || (bEmptyPortion && (i->nStart > nEndPos)) )
+ const bool bEmptyPortion = (rAttrib.nStart == rAttrib.nEnd);
+ if( (!bEmptyPortion && (rAttrib.nStart >= nEndPos)) || (bEmptyPortion && (rAttrib.nStart > nEndPos)) )
break; // break if we are already behind our selection
- if( (!bEmptyPortion && (i->nEnd <= nPos)) || (bEmptyPortion && (i->nEnd < nPos)) )
+ if( (!bEmptyPortion && (rAttrib.nEnd <= nPos)) || (bEmptyPortion && (rAttrib.nEnd < nPos)) )
continue; // or if the attribute ends before our selection
- if( i->pAttr->Which() != nWhich )
+ if( rAttrib.pAttr->Which() != nWhich )
continue; // skip if is not the searched item
// if we already found an item
if( pParaItem )
{
// ... and its different to this one than the state is don't care
- if( *pParaItem != *(i->pAttr) )
+ if( *pParaItem != *(rAttrib.pAttr) )
return SfxItemState::DONTCARE;
}
else
{
- pParaItem = i->pAttr;
+ pParaItem = rAttrib.pAttr;
}
if( bEmpty )
bEmpty = false;
- if( !bGaps && i->nStart > nLastEnd )
+ if( !bGaps && rAttrib.nStart > nLastEnd )
bGaps = true;
- nLastEnd = i->nEnd;
+ nLastEnd = rAttrib.nEnd;
}
if( !bEmpty && !bGaps && nLastEnd < ( nEndPos - 1 ) )