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 @@
#include <svl/itempool.hxx>
#include <sfx2/itemconnect.hxx>
#include <list>
#include <vector>
#include <memory>
namespace sfx {
......@@ -247,35 +247,35 @@ public:
private:
typedef std::shared_ptr< ItemConnectionBase > ItemConnectionRef;
typedef std::list< ItemConnectionRef > ItemConnectionList;
typedef ItemConnectionList::iterator ItemConnectionListIt;
typedef std::vector< ItemConnectionRef > ItemConnectionVector;
typedef ItemConnectionVector::iterator ItemConnectionVectorIt;
ItemConnectionList maList;
ItemConnectionVector maVector;
};
void ItemConnectionArrayImpl::Append( ItemConnectionBase* pConnection )
{
if( pConnection )
maList.push_back( ItemConnectionRef( pConnection ) );
maVector.push_back( ItemConnectionRef( pConnection ) );
}
void ItemConnectionArrayImpl::ApplyFlags( const SfxItemSet* pItemSet )
{
for( ItemConnectionListIt aIt = maList.begin(), aEnd = maList.end(); aIt != aEnd; ++aIt )
(*aIt)->DoApplyFlags( pItemSet );
for (auto const& itemConnection : maVector)
itemConnection->DoApplyFlags( pItemSet );
}
void ItemConnectionArrayImpl::Reset( const SfxItemSet* pItemSet )
{
for( ItemConnectionListIt aIt = maList.begin(), aEnd = maList.end(); aIt != aEnd; ++aIt )
(*aIt)->DoReset( pItemSet );
for (auto const& itemConnection : maVector)
itemConnection->DoReset( pItemSet );
}
bool ItemConnectionArrayImpl::FillItemSet( SfxItemSet& rDestSet, const SfxItemSet& rOldSet )
{
bool bChanged = false;
for( ItemConnectionListIt aIt = maList.begin(), aEnd = maList.end(); aIt != aEnd; ++aIt )
bChanged |= (*aIt)->DoFillItemSet( rDestSet, rOldSet );
for (auto const& itemConnection : maVector)
bChanged |= itemConnection->DoFillItemSet( rDestSet, rOldSet );
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