Kaydet (Commit) 3431e3f6 authored tarafından Julien Nabet's avatar Julien Nabet

Replace list by vector itemconnect (sfx2)

Change-Id: I753f655c11883e5bf705a2361a6d4d5e55ea88c9
Reviewed-on: https://gerrit.libreoffice.org/43377Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarJulien Nabet <serval2412@yahoo.fr>
üst 2b5b8fd3
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#include <svl/itempool.hxx> #include <svl/itempool.hxx>
#include <sfx2/itemconnect.hxx> #include <sfx2/itemconnect.hxx>
#include <list> #include <vector>
#include <memory> #include <memory>
namespace sfx { namespace sfx {
...@@ -247,35 +247,35 @@ public: ...@@ -247,35 +247,35 @@ public:
private: private:
typedef std::shared_ptr< ItemConnectionBase > ItemConnectionRef; typedef std::shared_ptr< ItemConnectionBase > ItemConnectionRef;
typedef std::list< ItemConnectionRef > ItemConnectionList; typedef std::vector< ItemConnectionRef > ItemConnectionVector;
typedef ItemConnectionList::iterator ItemConnectionListIt; typedef ItemConnectionVector::iterator ItemConnectionVectorIt;
ItemConnectionList maList; ItemConnectionVector maVector;
}; };
void ItemConnectionArrayImpl::Append( ItemConnectionBase* pConnection ) void ItemConnectionArrayImpl::Append( ItemConnectionBase* pConnection )
{ {
if( pConnection ) if( pConnection )
maList.push_back( ItemConnectionRef( pConnection ) ); maVector.push_back( ItemConnectionRef( pConnection ) );
} }
void ItemConnectionArrayImpl::ApplyFlags( const SfxItemSet* pItemSet ) void ItemConnectionArrayImpl::ApplyFlags( const SfxItemSet* pItemSet )
{ {
for( ItemConnectionListIt aIt = maList.begin(), aEnd = maList.end(); aIt != aEnd; ++aIt ) for (auto const& itemConnection : maVector)
(*aIt)->DoApplyFlags( pItemSet ); itemConnection->DoApplyFlags( pItemSet );
} }
void ItemConnectionArrayImpl::Reset( const SfxItemSet* pItemSet ) void ItemConnectionArrayImpl::Reset( const SfxItemSet* pItemSet )
{ {
for( ItemConnectionListIt aIt = maList.begin(), aEnd = maList.end(); aIt != aEnd; ++aIt ) for (auto const& itemConnection : maVector)
(*aIt)->DoReset( pItemSet ); itemConnection->DoReset( pItemSet );
} }
bool ItemConnectionArrayImpl::FillItemSet( SfxItemSet& rDestSet, const SfxItemSet& rOldSet ) bool ItemConnectionArrayImpl::FillItemSet( SfxItemSet& rDestSet, const SfxItemSet& rOldSet )
{ {
bool bChanged = false; bool bChanged = false;
for( ItemConnectionListIt aIt = maList.begin(), aEnd = maList.end(); aIt != aEnd; ++aIt ) for (auto const& itemConnection : maVector)
bChanged |= (*aIt)->DoFillItemSet( rDestSet, rOldSet ); bChanged |= itemConnection->DoFillItemSet( rDestSet, rOldSet );
return bChanged; return bChanged;
} }
......
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