Kaydet (Commit) 6bbdf4dd authored tarafından Caolán McNamara's avatar Caolán McNamara

Resolves: fdo#39995 restore original semantics of GDIMetaFile::ReplaceAction

These semantics are fairly horrific, but existing code expects them, so
callers need to be changed if this is changed.
üst f3aebf9a
...@@ -340,17 +340,14 @@ MetaAction* GDIMetaFile::NextAction() ...@@ -340,17 +340,14 @@ MetaAction* GDIMetaFile::NextAction()
MetaAction* GDIMetaFile::ReplaceAction( MetaAction* pAction, size_t nAction ) MetaAction* GDIMetaFile::ReplaceAction( MetaAction* pAction, size_t nAction )
{ {
if ( nAction < aList.size() ) if ( nAction >= aList.size() )
{ return NULL;
::std::vector< MetaAction* >::iterator it = aList.begin(); //fdo#39995 This does't increment the incoming action ref-count nor does it
::std::advance( it, nAction ); //decrement the outgoing action ref-count
(*it)->Delete(); std::swap(pAction, aList[nAction]);
*it = pAction;
}
return pAction; return pAction;
} }
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
GDIMetaFile& GDIMetaFile::operator=( const GDIMetaFile& rMtf ) GDIMetaFile& GDIMetaFile::operator=( const GDIMetaFile& rMtf )
......
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