I really wonder why I spend so much time on this method since it only
is used _twice_. I discovered that a bit late...
It is used in BufferView::insertErrors and in BufferView::setCursorFromRow.
In insertErrors it is correct to increase the pos, but for
setCursorFromRow it is not. I have added a method TexRow::increasePos(...)
to handle the pos increasing... doing this should not be
getIdFromRow's task.
It also seems that setCursorFromRow has a problem. If the row it asks
for does not exist it will put the cursor at the top of the document.
Why is that wanted? Wouldn't it be just as correct to do nothing?
(perhaps a way to notify calles could be used? It is only called once
in LFUN_GOTOFILEROW. I wonder if anyone ever use that code? I can't
imagine that this code works at all...and if used without a buffer
loaded I think it will segfault...) If tere are no objections I will
get rid of setCursorFromRow and LFUN_GOTOFILEROW.
============
Also when looking into this it occured to me that the InsetError and
its insertion into the LyXParagraph is not a very clever thing to do,
it is the easy option, I will admit to that. I'd really like to get
rid of the error insets altogether, but we then need something to
replace it. My suggestion would be a Errors dialog, this dialog would
have a multiline object that contains the beginning of each error msg.
Click on a line and the document cursor is moved to te location of the
error at the same time the full error text is also showed in the Error
Dialog. The dialog could also have "Next" and "Prev" buttons to
navigate among the errors. I really belive this is easier to use than
the current scheme with error insets. The benefit from this would be
removal of some special case code, and no mucking around with elements
in paragraph that don't really belong in the document. Allan how should
this be done dialog wise? A click in the dialog must trigger a
setcursor in the BufferView.
Lgb