[Libreoffice-commits] core.git: sc/inc scripting/source sc/source sd/source stoc/source sw/source xmlsecurity/source

Arkadiy Illarionov qarkai at gmail.com
Fri Jun 15 14:25:23 UTC 2018


 sc/inc/rangelst.hxx                                   |    2 -
 sc/source/core/tool/interpr3.cxx                      |    7 +--
 sc/source/core/tool/rangelst.cxx                      |   20 +++++------
 scripting/source/stringresource/stringresource.cxx    |   32 +++++++++---------
 scripting/source/stringresource/stringresource.hxx    |    2 -
 sd/source/ui/dlg/RemoteDialogClientBox.cxx            |    3 -
 stoc/source/javavm/javavm.cxx                         |    3 -
 sw/source/core/inc/rolbck.hxx                         |    5 +-
 sw/source/filter/ww8/wrtww8.hxx                       |    1 
 sw/source/filter/ww8/ww8atr.cxx                       |    4 +-
 xmlsecurity/source/helper/documentsignaturehelper.cxx |   13 ++-----
 11 files changed, 40 insertions(+), 52 deletions(-)

New commits:
commit 1774599479c1b89ac048183c95e1ba9076dfe609
Author: Arkadiy Illarionov <qarkai at gmail.com>
Date:   Tue Jun 12 20:34:41 2018 +0300

    tdf#96099 Remove some trivial std::vector iterator typedefs
    
    Change-Id: Iced10ed59c475dff4d33ff06151b2015a27a860b
    Reviewed-on: https://gerrit.libreoffice.org/55715
    Tested-by: Jenkins
    Reviewed-by: Tor Lillqvist <tml at collabora.com>

diff --git a/sc/inc/rangelst.hxx b/sc/inc/rangelst.hxx
index 6a1afadad037..50fb4645d0c7 100644
--- a/sc/inc/rangelst.hxx
+++ b/sc/inc/rangelst.hxx
@@ -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;
 
diff --git a/sc/source/core/tool/interpr3.cxx b/sc/source/core/tool/interpr3.cxx
index 8c433bab587c..71bde5c05092 100644
--- a/sc/source/core/tool/interpr3.cxx
+++ b/sc/source/core/tool/interpr3.cxx
@@ -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; )
diff --git a/sc/source/core/tool/rangelst.cxx b/sc/source/core/tool/rangelst.cxx
index 51693615e653..cd10b807bf18 100644
--- a/sc/source/core/tool/rangelst.cxx
+++ b/sc/source/core/tool/rangelst.cxx
@@ -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))
diff --git a/scripting/source/stringresource/stringresource.cxx b/scripting/source/stringresource/stringresource.cxx
index 538bd5ed77e0..36fcde4f2015 100644
--- a/scripting/source/stringresource/stringresource.cxx
+++ b/scripting/source/stringresource/stringresource.cxx
@@ -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 )
diff --git a/scripting/source/stringresource/stringresource.hxx b/scripting/source/stringresource/stringresource.hxx
index 3ecfa641358f..b871e8677576 100644
--- a/scripting/source/stringresource/stringresource.hxx
+++ b/scripting/source/stringresource/stringresource.hxx
@@ -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,
diff --git a/sd/source/ui/dlg/RemoteDialogClientBox.cxx b/sd/source/ui/dlg/RemoteDialogClientBox.cxx
index d159eea1b16e..b19745203198 100644
--- a/sd/source/ui/dlg/RemoteDialogClientBox.cxx
+++ b/sd/source/ui/dlg/RemoteDialogClientBox.cxx
@@ -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);
diff --git a/stoc/source/javavm/javavm.cxx b/stoc/source/javavm/javavm.cxx
index 97167891c3e2..053449dc8e6e 100644
--- a/stoc/source/javavm/javavm.cxx
+++ b/stoc/source/javavm/javavm.cxx
@@ -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( '=');
diff --git a/sw/source/core/inc/rolbck.hxx b/sw/source/core/inc/rolbck.hxx
index ef6642719a72..60edcb313033 100644
--- a/sw/source/core/inc/rolbck.hxx
+++ b/sw/source/core/inc/rolbck.hxx
@@ -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 );
diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx
index 1a7f9675976b..d5fc888aa6c7 100644
--- a/sw/source/filter/ww8/wrtww8.hxx
+++ b/sw/source/filter/ww8/wrtww8.hxx
@@ -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
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index b57dcf28d06f..c45a7d9546c1 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -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 ) )
             {
diff --git a/xmlsecurity/source/helper/documentsignaturehelper.cxx b/xmlsecurity/source/helper/documentsignaturehelper.cxx
index 8bb06b84e92a..c6ee555e0068 100644
--- a/xmlsecurity/source/helper/documentsignaturehelper.cxx
+++ b/xmlsecurity/source/helper/documentsignaturehelper.cxx
@@ -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(


More information about the Libreoffice-commits mailing list