diff options
author | Arkadiy Illarionov <qarkai@gmail.com> | 2018-06-25 00:01:52 +0300 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-06-25 09:11:16 +0200 |
commit | 087213c6a27de31d36d9ccb72a514048a0bb7724 (patch) | |
tree | 68fb37aad1e7b7bc51ec384c81ed75e72bbd81a6 | |
parent | 71d02f5b6ca78935df3d09ec0a5817f5870b056e (diff) |
tdf#96099 Remove trivial container typedefs in stoc, svl, svx, sw
Change-Id: I0b4d18d2120ba2ce7d2526332bec199f52393290
Reviewed-on: https://gerrit.libreoffice.org/56363
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
24 files changed, 81 insertions, 115 deletions
diff --git a/stoc/source/uriproc/UriReferenceFactory.cxx b/stoc/source/uriproc/UriReferenceFactory.cxx index ac1178bb491d..600df5e7cde2 100644 --- a/stoc/source/uriproc/UriReferenceFactory.cxx +++ b/stoc/source/uriproc/UriReferenceFactory.cxx @@ -211,10 +211,8 @@ css::uno::Reference< css::uri::XUriReference > parseGeneric( scheme, isHierarchical, hasAuthority, authority, path, hasQuery, query); } -typedef std::vector< sal_Int32 > Segments; - void processSegments( - Segments & segments, + std::vector<sal_Int32> & segments, css::uno::Reference< css::uri::XUriReference > const & uriReference, bool base, bool processSpecialSegments) { @@ -406,7 +404,7 @@ css::uno::Reference< css::uri::XUriReference > Factory::makeAbsolute( abs.append(baseUriReference->getAuthority()); } if (uriReference->hasRelativePath()) { - Segments segments; + std::vector<sal_Int32> segments; processSegments( segments, baseUriReference, true, processSpecialBaseSegments); processSegments(segments, uriReference, false, true); @@ -420,8 +418,7 @@ css::uno::Reference< css::uri::XUriReference > Factory::makeAbsolute( if (slash) { abs.append('/'); } - for (Segments::iterator i(segments.begin()); i != segments.end(); - ++i) + for (auto i(segments.begin()); i != segments.end(); ++i) { if (*i < -1) { OUString segment( diff --git a/svl/source/inc/poolio.hxx b/svl/source/inc/poolio.hxx index 59513517daba..a31897e6575d 100644 --- a/svl/source/inc/poolio.hxx +++ b/svl/source/inc/poolio.hxx @@ -40,13 +40,12 @@ static const sal_uInt32 SFX_ITEMS_DEFAULT = 0xfffffffe; */ struct SfxPoolItemArray_Impl { - typedef std::vector<sal_uInt32> FreeList; typedef std::unordered_map<SfxPoolItem*,sal_uInt32> PoolItemPtrToIndexMap; private: std::vector<SfxPoolItem*> maPoolItemVector; public: /// Track list of indices into our array that contain an empty slot - FreeList maFree; + std::vector<sal_uInt32> maFree; /// Hash of SfxPoolItem pointer to index into our array that contains that slot PoolItemPtrToIndexMap maPtrToIndex; diff --git a/svx/source/dialog/framelinkarray.cxx b/svx/source/dialog/framelinkarray.cxx index f0934c48dd7c..38681286f1f0 100644 --- a/svx/source/dialog/framelinkarray.cxx +++ b/svx/source/dialog/framelinkarray.cxx @@ -78,7 +78,6 @@ public: basegfx::B2DHomMatrix CreateCoordinateSystem(const Array& rArray, size_t nCol, size_t nRow, bool bExpandMerged) const; }; -typedef std::vector< long > LongVec; typedef std::vector< Cell > CellVec; basegfx::B2DHomMatrix Cell::CreateCoordinateSystem(const Array& rArray, size_t nCol, size_t nRow, bool bExpandMerged) const @@ -148,11 +147,11 @@ void Cell::MirrorSelfX() } -void lclRecalcCoordVec( LongVec& rCoords, const LongVec& rSizes ) +void lclRecalcCoordVec( std::vector<long>& rCoords, const std::vector<long>& rSizes ) { DBG_ASSERT( rCoords.size() == rSizes.size() + 1, "lclRecalcCoordVec - inconsistent vectors" ); - LongVec::iterator aCIt = rCoords.begin(); - LongVec::const_iterator aSIt = rSizes.begin(), aSEnd = rSizes.end(); + auto aCIt = rCoords.begin(); + auto aSIt = rSizes.cbegin(), aSEnd = rSizes.cend(); for( ; aSIt != aSEnd; ++aCIt, ++aSIt ) *(aCIt + 1) = *aCIt + *aSIt; } @@ -179,10 +178,10 @@ static const Cell OBJ_CELL_NONE; struct ArrayImpl { CellVec maCells; - LongVec maWidths; - LongVec maHeights; - mutable LongVec maXCoords; - mutable LongVec maYCoords; + std::vector<long> maWidths; + std::vector<long> maHeights; + mutable std::vector<long> maXCoords; + mutable std::vector<long> maYCoords; size_t mnWidth; size_t mnHeight; size_t mnFirstClipCol; diff --git a/svx/source/table/tablelayouter.cxx b/svx/source/table/tablelayouter.cxx index 10857ba30b52..49d0cf9dfa65 100644 --- a/svx/source/table/tablelayouter.cxx +++ b/svx/source/table/tablelayouter.cxx @@ -505,7 +505,6 @@ sal_Int32 TableLayouter::distribute( LayoutVector& rLayouts, sal_Int32 nDistribu typedef std::vector< CellRef > MergeableCellVector; typedef std::vector< MergeableCellVector > MergeVector; -typedef std::vector< sal_Int32 > Int32Vector; void TableLayouter::LayoutTableWidth( tools::Rectangle& rArea, bool bFit ) @@ -516,7 +515,7 @@ void TableLayouter::LayoutTableWidth( tools::Rectangle& rArea, bool bFit ) return; MergeVector aMergedCells( nColCount ); - Int32Vector aOptimalColumns; + std::vector<sal_Int32> aOptimalColumns; const OUString sOptimalSize("OptimalSize"); @@ -591,7 +590,7 @@ void TableLayouter::LayoutTableWidth( tools::Rectangle& rArea, bool bFit ) sal_Int32 nLeft = rArea.getWidth() - nCurrentWidth; sal_Int32 nDistribute = nLeft / aOptimalColumns.size(); - Int32Vector::iterator iter( aOptimalColumns.begin() ); + auto iter( aOptimalColumns.begin() ); while( iter != aOptimalColumns.end() ) { sal_Int32 nOptCol = (*iter++); @@ -670,7 +669,7 @@ void TableLayouter::LayoutTableHeight( tools::Rectangle& rArea, bool bFit ) Reference< XTableRows > xRows( mxTable->getRows() ); MergeVector aMergedCells( nRowCount ); - Int32Vector aOptimalRows; + std::vector<sal_Int32> aOptimalRows; const OUString sOptimalSize("OptimalSize"); @@ -751,7 +750,7 @@ void TableLayouter::LayoutTableHeight( tools::Rectangle& rArea, bool bFit ) sal_Int32 nLeft = rArea.getHeight() - nCurrentHeight; sal_Int32 nDistribute = nLeft / aOptimalRows.size(); - Int32Vector::iterator iter( aOptimalRows.begin() ); + auto iter( aOptimalRows.begin() ); while( iter != aOptimalRows.end() ) { sal_Int32 nOptRow = (*iter++); diff --git a/sw/inc/modeltoviewhelper.hxx b/sw/inc/modeltoviewhelper.hxx index d05630f91789..8c7783221757 100644 --- a/sw/inc/modeltoviewhelper.hxx +++ b/sw/inc/modeltoviewhelper.hxx @@ -99,12 +99,11 @@ class ModelToViewHelper bool m_bVisible; }; typedef std::vector< ConversionMapEntry > ConversionMap; - typedef std::vector<sal_Int32> Positions; ConversionMap m_aMap; /// store positions of fields and footnotes for grammar checkers - Positions m_FieldPositions; - Positions m_FootnotePositions; + std::vector<sal_Int32> m_FieldPositions; + std::vector<sal_Int32> m_FootnotePositions; OUString m_aRetText; @@ -163,8 +162,8 @@ public: ModelPosition ConvertToModelPosition( sal_Int32 nViewPos ) const; const OUString& getViewText() const { return m_aRetText; } - Positions const& getFieldPositions() const { return m_FieldPositions; } - Positions const& getFootnotePositions() const { return m_FootnotePositions;} + std::vector<sal_Int32> const& getFieldPositions() const { return m_FieldPositions; } + std::vector<sal_Int32> const& getFootnotePositions() const { return m_FootnotePositions;} }; #endif diff --git a/sw/source/core/access/accportions.cxx b/sw/source/core/access/accportions.cxx index 14b00e1b3dd4..55f548845af9 100644 --- a/sw/source/core/access/accportions.cxx +++ b/sw/source/core/access/accportions.cxx @@ -724,10 +724,8 @@ bool SwAccessiblePortionData::IsZeroCorePositionData() bool SwAccessiblePortionData::IsIndexInFootnode(sal_Int32 nIndex) { - VEC_PAIR_POS::iterator vi =m_vecPairPos.begin(); - for (;vi != m_vecPairPos.end() ; ++vi) + for (const auto & pairPos : m_vecPairPos) { - const PAIR_POS &pairPos = *vi; if(nIndex >= pairPos.first && nIndex < pairPos.second ) { return true; diff --git a/sw/source/core/access/accportions.hxx b/sw/source/core/access/accportions.hxx index d104728da5ad..92d4ce6218b2 100644 --- a/sw/source/core/access/accportions.hxx +++ b/sw/source/core/access/accportions.hxx @@ -61,8 +61,7 @@ class SwAccessiblePortionData : public SwPortionHandler Positions_t m_aFieldPosition; Positions_t m_aAttrFieldType; - typedef std::vector<sal_uInt8> PortionAttrs_t; - PortionAttrs_t m_aPortionAttrs; /// additional portion attributes + std::vector<sal_uInt8> m_aPortionAttrs; /// additional portion attributes std::unique_ptr<Positions_t> m_pSentences; /// positions of sentence breaks @@ -168,9 +167,7 @@ public: bool GetEditableRange( sal_Int32 nStart, sal_Int32 nEnd, sal_Int32& nCoreStart, sal_Int32& nCoreEnd ) const; private: - typedef std::pair<sal_Int32,sal_Int32> PAIR_POS; - typedef std::vector<PAIR_POS> VEC_PAIR_POS; - VEC_PAIR_POS m_vecPairPos; + std::vector< std::pair<sal_Int32,sal_Int32> > m_vecPairPos; }; #endif diff --git a/sw/source/core/inc/scriptinfo.hxx b/sw/source/core/inc/scriptinfo.hxx index 9386f1309e8e..47f1e8c9037b 100644 --- a/sw/source/core/inc/scriptinfo.hxx +++ b/sw/source/core/inc/scriptinfo.hxx @@ -31,7 +31,6 @@ class SwTextNode; class SwTextFrame; class Point; class MultiSelection; -typedef std::vector< sal_Int32 > PositionList; enum class SwFontScript; namespace sw { struct MergedPara; } @@ -222,7 +221,7 @@ public: */ static bool GetBoundsOfHiddenRange( const SwTextNode& rNode, sal_Int32 nPos, sal_Int32& rnStartPos, sal_Int32& rnEndPos, - PositionList* pList = nullptr ); + std::vector<sal_Int32>* pList = nullptr ); bool GetBoundsOfHiddenRange(TextFrameIndex nPos, TextFrameIndex & rnStartPos, TextFrameIndex & rnEndPos) const; diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx index 06baf68a148c..abd0a164aba6 100644 --- a/sw/source/core/text/porlay.cxx +++ b/sw/source/core/text/porlay.cxx @@ -1456,13 +1456,13 @@ sal_Int32 SwScriptInfo::MaskHiddenRanges( const SwTextNode& rNode, OUStringBuffe { assert(rNode.GetText().getLength() == rText.getLength()); - PositionList aList; + std::vector<sal_Int32> aList; sal_Int32 nHiddenStart; sal_Int32 nHiddenEnd; sal_Int32 nNumOfHiddenChars = 0; GetBoundsOfHiddenRange( rNode, 0, nHiddenStart, nHiddenEnd, &aList ); - PositionList::const_reverse_iterator rFirst( aList.end() ); - PositionList::const_reverse_iterator rLast( aList.begin() ); + auto rFirst( aList.crbegin() ); + auto rLast( aList.crend() ); while ( rFirst != rLast ) { nHiddenEnd = *(rFirst++); @@ -1488,12 +1488,12 @@ sal_Int32 SwScriptInfo::MaskHiddenRanges( const SwTextNode& rNode, OUStringBuffe // Takes a SwTextNode and deletes the hidden ranges from the node. void SwScriptInfo::DeleteHiddenRanges( SwTextNode& rNode ) { - PositionList aList; + std::vector<sal_Int32> aList; sal_Int32 nHiddenStart; sal_Int32 nHiddenEnd; GetBoundsOfHiddenRange( rNode, 0, nHiddenStart, nHiddenEnd, &aList ); - PositionList::const_reverse_iterator rFirst( aList.end() ); - PositionList::const_reverse_iterator rLast( aList.begin() ); + auto rFirst( aList.crbegin() ); + auto rLast( aList.crend() ); while ( rFirst != rLast ) { nHiddenEnd = *(rFirst++); @@ -1506,7 +1506,7 @@ void SwScriptInfo::DeleteHiddenRanges( SwTextNode& rNode ) bool SwScriptInfo::GetBoundsOfHiddenRange( const SwTextNode& rNode, sal_Int32 nPos, sal_Int32& rnStartPos, sal_Int32& rnEndPos, - PositionList* pList ) + std::vector<sal_Int32>* pList ) { rnStartPos = COMPLETE_STRING; rnEndPos = 0; diff --git a/sw/source/filter/basflt/fltshell.cxx b/sw/source/filter/basflt/fltshell.cxx index 2b0b3c12bd7d..31c18bca7930 100644 --- a/sw/source/filter/basflt/fltshell.cxx +++ b/sw/source/filter/basflt/fltshell.cxx @@ -305,7 +305,7 @@ void SwFltControlStack::DeleteAndDestroy(Entries::size_type nCnt) OSL_ENSURE(nCnt < m_Entries.size(), "Out of range!"); if (nCnt < m_Entries.size()) { - myEIter aElement = m_Entries.begin() + nCnt; + auto aElement = m_Entries.begin() + nCnt; m_Entries.erase(aElement); } //Clear the para end position recorded in reader intermittently for the least impact on loading performance @@ -377,7 +377,7 @@ SwFltStackEntry* SwFltControlStack::SetAttr(const SwPosition& rPos, (RES_FLTRATTR_BEGIN <= nAttrId && sal_uInt16(RES_FLTRATTR_END) > nAttrId), "Wrong id for attribute"); - myEIter aI = m_Entries.begin(); + auto aI = m_Entries.begin(); while (aI != m_Entries.end()) { bool bLastEntry = aI == m_Entries.end() - 1; diff --git a/sw/source/filter/inc/fltshell.hxx b/sw/source/filter/inc/fltshell.hxx index e1a8503d657d..9a84dccaa3f3 100644 --- a/sw/source/filter/inc/fltshell.hxx +++ b/sw/source/filter/inc/fltshell.hxx @@ -125,7 +125,6 @@ private: SwFltControlStack& operator=(SwFltControlStack const&) = delete; typedef std::deque<std::unique_ptr<SwFltStackEntry>> Entries; - typedef Entries::iterator myEIter; Entries m_Entries; sal_uLong nFieldFlags; diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx index 250aea6fcf8f..e0a8e7ba9dce 100644 --- a/sw/source/filter/ww8/wrtw8sty.cxx +++ b/sw/source/filter/ww8/wrtw8sty.cxx @@ -891,9 +891,8 @@ std::vector< const wwFont* > wwFontHelper::AsVector() const { std::vector<const wwFont *> aFontList( maFonts.size() ); - typedef std::map<wwFont, sal_uInt16>::const_iterator myiter; - myiter aEnd = maFonts.end(); - for ( myiter aIter = maFonts.begin(); aIter != aEnd; ++aIter ) + auto aEnd = maFonts.cend(); + for ( auto aIter = maFonts.cbegin(); aIter != aEnd; ++aIter ) aFontList[aIter->second] = &aIter->first; return aFontList; @@ -2163,7 +2162,6 @@ void WW8_WrPlcSubDoc::WriteGenericPlc( WW8Export& rWrt, sal_uInt8 nTTyp, OSL_ENSURE( aCps.size() + 2 == pTextPos->Count(), "WritePlc: DeSync" ); std::vector<std::pair<OUString,OUString> > aStrArr; - typedef std::vector<std::pair<OUString,OUString> >::iterator myiter; WW8Fib& rFib = *rWrt.pFib; // n+1-th CP-Pos according to the manual bool bWriteCP = true; @@ -2193,7 +2191,7 @@ void WW8_WrPlcSubDoc::WriteGenericPlc( WW8Export& rWrt, sal_uInt8 nTTyp, //sort and remove duplicates std::sort(aStrArr.begin(), aStrArr.end(),&lcl_AuthorComp); - myiter aIter = std::unique(aStrArr.begin(), aStrArr.end()); + auto aIter = std::unique(aStrArr.begin(), aStrArr.end()); aStrArr.erase(aIter, aStrArr.end()); // Also sort the start and end positions. We need to reference @@ -2376,7 +2374,7 @@ void WW8_WrPlcSubDoc::WriteGenericPlc( WW8Export& rWrt, sal_uInt8 nTTyp, const WW8_Annotation& rAtn = *static_cast<const WW8_Annotation*>(aContent[i]); //aStrArr is sorted - myiter aIter = std::lower_bound(aStrArr.begin(), + auto aIter = std::lower_bound(aStrArr.begin(), aStrArr.end(), std::pair<OUString,OUString>(rAtn.msOwner,OUString()), &lcl_AuthorComp); OSL_ENSURE(aIter != aStrArr.end() && aIter->first == rAtn.msOwner, diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx index d5fc888aa6c7..4db4d19550ff 100644 --- a/sw/source/filter/ww8/wrtww8.hxx +++ b/sw/source/filter/ww8/wrtww8.hxx @@ -1376,7 +1376,6 @@ private: WW8Export& rWrt; std::vector<GraphicDetails> maDetails; - typedef std::vector<GraphicDetails>::iterator myiter; sal_uInt16 mnIdx; // index in file positions static void WritePICFHeader(SvStream& rStrm, const ww8::Frame &rFly, diff --git a/sw/source/filter/ww8/wrtww8gr.cxx b/sw/source/filter/ww8/wrtww8gr.cxx index 6497403e5421..3d2624f654de 100644 --- a/sw/source/filter/ww8/wrtww8gr.cxx +++ b/sw/source/filter/ww8/wrtww8gr.cxx @@ -880,15 +880,15 @@ void SwWW8WrGrf::WriteGraphicNode(SvStream& rStrm, const GraphicDetails &rItem) void SwWW8WrGrf::Write() { SvStream& rStrm = *rWrt.pDataStrm; - myiter aEnd = maDetails.end(); - for (myiter aIter = maDetails.begin(); aIter != aEnd; ++aIter) + auto aEnd = maDetails.end(); + for (auto aIter = maDetails.begin(); aIter != aEnd; ++aIter) { sal_uInt32 nPos = rStrm.Tell(); // align to 4 Bytes if( nPos & 0x3 ) SwWW8Writer::FillCount( rStrm, 4 - ( nPos & 0x3 ) ); bool bDuplicated = false; - for (myiter aIter2 = maDetails.begin(); aIter2 != aIter; ++aIter2) + for (auto aIter2 = maDetails.begin(); aIter2 != aIter; ++aIter2) { if (*aIter2 == *aIter) { diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx index 50a59c00c442..7a0ce8b9bb89 100644 --- a/sw/source/filter/ww8/ww8graf.cxx +++ b/sw/source/filter/ww8/ww8graf.cxx @@ -753,9 +753,8 @@ void SwWW8ImplReader::InsertAttrsAsDrawingAttrs(WW8_CP nStartCp, WW8_CP nEndCp, for (size_t nI = m_xCtrlStck->size(); nI > nCurrentCount; --nI) m_xCtrlStck->DeleteAndDestroy(nI-1); - typedef std::deque<Chunk>::iterator myIter; - myIter aEnd = aChunks.end(); - for (myIter aIter = aChunks.begin(); aIter != aEnd; ++aIter) + auto aEnd = aChunks.end(); + for (auto aIter = aChunks.begin(); aIter != aEnd; ++aIter) { ESelection aSel(GetESelection(*m_pDrawEditEngine, aIter->GetStartPos()-nStartCp, aIter->GetEndPos()-nStartCp)); @@ -778,7 +777,7 @@ void SwWW8ImplReader::InsertAttrsAsDrawingAttrs(WW8_CP nStartCp, WW8_CP nEndCp, m_pDrawEditEngine->QuickInsertText(aString, aSel); nChanged = nOrigLen - aString.getLength(); } - for (myIter aIter2 = aIter+1; aIter2 != aEnd; ++aIter2) + for (auto aIter2 = aIter+1; aIter2 != aEnd; ++aIter2) aIter2->Adjust(nChanged); } diff --git a/sw/source/filter/ww8/ww8graf.hxx b/sw/source/filter/ww8/ww8graf.hxx index 4cbad48754ec..0a78445f02ce 100644 --- a/sw/source/filter/ww8/ww8graf.hxx +++ b/sw/source/filter/ww8/ww8graf.hxx @@ -51,7 +51,6 @@ private: typedef std::vector<EscherShape>::iterator myeiter; std::vector<short> maDrawHeight; - typedef std::vector<short>::iterator myditer; std::stack<sal_uInt16> maIndexes; diff --git a/sw/source/filter/ww8/ww8graf2.cxx b/sw/source/filter/ww8/ww8graf2.cxx index b35ec366cd5b..b606112d0595 100644 --- a/sw/source/filter/ww8/ww8graf2.cxx +++ b/sw/source/filter/ww8/ww8graf2.cxx @@ -216,8 +216,8 @@ void wwZOrderer::InsertTextLayerObject(SdrObject* pObject) */ sal_uLong wwZOrderer::GetDrawingObjectPos(short nWwHeight) { - myditer aIter = maDrawHeight.begin(); - myditer aEnd = maDrawHeight.end(); + auto aIter = maDrawHeight.begin(); + auto aEnd = maDrawHeight.end(); while (aIter != aEnd) { diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx index 542f6fed46dd..5c0bee451514 100644 --- a/sw/source/filter/ww8/ww8par3.cxx +++ b/sw/source/filter/ww8/ww8par3.cxx @@ -791,7 +791,6 @@ bool WW8ListManager::ReadLVL(SwNumFormat& rNumFormat, std::unique_ptr<SfxItemSet from a copy of the aOfsNumsXCH. */ std::vector<sal_uInt8> aOfsNumsXCH; - typedef std::vector<sal_uInt8>::iterator myIter; aOfsNumsXCH.reserve(nMaxLevel); for(sal_uInt8 nLevelB = 0; nLevelB < nMaxLevel; ++nLevelB) @@ -814,8 +813,8 @@ bool WW8ListManager::ReadLVL(SwNumFormat& rNumFormat, std::unique_ptr<SfxItemSet } } } - myIter aIter = std::remove(aOfsNumsXCH.begin(), aOfsNumsXCH.end(), 0); - myIter aEnd = aOfsNumsXCH.end(); + auto aIter = std::remove(aOfsNumsXCH.begin(), aOfsNumsXCH.end(), 0); + auto aEnd = aOfsNumsXCH.end(); // #i60633# - suppress access on <aOfsNumsXCH.end()> if ( aIter != aEnd ) { diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx index a7e91b17aadd..fa0c778ac906 100644 --- a/sw/source/filter/ww8/ww8scan.cxx +++ b/sw/source/filter/ww8/ww8scan.cxx @@ -3061,7 +3061,7 @@ bool WW8PLCFx_Fc_FKP::NewFkp() pFkp->Reset(GetStartFc()); else { - myiter aIter = + auto aIter = std::find_if(maFkpCache.begin(), maFkpCache.end(), SamePos(nPo)); if (aIter != maFkpCache.end()) { @@ -3111,8 +3111,8 @@ WW8PLCFx_Fc_FKP::WW8PLCFx_Fc_FKP(SvStream* pSt, SvStream* pTableSt, WW8PLCFx_Fc_FKP::~WW8PLCFx_Fc_FKP() { - myiter aEnd = maFkpCache.end(); - for (myiter aIter = maFkpCache.begin(); aIter != aEnd; ++aIter) + auto aEnd = maFkpCache.end(); + for (auto aIter = maFkpCache.begin(); aIter != aEnd; ++aIter) delete *aIter; delete pPLCF; delete pPCDAttrs; diff --git a/sw/source/filter/ww8/ww8scan.hxx b/sw/source/filter/ww8/ww8scan.hxx index 69ff529233a2..b7ec4eaac322 100644 --- a/sw/source/filter/ww8/ww8scan.hxx +++ b/sw/source/filter/ww8/ww8scan.hxx @@ -601,7 +601,6 @@ private: == 10 : 18549 pap, 47 chp == 5 : 18515 pap, 47 chp */ - typedef std::list<WW8Fkp*>::iterator myiter; std::list<WW8Fkp*> maFkpCache; enum Limits {eMaxCache = 50000}; diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx index ef3b40be1a12..3df800e908d4 100644 --- a/sw/source/ui/index/cnttab.cxx +++ b/sw/source/ui/index/cnttab.cxx @@ -2824,7 +2824,7 @@ void SwTokenWindow::SetForm(SwForm& rForm, sal_uInt16 nL) if(m_pForm) { - for (ctrl_iterator iter = m_aControlList.begin(); iter != m_aControlList.end(); ++iter) + for (auto iter = m_aControlList.begin(); iter != m_aControlList.end(); ++iter) iter->disposeAndClear(); //apply current level settings to the form for (auto it = m_aControlList.begin(); it != m_aControlList.end(); ++it) @@ -3027,8 +3027,8 @@ void SwTokenWindow::InsertAtSelection(const OUString& rText, const SwFormToken& const Control* pControl = nullptr; const Control* pExchange = nullptr; - ctrl_const_iterator it = m_aControlList.begin(); - for( ; it != m_aControlList.end() && m_pActiveCtrl != (*it); ++it ) + auto it = m_aControlList.cbegin(); + for( ; it != m_aControlList.cend() && m_pActiveCtrl != (*it); ++it ) { pControl = *it; @@ -3059,7 +3059,7 @@ void SwTokenWindow::InsertAtSelection(const OUString& rText, const SwFormToken& if(!bPreStartLinkFound && !bPreEndLinkFound) { - for( ; it != m_aControlList.end(); ++it ) + for( ; it != m_aControlList.cend(); ++it ) { pControl = *it; @@ -3119,7 +3119,7 @@ void SwTokenWindow::InsertAtSelection(const OUString& rText, const SwFormToken& //if the active control is text then insert a new button at the selection //else replace the button - ctrl_iterator iterActive = std::find(m_aControlList.begin(), + auto iterActive = std::find(m_aControlList.begin(), m_aControlList.end(), m_pActiveCtrl); assert(iterActive != m_aControlList.end()); @@ -3209,7 +3209,7 @@ void SwTokenWindow::RemoveControl(SwTOXButton* pDel, bool bInternalCall ) if(bInternalCall && TOX_AUTHORITIES == m_pForm->GetTOXType()) m_pParent->PreTokenButtonRemoved(pDel->GetFormToken()); - ctrl_iterator it = std::find(m_aControlList.begin(), m_aControlList.end(), pDel); + auto it = std::find(m_aControlList.begin(), m_aControlList.end(), pDel); assert(it != m_aControlList.end()); //Control does not exist! if (it == m_aControlList.end()) @@ -3221,7 +3221,7 @@ void SwTokenWindow::RemoveControl(SwTOXButton* pDel, bool bInternalCall ) if (it == m_aControlList.begin() || it == m_aControlList.end() - 1) return; - ctrl_iterator itLeft = it, itRight = it; + auto itLeft = it, itRight = it; --itLeft; ++itRight; VclPtr<Control> pLeftEdit = *itLeft; @@ -3247,7 +3247,7 @@ void SwTokenWindow::AdjustPositions() { if(m_aControlList.size() > 1) { - ctrl_iterator it = m_aControlList.begin(); + auto it = m_aControlList.begin(); Control* pCtrl = it->get(); ++it; @@ -3334,7 +3334,7 @@ IMPL_LINK(SwTokenWindow, ScrollHdl, Button*, pBtn, void ) if(pBtn == m_pLeftScrollWin) { //find the first completely visible control (left edge visible) - for (ctrl_iterator it = m_aControlList.begin(); it != m_aControlList.end(); ++it) + for (auto it = m_aControlList.begin(); it != m_aControlList.end(); ++it) { Control *pCtrl = it->get(); @@ -3350,7 +3350,7 @@ IMPL_LINK(SwTokenWindow, ScrollHdl, Button*, pBtn, void ) else { //move the left neighbor to the start position - ctrl_iterator itLeft = it; + auto itLeft = it; --itLeft; Control *pLeft = itLeft->get(); @@ -3364,7 +3364,7 @@ IMPL_LINK(SwTokenWindow, ScrollHdl, Button*, pBtn, void ) else { //find the first completely visible control (right edge visible) - for (ctrl_reverse_iterator it = m_aControlList.rbegin(); it != m_aControlList.rend(); ++it) + for (auto it = m_aControlList.rbegin(); it != m_aControlList.rend(); ++it) { Control *pCtrl = it->get(); @@ -3376,7 +3376,7 @@ IMPL_LINK(SwTokenWindow, ScrollHdl, Button*, pBtn, void ) if (it != m_aControlList.rbegin()) { //move the right neighbor to the right edge right aligned - ctrl_reverse_iterator itRight = it; + auto itRight = it; --itRight; Control *pRight = itRight->get(); nMove = nSpace - pRight->GetPosPixel().X() - pRight->GetSizePixel().Width(); @@ -3408,7 +3408,7 @@ OUString SwTokenWindow::GetPattern() const { OUString sRet; - for (ctrl_const_iterator it = m_aControlList.begin(); it != m_aControlList.end(); ++it) + for (auto it = m_aControlList.cbegin(); it != m_aControlList.cend(); ++it) { const Control *pCtrl = *it; @@ -3428,7 +3428,7 @@ bool SwTokenWindow::Contains(FormTokenType eSearchFor) const { bool bRet = false; - for (ctrl_const_iterator it = m_aControlList.begin(); it != m_aControlList.end(); ++it) + for (auto it = m_aControlList.cbegin(); it != m_aControlList.cend(); ++it) { const Control *pCtrl = *it; @@ -3494,18 +3494,18 @@ IMPL_LINK(SwTokenWindow, EditResize, Edit&, rEdit, void) IMPL_LINK(SwTokenWindow, NextItemHdl, SwTOXEdit&, rEdit, void) { - ctrl_iterator it = std::find(m_aControlList.begin(),m_aControlList.end(),&rEdit); + auto it = std::find(m_aControlList.begin(),m_aControlList.end(),&rEdit); if (it == m_aControlList.end()) return; - ctrl_iterator itTest = it; + auto itTest = it; ++itTest; if ((it != m_aControlList.begin() && !rEdit.IsNextControl()) || (itTest != m_aControlList.end() && rEdit.IsNextControl())) { - ctrl_iterator iterFocus = it; + auto iterFocus = it; rEdit.IsNextControl() ? ++iterFocus : --iterFocus; Control *pCtrlFocus = iterFocus->get(); @@ -3530,19 +3530,19 @@ IMPL_LINK(SwTokenWindow, TbxFocusHdl, Control&, rControl, void) IMPL_LINK(SwTokenWindow, NextItemBtnHdl, SwTOXButton&, rBtn, void ) { - ctrl_iterator it = std::find(m_aControlList.begin(),m_aControlList.end(),&rBtn); + auto it = std::find(m_aControlList.begin(),m_aControlList.end(),&rBtn); if (it == m_aControlList.end()) return; - ctrl_iterator itTest = it; + auto itTest = it; ++itTest; if (!rBtn.IsNextControl() || (itTest != m_aControlList.end() && rBtn.IsNextControl())) { bool isNext = rBtn.IsNextControl(); - ctrl_iterator iterFocus = it; + auto iterFocus = it; isNext ? ++iterFocus : --iterFocus; Control *pCtrlFocus = iterFocus->get(); @@ -3568,7 +3568,7 @@ IMPL_LINK(SwTokenWindow, NextItemBtnHdl, SwTOXButton&, rBtn, void ) IMPL_LINK(SwTokenWindow, TbxFocusBtnHdl, Control&, rControl, void ) { SwTOXButton* pBtn = static_cast<SwTOXButton*>(&rControl); - for (ctrl_iterator it = m_aControlList.begin(); it != m_aControlList.end(); ++it) + for (auto it = m_aControlList.begin(); it != m_aControlList.end(); ++it) { Control *pControl = it->get(); @@ -3615,7 +3615,7 @@ sal_uInt32 SwTokenWindow::GetControlIndex(FormTokenType eType) const } sal_uInt32 nIndex = 0; - for (ctrl_const_iterator it = m_aControlList.begin(); it != m_aControlList.end(); ++it) + for (auto it = m_aControlList.cbegin(); it != m_aControlList.cend(); ++it) { const Control* pControl = *it; const SwFormToken& rNewToken = WindowType::EDIT == pControl->GetType() diff --git a/sw/source/ui/misc/glosbib.cxx b/sw/source/ui/misc/glosbib.cxx index dc957cb7650c..f5afb1da7a2c 100644 --- a/sw/source/ui/misc/glosbib.cxx +++ b/sw/source/ui/misc/glosbib.cxx @@ -138,8 +138,7 @@ void SwGlossaryGroupDlg::Apply() OUString aActGroup = SwGlossaryDlg::GetCurrGroup(); - for (OUVector_t::const_iterator it(m_RemovedArr.begin()); - it != m_RemovedArr.end(); ++it) + for (auto it(m_RemovedArr.cbegin()); it != m_RemovedArr.cend(); ++it) { const OUString sDelGroup = it->getToken(0, '\t'); if( sDelGroup == aActGroup ) @@ -166,8 +165,7 @@ void SwGlossaryGroupDlg::Apply() } //don't rename before there was one - for (OUVector_t::const_iterator it(m_RenamedArr.begin()); - it != m_RenamedArr.end(); ++it) + for (auto it(m_RenamedArr.cbegin()); it != m_RenamedArr.cend(); ++it) { OUString const sOld(it->getToken(0, RENAME_TOKEN_DELIM)); OUString sNew(it->getToken(1, RENAME_TOKEN_DELIM)); @@ -178,8 +176,7 @@ void SwGlossaryGroupDlg::Apply() sCreatedGroup = sNew; } } - for (OUVector_t::const_iterator it(m_InsertedArr.begin()); - it != m_InsertedArr.end(); ++it) + for (auto it(m_InsertedArr.cbegin()); it != m_InsertedArr.cend(); ++it) { OUString sNewGroup = *it; OUString sNewTitle = sNewGroup.getToken(0, GLOS_DELIM); @@ -246,8 +243,7 @@ IMPL_LINK( SwGlossaryGroupDlg, DeleteHdl, Button*, pButton, void ) OUString const sEntry(pUserData->sGroupName); // if the name to be deleted is among the new ones - get rid of it bool bDelete = true; - for (OUVector_t::iterator it(m_InsertedArr.begin()); - it != m_InsertedArr.end(); ++it) + for (auto it(m_InsertedArr.begin()); it != m_InsertedArr.end(); ++it) { if (*it == sEntry) { @@ -260,8 +256,7 @@ IMPL_LINK( SwGlossaryGroupDlg, DeleteHdl, Button*, pButton, void ) // it should probably be renamed? if(bDelete) { - for (OUVector_t::iterator it(m_RenamedArr.begin()); - it != m_RenamedArr.end(); ++it) + for (auto it(m_RenamedArr.begin()); it != m_RenamedArr.end(); ++it) { if (it->getToken(0, RENAME_TOKEN_DELIM) == sEntry) { @@ -297,8 +292,7 @@ IMPL_LINK_NOARG(SwGlossaryGroupDlg, RenameHdl, Button*, void) // if the name to be renamed is among the new ones - replace bool bDone = false; - for (OUVector_t::iterator it(m_InsertedArr.begin()); - it != m_InsertedArr.end(); ++it) + for (auto it(m_InsertedArr.begin()); it != m_InsertedArr.end(); ++it) { if (*it == sEntry) { @@ -391,8 +385,7 @@ bool SwGlossaryGroupDlg::IsDeleteAllowed(const OUString &rGroup) // as well! Because for non existing region names ReadOnly issues // true. - for (OUVector_t::const_iterator it(m_InsertedArr.begin()); - it != m_InsertedArr.end(); ++it) + for (auto it(m_InsertedArr.cbegin()); it != m_InsertedArr.cend(); ++it) { if (*it == rGroup) { diff --git a/sw/source/uibase/inc/glosbib.hxx b/sw/source/uibase/inc/glosbib.hxx index 6c6565a57880..216bae4d6c45 100644 --- a/sw/source/uibase/inc/glosbib.hxx +++ b/sw/source/uibase/inc/glosbib.hxx @@ -73,10 +73,9 @@ class SwGlossaryGroupDlg final : public SvxStandardDialog VclPtr<PushButton> m_pDelPB; VclPtr<PushButton> m_pRenamePB; - typedef std::vector< OUString> OUVector_t; - OUVector_t m_RemovedArr; - OUVector_t m_InsertedArr; - OUVector_t m_RenamedArr; + std::vector<OUString> m_RemovedArr; + std::vector<OUString> m_InsertedArr; + std::vector<OUString> m_RenamedArr; SwGlossaryHdl *pGlosHdl; diff --git a/sw/source/uibase/inc/swuicnttab.hxx b/sw/source/uibase/inc/swuicnttab.hxx index 8d377ae64ed6..892d88256a14 100644 --- a/sw/source/uibase/inc/swuicnttab.hxx +++ b/sw/source/uibase/inc/swuicnttab.hxx @@ -236,11 +236,6 @@ public: class SwTokenWindow : public VclHBox, public VclBuilderContainer { - typedef std::vector<VclPtr<Control> >::iterator ctrl_iterator; - typedef std::vector<VclPtr<Control> >::const_iterator ctrl_const_iterator; - typedef std::vector<VclPtr<Control> >::reverse_iterator ctrl_reverse_iterator; - typedef std::vector<VclPtr<Control> >::const_reverse_iterator ctrl_const_reverse_iterator; - VclPtr<Button> m_pLeftScrollWin; VclPtr<vcl::Window> m_pCtrlParentWin; VclPtr<Button> m_pRightScrollWin; |