Kaydet (Commit) 17745994 authored tarafından Arkadiy Illarionov's avatar Arkadiy Illarionov Kaydeden (comit) Tor Lillqvist

tdf#96099 Remove some trivial std::vector iterator typedefs

Change-Id: Iced10ed59c475dff4d33ff06151b2015a27a860b
Reviewed-on: https://gerrit.libreoffice.org/55715
Tested-by: Jenkins
Reviewed-by: 's avatarTor Lillqvist <tml@collabora.com>
üst 434c730a
......@@ -98,8 +98,6 @@ public:
private:
::std::vector<ScRange> maRanges;
SCROW mnMaxRowUsed;
typedef std::vector<ScRange>::iterator iterator;
typedef std::vector<ScRange>::const_iterator const_iterator;
};
typedef tools::SvRef<ScRangeList> ScRangeListRef;
......
......@@ -1892,8 +1892,7 @@ double ScInterpreter::GetHypGeomDist( double x, double n, double M, double N )
{
const size_t nMaxArraySize = 500000; // arbitrary max array size
typedef ::std::vector< double > HypContainer;
HypContainer cnNumer, cnDenom;
std::vector<double> cnNumer, cnDenom;
size_t nEstContainerSize = static_cast<size_t>( x + ::std::min( n, M ) );
size_t nMaxSize = ::std::min( cnNumer.max_size(), nMaxArraySize );
......@@ -2068,8 +2067,8 @@ double ScInterpreter::GetHypGeomDist( double x, double n, double M, double N )
::std::sort( cnNumer.begin(), cnNumer.end() );
::std::sort( cnDenom.begin(), cnDenom.end() );
HypContainer::reverse_iterator it1 = cnNumer.rbegin(), it1End = cnNumer.rend();
HypContainer::reverse_iterator it2 = cnDenom.rbegin(), it2End = cnDenom.rend();
auto it1 = cnNumer.rbegin(), it1End = cnNumer.rend();
auto it2 = cnDenom.rbegin(), it2End = cnDenom.rend();
double fFactor = 1.0;
for ( ; it1 != it1End || it2 != it2End; )
......
......@@ -401,7 +401,7 @@ bool ScRangeList::UpdateReference(
if(maRanges.empty())
return true;
iterator itr = maRanges.begin(), itrEnd = maRanges.end();
auto itr = maRanges.begin(), itrEnd = maRanges.end();
for (; itr != itrEnd; ++itr)
{
ScRange& rR = *itr;
......@@ -441,7 +441,7 @@ bool ScRangeList::UpdateReference(
void ScRangeList::InsertRow( SCTAB nTab, SCCOL nColStart, SCCOL nColEnd, SCROW nRowPos, SCSIZE nSize )
{
std::vector<ScRange> aNewRanges;
for(iterator it = maRanges.begin(), itEnd = maRanges.end(); it != itEnd;
for(auto it = maRanges.begin(), itEnd = maRanges.end(); it != itEnd;
++it)
{
ScRange & rRange = *it;
......@@ -461,7 +461,7 @@ void ScRangeList::InsertRow( SCTAB nTab, SCCOL nColStart, SCCOL nColEnd, SCROW n
}
}
for(std::vector<ScRange>::const_iterator it = aNewRanges.begin(), itEnd = aNewRanges.end();
for(auto it = aNewRanges.cbegin(), itEnd = aNewRanges.cend();
it != itEnd; ++it)
{
if(!it->IsValid())
......@@ -474,7 +474,7 @@ void ScRangeList::InsertRow( SCTAB nTab, SCCOL nColStart, SCCOL nColEnd, SCROW n
void ScRangeList::InsertCol( SCTAB nTab, SCROW nRowStart, SCROW nRowEnd, SCCOL nColPos, SCSIZE nSize )
{
std::vector<ScRange> aNewRanges;
for(iterator it = maRanges.begin(), itEnd = maRanges.end(); it != itEnd;
for(auto it = maRanges.begin(), itEnd = maRanges.end(); it != itEnd;
++it)
{
ScRange & rRange = *it;
......@@ -945,7 +945,7 @@ bool ScRangeList::DeleteArea( SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
std::vector<ScRange> aNewRanges;
for(iterator itr = maRanges.begin(); itr != maRanges.end(); ++itr)
for(auto itr = maRanges.begin(); itr != maRanges.end(); ++itr)
{
// we have two basic cases here:
// 1. Delete area and pRange intersect
......@@ -1005,14 +1005,14 @@ bool ScRangeList::DeleteArea( SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
const ScRange* ScRangeList::Find( const ScAddress& rAdr ) const
{
const_iterator itr = find_if(
maRanges.begin(), maRanges.end(), FindEnclosingRange<ScAddress>(rAdr));
auto itr = find_if(
maRanges.cbegin(), maRanges.cend(), FindEnclosingRange<ScAddress>(rAdr));
return itr == maRanges.end() ? nullptr : &*itr;
}
ScRange* ScRangeList::Find( const ScAddress& rAdr )
{
iterator itr = find_if(
auto itr = find_if(
maRanges.begin(), maRanges.end(), FindEnclosingRange<ScAddress>(rAdr));
return itr == maRanges.end() ? nullptr : &*itr;
}
......@@ -1089,7 +1089,7 @@ ScRange ScRangeList::Combine() const
if (maRanges.empty())
return ScRange();
const_iterator itr = maRanges.begin(), itrEnd = maRanges.end();
auto itr = maRanges.cbegin(), itrEnd = maRanges.cend();
ScRange aRet = *itr;
++itr;
for (; itr != itrEnd; ++itr)
......@@ -1145,7 +1145,7 @@ ScAddress ScRangeList::GetTopLeftCorner() const
ScRangeList ScRangeList::GetIntersectedRange(const ScRange& rRange) const
{
ScRangeList aReturn;
for(const_iterator itr = maRanges.begin(), itrEnd = maRanges.end();
for(auto itr = maRanges.cbegin(), itrEnd = maRanges.cend();
itr != itrEnd; ++itr)
{
if(itr->Intersects(rRange))
......
......@@ -112,13 +112,13 @@ StringResourceImpl::StringResourceImpl( const Reference< XComponentContext >& rx
StringResourceImpl::~StringResourceImpl()
{
for( LocaleItemVectorIt it = m_aLocaleItemVector.begin(); it != m_aLocaleItemVector.end(); ++it )
for( auto it = m_aLocaleItemVector.begin(); it != m_aLocaleItemVector.end(); ++it )
{
LocaleItem* pLocaleItem = *it;
delete pLocaleItem;
}
for( LocaleItemVectorIt it = m_aDeletedLocaleItemVector.begin(); it != m_aDeletedLocaleItemVector.end(); ++it )
for( auto it = m_aDeletedLocaleItemVector.begin(); it != m_aDeletedLocaleItemVector.end(); ++it )
{
LocaleItem* pLocaleItem = *it;
delete pLocaleItem;
......@@ -291,7 +291,7 @@ Sequence< Locale > StringResourceImpl::getLocales( )
Sequence< Locale > aLocalSeq( nSize );
Locale* pLocales = aLocalSeq.getArray();
int iTarget = 0;
for( LocaleItemVectorConstIt it = m_aLocaleItemVector.begin(); it != m_aLocaleItemVector.end(); ++it )
for( auto it = m_aLocaleItemVector.cbegin(); it != m_aLocaleItemVector.cend(); ++it )
{
LocaleItem* pLocaleItem = *it;
pLocales[iTarget] = pLocaleItem->m_locale;
......@@ -511,7 +511,7 @@ void StringResourceImpl::removeLocale( const Locale& locale )
m_pDefaultLocaleItem == pRemoveItem )
{
LocaleItem* pFallbackItem = nullptr;
for( LocaleItemVectorIt it = m_aLocaleItemVector.begin(); it != m_aLocaleItemVector.end(); ++it )
for( auto it = m_aLocaleItemVector.begin(); it != m_aLocaleItemVector.end(); ++it )
{
LocaleItem* pLocaleItem = *it;
if( pLocaleItem != pRemoveItem )
......@@ -530,7 +530,7 @@ void StringResourceImpl::removeLocale( const Locale& locale )
}
}
}
for( LocaleItemVectorIt it = m_aLocaleItemVector.begin(); it != m_aLocaleItemVector.end(); ++it )
for( auto it = m_aLocaleItemVector.begin(); it != m_aLocaleItemVector.end(); ++it )
{
LocaleItem* pLocaleItem = *it;
if( pLocaleItem == pRemoveItem )
......@@ -606,7 +606,7 @@ LocaleItem* StringResourceImpl::getItemForLocale
LocaleItem* pRetItem = nullptr;
// Search for locale
for( LocaleItemVectorConstIt it = m_aLocaleItemVector.begin(); it != m_aLocaleItemVector.end(); ++it )
for( auto it = m_aLocaleItemVector.cbegin(); it != m_aLocaleItemVector.cend(); ++it )
{
LocaleItem* pLocaleItem = *it;
if( pLocaleItem )
......@@ -637,7 +637,7 @@ LocaleItem* StringResourceImpl::getClosestMatchItemForLocale( const Locale& loca
::std::vector< Locale > aLocales( m_aLocaleItemVector.size());
size_t i = 0;
for( LocaleItemVectorConstIt it = m_aLocaleItemVector.begin(); it != m_aLocaleItemVector.end(); ++it, ++i )
for( auto it = m_aLocaleItemVector.cbegin(); it != m_aLocaleItemVector.cend(); ++it, ++i )
{
LocaleItem* pLocaleItem = *it;
aLocales[i] = (pLocaleItem ? pLocaleItem->m_locale : Locale());
......@@ -903,7 +903,7 @@ void StringResourcePersistenceImpl::implStoreAtStorage
{
while( m_aDeletedLocaleItemVector.size() > 0 )
{
LocaleItemVectorIt it = m_aDeletedLocaleItemVector.begin();
auto it = m_aDeletedLocaleItemVector.begin();
LocaleItem* pLocaleItem = *it;
if( pLocaleItem != nullptr )
{
......@@ -923,7 +923,7 @@ void StringResourcePersistenceImpl::implStoreAtStorage
}
}
for( LocaleItemVectorConstIt it = m_aLocaleItemVector.begin(); it != m_aLocaleItemVector.end(); ++it )
for( auto it = m_aLocaleItemVector.cbegin(); it != m_aLocaleItemVector.cend(); ++it )
{
LocaleItem* pLocaleItem = *it;
if( pLocaleItem != nullptr && (bStoreAll || pLocaleItem->m_bModified) &&
......@@ -960,7 +960,7 @@ void StringResourcePersistenceImpl::implStoreAtStorage
// Delete files for changed defaults
if( bUsedForStore )
{
for( LocaleItemVectorIt it = m_aChangedDefaultLocaleVector.begin();
for( auto it = m_aChangedDefaultLocaleVector.begin();
it != m_aChangedDefaultLocaleVector.end(); ++it )
{
LocaleItem* pLocaleItem = *it;
......@@ -1023,7 +1023,7 @@ void StringResourcePersistenceImpl::implKillRemovedLocaleFiles
// Delete files for deleted locales
while( m_aDeletedLocaleItemVector.size() > 0 )
{
LocaleItemVectorIt it = m_aDeletedLocaleItemVector.begin();
auto it = m_aDeletedLocaleItemVector.begin();
LocaleItem* pLocaleItem = *it;
if( pLocaleItem != nullptr )
{
......@@ -1046,7 +1046,7 @@ void StringResourcePersistenceImpl::implKillChangedDefaultFiles
)
{
// Delete files for changed defaults
for( LocaleItemVectorIt it = m_aChangedDefaultLocaleVector.begin();
for( auto it = m_aChangedDefaultLocaleVector.begin();
it != m_aChangedDefaultLocaleVector.end(); ++it )
{
LocaleItem* pLocaleItem = *it;
......@@ -1078,7 +1078,7 @@ void StringResourcePersistenceImpl::implStoreAtLocation
if( bUsedForStore || bKillAll )
implKillRemovedLocaleFiles( Location, aNameBase, xFileAccess );
for( LocaleItemVectorConstIt it = m_aLocaleItemVector.begin(); it != m_aLocaleItemVector.end(); ++it )
for( auto it = m_aLocaleItemVector.cbegin(); it != m_aLocaleItemVector.cend(); ++it )
{
LocaleItem* pLocaleItem = *it;
if( pLocaleItem != nullptr && (bStoreAll || bKillAll || pLocaleItem->m_bModified) &&
......@@ -1270,8 +1270,8 @@ Sequence< sal_Int8 > StringResourcePersistenceImpl::exportBinary( )
sal_Int32 iLocale = 0;
sal_Int32 iDefault = 0;
for( LocaleItemVectorConstIt it = m_aLocaleItemVector.begin();
it != m_aLocaleItemVector.end(); ++it,++iLocale )
for( auto it = m_aLocaleItemVector.cbegin();
it != m_aLocaleItemVector.cend(); ++it,++iLocale )
{
LocaleItem* pLocaleItem = *it;
if( pLocaleItem != nullptr && loadLocale( pLocaleItem ) )
......@@ -1568,7 +1568,7 @@ bool checkNamingSceme( const OUString& aName, const OUString& aNameBase,
void StringResourcePersistenceImpl::implLoadAllLocales()
{
for( LocaleItemVectorIt it = m_aLocaleItemVector.begin(); it != m_aLocaleItemVector.end(); ++it )
for( auto it = m_aLocaleItemVector.begin(); it != m_aLocaleItemVector.end(); ++it )
{
LocaleItem* pLocaleItem = *it;
if( pLocaleItem != nullptr )
......
......@@ -83,8 +83,6 @@ struct LocaleItem
};
typedef std::vector< LocaleItem* > LocaleItemVector;
typedef std::vector< LocaleItem* >::iterator LocaleItemVectorIt;
typedef std::vector< LocaleItem* >::const_iterator LocaleItemVectorConstIt;
typedef ::cppu::WeakImplHelper<
css::lang::XServiceInfo,
......
......@@ -483,8 +483,7 @@ void ClientBox::Paint(vcl::RenderContext& rRenderContext, const ::tools::Rectang
const ::osl::MutexGuard aGuard(m_entriesMutex);
typedef std::vector< TClientBoxEntry >::iterator ITER;
for (ITER iIndex = m_vEntries.begin(); iIndex < m_vEntries.end(); ++iIndex)
for (auto iIndex = m_vEntries.begin(); iIndex < m_vEntries.end(); ++iIndex)
{
aSize.setHeight( (*iIndex)->m_bActive ? m_nActiveHeight : m_nStdHeight );
::tools::Rectangle aEntryRect(aStart, aSize);
......
......@@ -1397,9 +1397,8 @@ void JavaVirtualMachine::setINetSettingsInVM(bool set_reset)
JVM jvm;
getINetPropsFromConfig( &jvm, m_xContext->getServiceManager(), m_xContext);
const ::std::vector< OUString> & Props = jvm.getProperties();
typedef ::std::vector< OUString >::const_iterator C_IT;
for( C_IT i= Props.begin(); i != Props.end(); ++i)
for( auto i= Props.cbegin(); i != Props.cend(); ++i)
{
OUString prop= *i;
sal_Int32 index= prop.indexOf( '=');
......
......@@ -315,7 +315,6 @@ class SwHistory
sal_uInt16 m_nEndDiff;
public:
typedef std::vector<SwHistoryHint*>::iterator SwpHstry_iterator;
SwHistory();
~SwHistory();
......@@ -347,8 +346,8 @@ public:
void Move( sal_uInt16 nPos, SwHistory *pIns,
sal_uInt16 const nStart = 0)
{
SwpHstry_iterator itSourceBegin = pIns->m_SwpHstry.begin() + nStart;
SwpHstry_iterator itSourceEnd = pIns->m_SwpHstry.end();
auto itSourceBegin = pIns->m_SwpHstry.begin() + nStart;
auto itSourceEnd = pIns->m_SwpHstry.end();
if (itSourceBegin == itSourceEnd) return;
m_SwpHstry.insert(m_SwpHstry.begin() + nPos, itSourceBegin, itSourceEnd);
pIns->m_SwpHstry.erase( itSourceBegin, itSourceEnd );
......
......@@ -456,7 +456,6 @@ class MSWordExportBase
public:
wwFontHelper m_aFontHelper;
std::vector<sal_uLong> m_aChapterFieldLocs;
typedef std::vector<sal_uLong>::const_iterator mycCFIter;
OUString m_aMainStg;
std::vector<const SwTOXType*> m_aTOXArr;
const SfxItemSet* m_pISet; // for double attributes
......
......@@ -344,8 +344,8 @@ bool MSWordExportBase::ContentContainsChapterField(const SwFormatContent &rConte
sal_uLong nStart = aIdx.GetIndex();
sal_uLong nEnd = aEnd.GetIndex();
//If the header/footer contains a chapter field
mycCFIter aIEnd = m_aChapterFieldLocs.end();
for ( mycCFIter aI = m_aChapterFieldLocs.begin(); aI != aIEnd; ++aI )
auto aIEnd = m_aChapterFieldLocs.cend();
for ( auto aI = m_aChapterFieldLocs.cbegin(); aI != aIEnd; ++aI )
{
if ( ( nStart <= *aI ) && ( *aI <= nEnd ) )
{
......
......@@ -142,9 +142,8 @@ bool DocumentSignatureHelper::isODFPre_1_2(const OUString & sVersion)
bool DocumentSignatureHelper::isOOo3_2_Signature(const SignatureInformation & sigInfo)
{
bool bOOo3_2 = false;
typedef ::std::vector< SignatureReferenceInformation >::const_iterator CIT;
for (CIT i = sigInfo.vSignatureReferenceInfors.begin();
i < sigInfo.vSignatureReferenceInfors.end(); ++i)
for (auto i = sigInfo.vSignatureReferenceInfors.cbegin();
i < sigInfo.vSignatureReferenceInfors.cend(); ++i)
{
if (i->ouURI == "META-INF/manifest.xml")
{
......@@ -450,8 +449,7 @@ bool DocumentSignatureHelper::checkIfAllFilesAreSigned(
}
//find the file in the element list
typedef ::std::vector< OUString >::const_iterator CIT;
for (CIT aIter = sElementList.begin(); aIter != sElementList.end(); ++aIter)
for (auto aIter = sElementList.cbegin(); aIter != sElementList.cend(); ++aIter)
{
OUString sElementListURI = *aIter;
if (alg == DocumentSignatureAlgorithm::OOo2)
......@@ -503,9 +501,8 @@ bool DocumentSignatureHelper::equalsReferenceUriManifestPath(
if (vUriSegments.size() == vPathSegments.size())
{
retVal = true;
typedef std::vector<OUString>::const_iterator CIT;
for (CIT i = vUriSegments.begin(), j = vPathSegments.begin();
i != vUriSegments.end(); ++i, ++j)
for (auto i = vUriSegments.cbegin(), j = vPathSegments.cbegin();
i != vUriSegments.cend(); ++i, ++j)
{
//Decode the uri segment, so that %20 becomes ' ', etc.
OUString sDecUri = ::rtl::Uri::decode(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment