Fix crash in recentfilelist

git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository@228 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
harrybharry 2008-06-12 22:24:03 +00:00
parent f7f1e9bf77
commit c87f33fbea

View File

@ -141,18 +141,19 @@ std::string & LastRecentFileList::getIndex(int index) {
void LastRecentFileList::setUserMaxNbLRF(int size) {
if (size < _userMax) { //start popping items
int toPop = _userMax-size;
_userMax = size;
if (_size > _userMax) { //start popping items
int toPop = _size-_userMax;
while(toPop > 0) {
::RemoveMenu(_hMenu, _lrfl.back()._id, MF_BYCOMMAND);
setAvailable(_lrfl.back()._id);
_lrfl.pop_back();
toPop--;
_size--;
}
_size = size;
updateMenu();
_size = _userMax;
}
_userMax = size;
};