diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-08-09 12:32:01 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-08-09 16:13:09 +0200 |
commit | 6d0ea082889c89eb8b408779f2de08da7441ff54 (patch) | |
tree | b360bee33cf818f9ae707d54d8f7bc3ef6dc76ad /sw/source/core/layout/objstmpconsiderwrapinfl.cxx | |
parent | f1b5a236d315bf0d37bc6143c070a0c33471f6f7 (diff) |
forcepoint73 deleted SwAnchoredObject still referenced in TmpConsiderWrapInfl
Change-Id: If255723834d049865fcf6fd0eac7768dfcbad2a1
Reviewed-on: https://gerrit.libreoffice.org/58760
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw/source/core/layout/objstmpconsiderwrapinfl.cxx')
-rw-r--r-- | sw/source/core/layout/objstmpconsiderwrapinfl.cxx | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/sw/source/core/layout/objstmpconsiderwrapinfl.cxx b/sw/source/core/layout/objstmpconsiderwrapinfl.cxx index 01aa4d38a501..9c5a2240eeac 100644 --- a/sw/source/core/layout/objstmpconsiderwrapinfl.cxx +++ b/sw/source/core/layout/objstmpconsiderwrapinfl.cxx @@ -31,23 +31,18 @@ SwObjsMarkedAsTmpConsiderWrapInfluence::~SwObjsMarkedAsTmpConsiderWrapInfluence( void SwObjsMarkedAsTmpConsiderWrapInfluence::Insert( SwAnchoredObject& _rAnchoredObj ) { + auto it = std::find(maObjsTmpConsiderWrapInfl.begin(), maObjsTmpConsiderWrapInfl.end(), &_rAnchoredObj); + if (it != maObjsTmpConsiderWrapInfl.end()) + return; + maObjsTmpConsiderWrapInfl.push_back( &_rAnchoredObj ); +} - bool bAlreadyInserted( false ); - std::vector< SwAnchoredObject* >::const_iterator aIter = maObjsTmpConsiderWrapInfl.begin(); - for ( ; aIter != maObjsTmpConsiderWrapInfl.end(); ++aIter ) - { - const SwAnchoredObject* pAnchoredObj = *aIter; - if ( pAnchoredObj == &_rAnchoredObj ) - { - bAlreadyInserted = true; - break; - } - } - - if ( !bAlreadyInserted ) - { - maObjsTmpConsiderWrapInfl.push_back( &_rAnchoredObj ); - } +void SwObjsMarkedAsTmpConsiderWrapInfluence::Remove( SwAnchoredObject& _rAnchoredObj ) +{ + auto it = std::find(maObjsTmpConsiderWrapInfl.begin(), maObjsTmpConsiderWrapInfl.end(), &_rAnchoredObj); + if (it == maObjsTmpConsiderWrapInfl.end()) + return; + maObjsTmpConsiderWrapInfl.erase(it); } void SwObjsMarkedAsTmpConsiderWrapInfluence::Clear() |