GetSelectionBounds procedure :(
Posted: Thu Mar 22, 2007 8:42 am
I've found, that this one works awfully.
For example, if two different text items are stuck together, and we make selection of the second item from the beginning, then GetSelectionBounds returns absolutely strange results.
It'll return the first item number as an item, from which selection starts, and the non-existent offset in this item (text length of the first item will be less, than the result by one). In this case I've got a lot of troubles for checking, which items are currently selected - I've wrote a lot of non-typical methods, which are using this procedure - and I've got a lot of bugs in them.
And the other one trouble.
For example, we've got the following string in editor:
Bigttring
And for example we need to change the first symbol in "ttring". We're selecting the first T symbol, and press the S-key.
And what we've got? The following one
Bigstring
As you see, the editor won't take style from the second selected item, but from the first one
It's very uncomfortable to make changes in this way
I think, that this trouble in code related to improper work of GetSelectionBounds - it won't determine the right style and will take it from first one, not from current selection.
For example, if two different text items are stuck together, and we make selection of the second item from the beginning, then GetSelectionBounds returns absolutely strange results.
It'll return the first item number as an item, from which selection starts, and the non-existent offset in this item (text length of the first item will be less, than the result by one). In this case I've got a lot of troubles for checking, which items are currently selected - I've wrote a lot of non-typical methods, which are using this procedure - and I've got a lot of bugs in them.
And the other one trouble.
For example, we've got the following string in editor:
Bigttring
And for example we need to change the first symbol in "ttring". We're selecting the first T symbol, and press the S-key.
And what we've got? The following one
Bigstring
As you see, the editor won't take style from the second selected item, but from the first one
It's very uncomfortable to make changes in this way
I think, that this trouble in code related to improper work of GetSelectionBounds - it won't determine the right style and will take it from first one, not from current selection.