diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-04-08 21:36:56 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-04-09 08:46:25 +0200 |
commit | 115a8539038ecdd5e496fb6c84101c5b14d11068 (patch) | |
tree | 944afc61a076767be211140483ee892d14100aca | |
parent | e463ab92c3be84c603fe855464c213efb93b2120 (diff) |
std::list->std::vector in SubsetMap
Change-Id: I3fa98b787707dcbc555abe6aaa3a11e0fe467308
Reviewed-on: https://gerrit.libreoffice.org/52606
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | editeng/source/uno/unoedsrc.cxx | 4 | ||||
-rw-r--r-- | editeng/source/uno/unotext2.cxx | 4 | ||||
-rw-r--r-- | include/editeng/unoedsrc.hxx | 6 | ||||
-rw-r--r-- | include/svx/ucsubset.hxx | 6 | ||||
-rw-r--r-- | include/svx/unoshtxt.hxx | 2 | ||||
-rw-r--r-- | svx/source/dialog/charmap.cxx | 8 | ||||
-rw-r--r-- | svx/source/unodraw/unoshtxt.cxx | 12 |
7 files changed, 21 insertions, 21 deletions
diff --git a/editeng/source/uno/unoedsrc.cxx b/editeng/source/uno/unoedsrc.cxx index 9e2aa24b34ad..1c827472d11b 100644 --- a/editeng/source/uno/unoedsrc.cxx +++ b/editeng/source/uno/unoedsrc.cxx @@ -34,9 +34,9 @@ void SvxEditSource::removeRange( SvxUnoTextRangeBase* ) } -const SvxUnoTextRangeBaseList& SvxEditSource::getRanges() const +const SvxUnoTextRangeBaseVec& SvxEditSource::getRanges() const { - static SvxUnoTextRangeBaseList gList; + static SvxUnoTextRangeBaseVec gList; return gList; } diff --git a/editeng/source/uno/unotext2.cxx b/editeng/source/uno/unotext2.cxx index 908485f86683..9c2c26151cfd 100644 --- a/editeng/source/uno/unotext2.cxx +++ b/editeng/source/uno/unotext2.cxx @@ -51,7 +51,7 @@ SvxUnoTextContentEnumeration::SvxUnoTextContentEnumeration( const SvxUnoTextBase { if( currentPara>=maSelection.nStartPara && currentPara<=maSelection.nEndPara ) { - const SvxUnoTextRangeBaseList& rRanges( mpEditSource->getRanges() ); + const SvxUnoTextRangeBaseVec& rRanges( mpEditSource->getRanges() ); SvxUnoTextContent* pContent = nullptr; sal_Int32 nStartPos = 0; sal_Int32 nEndPos = mrText.GetEditSource()->GetTextForwarder()->GetTextLen( currentPara ); @@ -405,7 +405,7 @@ SvxUnoTextRangeEnumeration::SvxUnoTextRangeEnumeration(const SvxUnoTextBase& rTe nEndPos = std::min<sal_uInt16>(nEndPos, mnSel.nEndPos); ESelection aSel( mnParagraph, nStartPos, mnParagraph, nEndPos ); - const SvxUnoTextRangeBaseList& rRanges( mpEditSource->getRanges() ); + const SvxUnoTextRangeBaseVec& rRanges( mpEditSource->getRanges() ); SvxUnoTextRange* pRange = nullptr; for (auto const& elemRange : rRanges) { diff --git a/include/editeng/unoedsrc.hxx b/include/editeng/unoedsrc.hxx index 327ad7aeae19..adfdae894aeb 100644 --- a/include/editeng/unoedsrc.hxx +++ b/include/editeng/unoedsrc.hxx @@ -30,7 +30,7 @@ #include <editeng/editengdllapi.h> #include <editeng/editeng.hxx> -#include <list> +#include <vector> struct ESelection; struct EFieldInfo; @@ -45,7 +45,7 @@ class SvxFieldItem; class SfxBroadcaster; class SvxUnoTextRangeBase; -typedef std::list< SvxUnoTextRangeBase* > SvxUnoTextRangeBaseList; +typedef std::vector< SvxUnoTextRangeBase* > SvxUnoTextRangeBaseVec; /** Wrapper class for unified EditEngine/Outliner access @@ -122,7 +122,7 @@ public: /** returns a const list of all text ranges that are registered for the underlying text object. */ - virtual const SvxUnoTextRangeBaseList& getRanges() const; + virtual const SvxUnoTextRangeBaseVec& getRanges() const; }; diff --git a/include/svx/ucsubset.hxx b/include/svx/ucsubset.hxx index ae5286ec3863..121b790d47eb 100644 --- a/include/svx/ucsubset.hxx +++ b/include/svx/ucsubset.hxx @@ -52,7 +52,7 @@ inline bool operator<(const Subset &rLHS, const Subset &rRHS) return rLHS.GetRangeMin() < rRHS.GetRangeMin(); } -typedef ::std::list<Subset> SubsetList; +typedef ::std::vector<Subset> SubsetVec; class SVX_DLLPUBLIC SubsetMap { @@ -60,10 +60,10 @@ public: SubsetMap( const FontCharMapRef& ); const Subset* GetSubsetByUnicode( sal_UCS4 ) const; - const SubsetList& GetSubsetMap() const; + const SubsetVec& GetSubsetMap() const; private: - SubsetList maSubsets; + SubsetVec maSubsets; SVX_DLLPRIVATE void InitList(); SVX_DLLPRIVATE void ApplyCharMap( const FontCharMapRef& ); diff --git a/include/svx/unoshtxt.hxx b/include/svx/unoshtxt.hxx index f16358d2432d..7cb75bd1f118 100644 --- a/include/svx/unoshtxt.hxx +++ b/include/svx/unoshtxt.hxx @@ -64,7 +64,7 @@ public: virtual void addRange( SvxUnoTextRangeBase* pNewRange ) override; virtual void removeRange( SvxUnoTextRangeBase* pOldRange ) override; - virtual const SvxUnoTextRangeBaseList& getRanges() const override; + virtual const SvxUnoTextRangeBaseVec& getRanges() const override; virtual SfxBroadcaster& GetBroadcaster() const override; diff --git a/svx/source/dialog/charmap.cxx b/svx/source/dialog/charmap.cxx index 31db13cf61f7..8565db970e6f 100644 --- a/svx/source/dialog/charmap.cxx +++ b/svx/source/dialog/charmap.cxx @@ -865,7 +865,7 @@ SubsetMap::SubsetMap( const FontCharMapRef& rxFontCharMap ) ApplyCharMap(rxFontCharMap); } -const SubsetList& SubsetMap::GetSubsetMap() const +const SubsetVec& SubsetMap::GetSubsetMap() const { return maSubsets; } @@ -885,7 +885,7 @@ inline Subset::Subset(sal_UCS4 nMin, sal_UCS4 nMax, const OUString& rName) void SubsetMap::InitList() { - static SubsetList aAllSubsets; + static SubsetVec aAllSubsets; static bool bInit = true; if( bInit ) { @@ -1769,7 +1769,7 @@ void SubsetMap::InitList() #endif } - aAllSubsets.sort(); + std::stable_sort(aAllSubsets.begin(), aAllSubsets.end()); } maSubsets = aAllSubsets; @@ -1781,7 +1781,7 @@ void SubsetMap::ApplyCharMap( const FontCharMapRef& rxFontCharMap ) return; // remove subsets that are not matched in any range - SubsetList::iterator it = maSubsets.begin(); + auto it = maSubsets.begin(); while(it != maSubsets.end()) { const Subset& rSubset = *it; diff --git a/svx/source/unodraw/unoshtxt.cxx b/svx/source/unodraw/unoshtxt.cxx index f09305dd9939..a90040b10a86 100644 --- a/svx/source/unodraw/unoshtxt.cxx +++ b/svx/source/unodraw/unoshtxt.cxx @@ -99,7 +99,7 @@ private: bool mbNotificationsDisabled; // prevent EditEngine/Outliner notifications (e.g. when setting up forwarder) bool mbNotifyEditOutlinerSet; - SvxUnoTextRangeBaseList maTextRanges; + SvxUnoTextRangeBaseVec mvTextRanges; SvxTextForwarder* GetBackgroundTextForwarder(); SvxTextForwarder* GetEditModeTextForwarder(); @@ -132,7 +132,7 @@ public: void addRange( SvxUnoTextRangeBase* pNewRange ); void removeRange( SvxUnoTextRangeBase* pOldRange ); - const SvxUnoTextRangeBaseList& getRanges() const { return maTextRanges;} + const SvxUnoTextRangeBaseVec& getRanges() const { return mvTextRanges;} void lock(); void unlock(); @@ -238,15 +238,15 @@ SvxTextEditSourceImpl::~SvxTextEditSourceImpl() void SvxTextEditSourceImpl::addRange( SvxUnoTextRangeBase* pNewRange ) { if( pNewRange ) - if( std::find( maTextRanges.begin(), maTextRanges.end(), pNewRange ) == maTextRanges.end() ) - maTextRanges.push_back( pNewRange ); + if( std::find( mvTextRanges.begin(), mvTextRanges.end(), pNewRange ) == mvTextRanges.end() ) + mvTextRanges.push_back( pNewRange ); } void SvxTextEditSourceImpl::removeRange( SvxUnoTextRangeBase* pOldRange ) { if( pOldRange ) - maTextRanges.remove( pOldRange ); + mvTextRanges.erase( std::remove(mvTextRanges.begin(), mvTextRanges.end(), pOldRange), mvTextRanges.end() ); } @@ -1050,7 +1050,7 @@ void SvxTextEditSource::removeRange( SvxUnoTextRangeBase* pOldRange ) mpImpl->removeRange( pOldRange ); } -const SvxUnoTextRangeBaseList& SvxTextEditSource::getRanges() const +const SvxUnoTextRangeBaseVec& SvxTextEditSource::getRanges() const { return mpImpl->getRanges(); } |