Layout Editor crashes on double click

trnrez

20-03-2009 18:26:56

I created a Tab widget and then went over to the "Properties" panel and double clicked behind "[DEFAULT]" for ButtonWidth. This caused the system to crash inside of "MyGUI_Edit.cpp" at line 226.

Ogre::UTFString::reverse_iterator iterBack = text.rend() - cursorPosition;

I believe the fix is to make sure that the cursor position is not larger than the text size. I added this check before the "iterBack" is created and assigned:

if(cursorPosition > text.size())
return;


Now everything appears to work and I don't get a crash anymore :). Not sure this is considered the best fix but it works for me and I figured if I made it known that it crashes maybe someone could implement a real fix.

Altren

20-03-2009 19:28:22

Oh, looks like you found little bug. Fixed. Not so easy as you did it, but fixed :)