Apache OpenOffice (AOO) Bugzilla – Issue 106576
wbutton.cxx: bad call to erase
Last modified: 2014-04-09 19:00:56 UTC
For source code file toolkit/source/layout/vcl/wbutton.cxx, function Remove, around line 500 is the following code for ( std::list< Window*>::iterator it = maAdvanced.begin(); it != maAdvanced.end(); it++ ) if ( *it == w ) { lst.erase( it ); return *it; } So local variable "it" iterates over maAdvanced, but it is used on variable "lst". This looks wrong. Maybe the loop should iterate over lst, not maAdvanced ?
@PL: Please have a look.
pl->jcn: yes, the way it is it is certainly wrong. Moreover this Remove function removes it on lst, which is a list passed by value; in other words it removes the iterator from a temporary object resulting in no net effect aside from returning not NULL when the passed window was found. I assume lst should have been a reference instead of value ?
> I assume lst should have been a reference instead of value ? @pl: yes, that's what I figure too, looking at this code.
poke, do we have a fix for this or will I cook one up ?
OOo 3.3 is in showstopper-mode. This issue doesn't look like a stopper for the current release. I change the target to OOo 3.x. Please change the target accordingly when a fix is near to be integrated into a code line or promote it as stopper issues at the mailing list releases@openoffice.org, when it is urgent enough for OOo 3.3.
Reset assignee on issues not touched by assignee in more than 1000 days.