[scribus-dev] Proper fix for "cursor blink crash"/"invisible cursor" dilemma

Elvis Stansvik elvstone at gmail.com
Thu Aug 18 19:49:02 UTC 2011


Hello again,

Perhaps a slightly trickier question this time.

In the regular edit mode there's currently a "fix" for a crash that
happens when it is trying to draw the blinking cursor of a text frame
that has only one row of text and which has overflowed.

You can see it in CanvasMode_Edit::drawTextCursor(...):

 209         //CB: If we have this test in we get no initial cursor
placed for a new text frame
 210         // but if we do, we crash when we resize.. #9886
 211         if(textframe->lastInFrame() < 0)
 212                 return;

lastInFrame() < 0 happens when there is no text in the frame.

I've duplicated this fix in my code, since I hit the same crash.

Does anyone know what a proper fix would be? Because currently this
means that the cursor is initially invisible when activating a cell.
It won't be visible until you start typing :/

Should lastInFrame() really be allowed to return < 0 values?

Hoping that there's a better way to fix this, since it's kind of a
bummer when you're navigating empty cells in a table --- you can't see
where you are.

Cheers,
Elvis



More information about the scribus-dev mailing list