summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArkadiy Illarionov <qarkai@gmail.com>2018-06-17 16:35:03 +0300
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-06-23 13:10:18 +0200
commit849d5d9903e54c92682227dfad545664e4bbda53 (patch)
treed2e385839497499bd3d581a0034eadaffa27ad7c
parent817e3054596da127efe8f87eac33cc0350319ba4 (diff)
tdf#96099 Remove some trivial std::vector typedefs in sc
Change-Id: Ie54a5ba0af989eabc71781674180a042f4be8bdb Reviewed-on: https://gerrit.libreoffice.org/55949 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--sc/source/filter/ftools/fapihelper.cxx7
-rw-r--r--sc/source/filter/inc/unitconverter.hxx7
-rw-r--r--sc/source/filter/inc/xltracer.hxx3
-rw-r--r--sc/source/filter/oox/formulaparser.cxx12
-rw-r--r--sc/source/filter/oox/pivotcachebuffer.cxx12
-rw-r--r--sc/source/filter/oox/unitconverter.cxx6
-rw-r--r--sc/source/ui/dbgui/csvsplits.cxx4
-rw-r--r--sc/source/ui/inc/conflictsdlg.hxx10
-rw-r--r--sc/source/ui/inc/csvsplits.hxx1
-rw-r--r--sc/source/ui/miscdlgs/conflictsdlg.cxx40
10 files changed, 45 insertions, 57 deletions
diff --git a/sc/source/filter/ftools/fapihelper.cxx b/sc/source/filter/ftools/fapihelper.cxx
index 27184bbb3cf4..1d40cd44c0aa 100644
--- a/sc/source/filter/ftools/fapihelper.cxx
+++ b/sc/source/filter/ftools/fapihelper.cxx
@@ -277,8 +277,7 @@ ScfPropSetHelper::ScfPropSetHelper( const sal_Char* const* ppcPropNames ) :
// create OUStrings from ASCII property names
typedef ::std::pair< OUString, size_t > IndexedOUString;
- typedef ::std::vector< IndexedOUString > IndexedOUStringVec;
- IndexedOUStringVec aPropNameVec;
+ std::vector<IndexedOUString> aPropNameVec;
for( size_t nVecIdx = 0; *ppcPropNames; ++ppcPropNames, ++nVecIdx )
{
OUString aPropName = OUString::createFromAscii( *ppcPropNames );
@@ -296,8 +295,8 @@ ScfPropSetHelper::ScfPropSetHelper( const sal_Char* const* ppcPropNames ) :
// fill the property name sequence and store original sort order
sal_Int32 nSeqIdx = 0;
- for( IndexedOUStringVec::const_iterator aIt = aPropNameVec.begin(),
- aEnd = aPropNameVec.end(); aIt != aEnd; ++aIt, ++nSeqIdx )
+ for( auto aIt = aPropNameVec.cbegin(), aEnd = aPropNameVec.cend();
+ aIt != aEnd; ++aIt, ++nSeqIdx )
{
maNameSeq[ nSeqIdx ] = aIt->first;
maNameOrder[ aIt->second ] = nSeqIdx;
diff --git a/sc/source/filter/inc/unitconverter.hxx b/sc/source/filter/inc/unitconverter.hxx
index 01e5aff2b7fc..87d19577bec8 100644
--- a/sc/source/filter/inc/unitconverter.hxx
+++ b/sc/source/filter/inc/unitconverter.hxx
@@ -97,11 +97,8 @@ private:
void addErrorCode( sal_uInt8 nErrorCode, const OUString& rErrorCode );
private:
- typedef ::std::vector< double > DoubleVector;
- typedef ::std::map< OUString, sal_uInt8 > OoxErrorCodeMap;
-
- DoubleVector maCoeffs; /// Coefficients for unit conversion.
- OoxErrorCodeMap maOoxErrCodes; /// Maps error code strings to BIFF error constants.
+ std::vector<double> maCoeffs; /// Coefficients for unit conversion.
+ std::map<OUString, sal_uInt8> maOoxErrCodes; /// Maps error code strings to BIFF error constants.
sal_Int32 mnNullDate; /// Nulldate of this workbook (number of days since 0000-01-01).
};
diff --git a/sc/source/filter/inc/xltracer.hxx b/sc/source/filter/inc/xltracer.hxx
index bd2ed920e0d2..f5fb567be3f0 100644
--- a/sc/source/filter/inc/xltracer.hxx
+++ b/sc/source/filter/inc/xltracer.hxx
@@ -80,9 +80,8 @@ public:
private:
bool mbEnabled;
- typedef ::std::vector< bool > BoolVec;
/** array of flags corresponding to each entry in the XclTracerDetails table. */
- BoolVec maFirstTimes;
+ std::vector<bool> maFirstTimes;
};
#endif
diff --git a/sc/source/filter/oox/formulaparser.cxx b/sc/source/filter/oox/formulaparser.cxx
index 3ac93e1c2668..f5d43edf5b17 100644
--- a/sc/source/filter/oox/formulaparser.cxx
+++ b/sc/source/filter/oox/formulaparser.cxx
@@ -537,11 +537,9 @@ protected:
bool mbSpecialTokens; /// True = special handling for tExp and tTbl tokens, false = exit with error.
private:
- typedef ::std::vector< size_t > SizeTypeVector;
-
ApiTokenVector maTokenStorage; /// Raw unordered token storage.
- SizeTypeVector maTokenIndexes; /// Indexes into maTokenStorage.
- SizeTypeVector maOperandSizeStack; /// Stack with token sizes per operand.
+ std::vector<size_t> maTokenIndexes; /// Indexes into maTokenStorage.
+ std::vector<size_t> maOperandSizeStack; /// Stack with token sizes per operand.
WhiteSpaceVec maLeadingSpaces; /// List of whitespaces before next token.
WhiteSpaceVec maOpeningSpaces; /// List of whitespaces before opening parenthesis.
WhiteSpaceVec maClosingSpaces; /// List of whitespaces before closing parenthesis.
@@ -621,7 +619,7 @@ ApiTokenSequence FormulaParserImpl::finalizeImport()
if( aTokens.hasElements() )
{
ApiToken* pToken = aTokens.getArray();
- for( SizeTypeVector::const_iterator aIt = maTokenIndexes.begin(), aEnd = maTokenIndexes.end(); aIt != aEnd; ++aIt, ++pToken )
+ for( auto aIt = maTokenIndexes.cbegin(), aEnd = maTokenIndexes.cend(); aIt != aEnd; ++aIt, ++pToken )
*pToken = maTokenStorage[ *aIt ];
}
return finalizeTokenArray( aTokens );
@@ -716,8 +714,8 @@ ApiToken& FormulaParserImpl::getOperandToken( size_t nOpIndex, size_t nTokenInde
{
SAL_WARN_IF( getOperandSize( nOpIndex ) <= nTokenIndex, "sc.filter",
"FormulaParserImpl::getOperandToken - invalid parameters" );
- SizeTypeVector::const_iterator aIndexIt = maTokenIndexes.end();
- for( SizeTypeVector::const_iterator aEnd = maOperandSizeStack.end(), aIt = aEnd - 1 + nOpIndex; aIt != aEnd; ++aIt )
+ auto aIndexIt = maTokenIndexes.cend();
+ for( auto aEnd = maOperandSizeStack.cend(), aIt = aEnd - 1 + nOpIndex; aIt != aEnd; ++aIt )
aIndexIt -= *aIt;
return maTokenStorage[ *(aIndexIt + nTokenIndex) ];
}
diff --git a/sc/source/filter/oox/pivotcachebuffer.cxx b/sc/source/filter/oox/pivotcachebuffer.cxx
index 22f69e8e6884..663ba0961e80 100644
--- a/sc/source/filter/oox/pivotcachebuffer.cxx
+++ b/sc/source/filter/oox/pivotcachebuffer.cxx
@@ -656,12 +656,10 @@ OUString PivotCacheField::createParentGroupField( const Reference< XDataPilotFie
if( !xDPGrouping.is() ) return OUString();
// map the group item indexes from maGroupItems to all item indexes from maDiscreteItems
- typedef ::std::vector< sal_Int32 > GroupItemList;
- typedef ::std::vector< GroupItemList > GroupItemMap;
- GroupItemMap aItemMap( maGroupItems.size() );
+ std::vector< std::vector<sal_Int32> > aItemMap( maGroupItems.size() );
for( IndexVector::const_iterator aBeg = maDiscreteItems.begin(), aIt = aBeg, aEnd = maDiscreteItems.end(); aIt != aEnd; ++aIt )
{
- if( GroupItemList* pItems = ContainerHelper::getVectorElementAccess( aItemMap, *aIt ) )
+ if( std::vector<sal_Int32>* pItems = ContainerHelper::getVectorElementAccess( aItemMap, *aIt ) )
{
if ( const PivotCacheItem* pItem = rBaseCacheField.getCacheItems().getCacheItem( aIt - aBeg ) )
{
@@ -675,7 +673,7 @@ OUString PivotCacheField::createParentGroupField( const Reference< XDataPilotFie
// process all groups
Reference< XDataPilotField > xDPGroupField;
- for( GroupItemMap::iterator aBeg = aItemMap.begin(), aIt = aBeg, aEnd = aItemMap.end(); aIt != aEnd; ++aIt )
+ for( auto aBeg = aItemMap.begin(), aIt = aBeg, aEnd = aItemMap.end(); aIt != aEnd; ++aIt )
{
SAL_WARN_IF( aIt->empty(), "sc", "PivotCacheField::createParentGroupField - item/group should not be empty" );
if( !aIt->empty() )
@@ -688,7 +686,7 @@ OUString PivotCacheField::createParentGroupField( const Reference< XDataPilotFie
names as they are already grouped is used here to resolve the
item names. */
::std::vector< OUString > aMembers;
- for( GroupItemList::iterator aBeg2 = aIt->begin(), aIt2 = aBeg2, aEnd2 = aIt->end(); aIt2 != aEnd2; ++aIt2 )
+ for( auto aBeg2 = aIt->begin(), aIt2 = aBeg2, aEnd2 = aIt->end(); aIt2 != aEnd2; ++aIt2 )
if( const PivotCacheGroupItem* pName = ContainerHelper::getVectorElement( orItemNames, *aIt2 ) )
if( ::std::find( aMembers.begin(), aMembers.end(), pName->maGroupName ) == aMembers.end() )
aMembers.push_back( pName->maGroupName );
@@ -756,7 +754,7 @@ OUString PivotCacheField::createParentGroupField( const Reference< XDataPilotFie
aPropSet.setProperty( PROP_GroupInfo, aGroupInfo );
}
// replace original item names in passed vector with group name
- for( GroupItemList::iterator aIt2 = aIt->begin(), aEnd2 = aIt->end(); aIt2 != aEnd2; ++aIt2 )
+ for( auto aIt2 = aIt->begin(), aEnd2 = aIt->end(); aIt2 != aEnd2; ++aIt2 )
if( PivotCacheGroupItem* pName = ContainerHelper::getVectorElementAccess( orItemNames, *aIt2 ) )
pName->maGroupName = aGroupName;
}
diff --git a/sc/source/filter/oox/unitconverter.cxx b/sc/source/filter/oox/unitconverter.cxx
index 8aa4a850abb6..f805ae52c2ac 100644
--- a/sc/source/filter/oox/unitconverter.cxx
+++ b/sc/source/filter/oox/unitconverter.cxx
@@ -215,14 +215,14 @@ util::DateTime UnitConverter::calcDateTimeFromSerial( double fSerial ) const
sal_uInt8 UnitConverter::calcBiffErrorCode( const OUString& rErrorCode ) const
{
- OoxErrorCodeMap::const_iterator aIt = maOoxErrCodes.find( rErrorCode );
+ auto aIt = maOoxErrCodes.find( rErrorCode );
return (aIt == maOoxErrCodes.end()) ? BIFF_ERR_NA : aIt->second;
}
OUString UnitConverter::calcErrorString( sal_uInt8 nErrorCode ) const
{
- OoxErrorCodeMap::const_iterator iFail( maOoxErrCodes.end());
- for (OoxErrorCodeMap::const_iterator aIt( maOoxErrCodes.begin()); aIt != maOoxErrCodes.end(); ++aIt)
+ auto iFail( maOoxErrCodes.cend());
+ for (auto aIt( maOoxErrCodes.cbegin()); aIt != maOoxErrCodes.cend(); ++aIt)
{
if (aIt->second == nErrorCode)
return aIt->first;
diff --git a/sc/source/ui/dbgui/csvsplits.cxx b/sc/source/ui/dbgui/csvsplits.cxx
index 3b8c57b199ef..575bd53d0ac7 100644
--- a/sc/source/ui/dbgui/csvsplits.cxx
+++ b/sc/source/ui/dbgui/csvsplits.cxx
@@ -28,7 +28,7 @@ bool ScCsvSplits::Insert( sal_Int32 nPos )
if (nPos < 0)
return false;
- const iterator aIter = ::std::lower_bound( maVec.begin(), maVec.end(), nPos );
+ const auto aIter = ::std::lower_bound( maVec.begin(), maVec.end(), nPos );
if (aIter != maVec.end() && *aIter == nPos)
return false;
@@ -70,7 +70,7 @@ bool ScCsvSplits::HasSplit( sal_Int32 nPos ) const
sal_uInt32 ScCsvSplits::GetIndex( sal_Int32 nPos ) const
{
- const_iterator aIter = ::std::lower_bound( maVec.begin(), maVec.end(), nPos );
+ auto aIter = ::std::lower_bound( maVec.cbegin(), maVec.cend(), nPos );
return GetIterIndex( ((aIter != maVec.end()) && (*aIter == nPos)) ? aIter : maVec.end() );
}
diff --git a/sc/source/ui/inc/conflictsdlg.hxx b/sc/source/ui/inc/conflictsdlg.hxx
index e21fa544fbb3..96b5414b31df 100644
--- a/sc/source/ui/inc/conflictsdlg.hxx
+++ b/sc/source/ui/inc/conflictsdlg.hxx
@@ -39,15 +39,13 @@ enum ScConflictAction
SC_CONFLICT_ACTION_KEEP_OTHER
};
-typedef ::std::vector< sal_uLong > ScChangeActionList;
-
// struct ScConflictsListEntry
struct ScConflictsListEntry
{
ScConflictAction meConflictAction;
- ScChangeActionList maSharedActions;
- ScChangeActionList maOwnActions;
+ std::vector<sal_uLong> maSharedActions;
+ std::vector<sal_uLong> maOwnActions;
bool HasSharedAction( sal_uLong nSharedAction ) const;
bool HasOwnAction( sal_uLong nOwnAction ) const;
@@ -60,7 +58,7 @@ typedef ::std::vector< ScConflictsListEntry > ScConflictsList;
class ScConflictsListHelper
{
private:
- static void Transform_Impl( ScChangeActionList& rActionList, ScChangeActionMergeMap* pMergeMap );
+ static void Transform_Impl( std::vector<sal_uLong>& rActionList, ScChangeActionMergeMap* pMergeMap );
public:
static bool HasOwnAction( ScConflictsList& rConflictsList, sal_uLong nOwnAction );
@@ -86,7 +84,7 @@ private:
static bool DoActionsIntersect( const ScChangeAction* pAction1, const ScChangeAction* pAction2 );
ScConflictsListEntry* GetIntersectingEntry( const ScChangeAction* pAction ) const;
- ScConflictsListEntry* GetEntry( sal_uLong nSharedAction, const ScChangeActionList& rOwnActions );
+ ScConflictsListEntry* GetEntry( sal_uLong nSharedAction, const std::vector<sal_uLong>& rOwnActions );
public:
ScConflictsFinder( ScChangeTrack* pTrack, sal_uLong nStartShared, sal_uLong nEndShared,
diff --git a/sc/source/ui/inc/csvsplits.hxx b/sc/source/ui/inc/csvsplits.hxx
index 93aa22b991ae..b6f78c0e1e40 100644
--- a/sc/source/ui/inc/csvsplits.hxx
+++ b/sc/source/ui/inc/csvsplits.hxx
@@ -34,7 +34,6 @@ class ScCsvSplits
{
private:
typedef ::std::vector< sal_Int32 > ScSplitVector;
- typedef ScSplitVector::iterator iterator;
typedef ScSplitVector::const_iterator const_iterator;
ScSplitVector maVec; /// The split containter.
diff --git a/sc/source/ui/miscdlgs/conflictsdlg.cxx b/sc/source/ui/miscdlgs/conflictsdlg.cxx
index f6fbfbd3184f..6520573b2eac 100644
--- a/sc/source/ui/miscdlgs/conflictsdlg.cxx
+++ b/sc/source/ui/miscdlgs/conflictsdlg.cxx
@@ -29,8 +29,8 @@
bool ScConflictsListEntry::HasSharedAction( sal_uLong nSharedAction ) const
{
- ScChangeActionList::const_iterator aEnd = maSharedActions.end();
- for ( ScChangeActionList::const_iterator aItr = maSharedActions.begin(); aItr != aEnd; ++aItr )
+ auto aEnd = maSharedActions.cend();
+ for ( auto aItr = maSharedActions.cbegin(); aItr != aEnd; ++aItr )
{
if ( *aItr == nSharedAction )
{
@@ -43,8 +43,8 @@ bool ScConflictsListEntry::HasSharedAction( sal_uLong nSharedAction ) const
bool ScConflictsListEntry::HasOwnAction( sal_uLong nOwnAction ) const
{
- ScChangeActionList::const_iterator aEnd = maOwnActions.end();
- for ( ScChangeActionList::const_iterator aItr = maOwnActions.begin(); aItr != aEnd; ++aItr )
+ auto aEnd = maOwnActions.cend();
+ for ( auto aItr = maOwnActions.cbegin(); aItr != aEnd; ++aItr )
{
if ( *aItr == nOwnAction )
{
@@ -99,14 +99,14 @@ ScConflictsListEntry* ScConflictsListHelper::GetOwnActionEntry( ScConflictsList&
return nullptr;
}
-void ScConflictsListHelper::Transform_Impl( ScChangeActionList& rActionList, ScChangeActionMergeMap* pMergeMap )
+void ScConflictsListHelper::Transform_Impl( std::vector<sal_uLong>& rActionList, ScChangeActionMergeMap* pMergeMap )
{
if ( !pMergeMap )
{
return;
}
- for ( ScChangeActionList::iterator aItr = rActionList.begin(); aItr != rActionList.end(); )
+ for ( auto aItr = rActionList.begin(); aItr != rActionList.end(); )
{
ScChangeActionMergeMap::iterator aItrMap = pMergeMap->find( *aItr );
if ( aItrMap != pMergeMap->end() )
@@ -167,8 +167,8 @@ ScConflictsListEntry* ScConflictsFinder::GetIntersectingEntry( const ScChangeAct
ScConflictsList::iterator aEnd = mrConflictsList.end();
for ( ScConflictsList::iterator aItr = mrConflictsList.begin(); aItr != aEnd; ++aItr )
{
- ScChangeActionList::const_iterator aEndShared = aItr->maSharedActions.end();
- for ( ScChangeActionList::const_iterator aItrShared = aItr->maSharedActions.begin(); aItrShared != aEndShared; ++aItrShared )
+ auto aEndShared = aItr->maSharedActions.cend();
+ for ( auto aItrShared = aItr->maSharedActions.cbegin(); aItrShared != aEndShared; ++aItrShared )
{
if ( DoActionsIntersect( mpTrack->GetAction( *aItrShared ), pAction ) )
{
@@ -176,8 +176,8 @@ ScConflictsListEntry* ScConflictsFinder::GetIntersectingEntry( const ScChangeAct
}
}
- ScChangeActionList::const_iterator aEndOwn = aItr->maOwnActions.end();
- for ( ScChangeActionList::const_iterator aItrOwn = aItr->maOwnActions.begin(); aItrOwn != aEndOwn; ++aItrOwn )
+ auto aEndOwn = aItr->maOwnActions.cend();
+ for ( auto aItrOwn = aItr->maOwnActions.cbegin(); aItrOwn != aEndOwn; ++aItrOwn )
{
if ( DoActionsIntersect( mpTrack->GetAction( *aItrOwn ), pAction ) )
{
@@ -189,7 +189,7 @@ ScConflictsListEntry* ScConflictsFinder::GetIntersectingEntry( const ScChangeAct
return nullptr;
}
-ScConflictsListEntry* ScConflictsFinder::GetEntry( sal_uLong nSharedAction, const ScChangeActionList& rOwnActions )
+ScConflictsListEntry* ScConflictsFinder::GetEntry( sal_uLong nSharedAction, const std::vector<sal_uLong>& rOwnActions )
{
// try to get a list entry which already contains the shared action
ScConflictsListEntry* pEntry = ScConflictsListHelper::GetSharedActionEntry( mrConflictsList, nSharedAction );
@@ -209,8 +209,8 @@ ScConflictsListEntry* ScConflictsFinder::GetEntry( sal_uLong nSharedAction, cons
// try to get a list entry for which any of the own actions intersects with
// any other action of this entry
- ScChangeActionList::const_iterator aEnd = rOwnActions.end();
- for ( ScChangeActionList::const_iterator aItr = rOwnActions.begin(); aItr != aEnd; ++aItr )
+ auto aEnd = rOwnActions.cend();
+ for ( auto aItr = rOwnActions.cbegin(); aItr != aEnd; ++aItr )
{
pEntry = GetIntersectingEntry( mpTrack->GetAction( *aItr ) );
if ( pEntry )
@@ -239,7 +239,7 @@ bool ScConflictsFinder::Find()
ScChangeAction* pSharedAction = mpTrack->GetAction( mnStartShared );
while ( pSharedAction && pSharedAction->GetActionNumber() <= mnEndShared )
{
- ScChangeActionList aOwnActions;
+ std::vector<sal_uLong> aOwnActions;
ScChangeAction* pOwnAction = mpTrack->GetAction( mnStartOwn );
while ( pOwnAction && pOwnAction->GetActionNumber() <= mnEndOwn )
{
@@ -253,8 +253,8 @@ bool ScConflictsFinder::Find()
if ( aOwnActions.size() )
{
ScConflictsListEntry* pEntry = GetEntry( pSharedAction->GetActionNumber(), aOwnActions );
- ScChangeActionList::iterator aEnd = aOwnActions.end();
- for ( ScChangeActionList::iterator aItr = aOwnActions.begin(); aItr != aEnd; ++aItr )
+ auto aEnd = aOwnActions.end();
+ for ( auto aItr = aOwnActions.begin(); aItr != aEnd; ++aItr )
{
if ( pEntry && !ScConflictsListHelper::HasOwnAction( mrConflictsList, *aItr ) )
{
@@ -674,8 +674,8 @@ void ScConflictsDlg::UpdateView()
pRootUserData->pData = static_cast< void* >( pConflictEntry );
SvTreeListEntry* pRootEntry = m_pLbConflicts->InsertEntry( GetConflictString( *aItr ), pRootUserData );
- ScChangeActionList::const_iterator aEndShared = aItr->maSharedActions.end();
- for ( ScChangeActionList::const_iterator aItrShared = aItr->maSharedActions.begin(); aItrShared != aEndShared; ++aItrShared )
+ auto aEndShared = aItr->maSharedActions.cend();
+ for ( auto aItrShared = aItr->maSharedActions.cbegin(); aItrShared != aEndShared; ++aItrShared )
{
ScChangeAction* pAction = mpSharedTrack ? mpSharedTrack->GetAction(*aItrShared) : nullptr;
if ( pAction )
@@ -695,8 +695,8 @@ void ScConflictsDlg::UpdateView()
}
}
- ScChangeActionList::const_iterator aEndOwn = aItr->maOwnActions.end();
- for ( ScChangeActionList::const_iterator aItrOwn = aItr->maOwnActions.begin(); aItrOwn != aEndOwn; ++aItrOwn )
+ auto aEndOwn = aItr->maOwnActions.cend();
+ for ( auto aItrOwn = aItr->maOwnActions.cbegin(); aItrOwn != aEndOwn; ++aItrOwn )
{
ScChangeAction* pAction = mpOwnTrack ? mpOwnTrack->GetAction(*aItrOwn) : nullptr;
if ( pAction )