Page 1 of 1

URLScan produces invalid JumpIDs

Posted: Tue Dec 10, 2013 11:22 am
by Memnarch
Hi,
Currently using URLScan.pas for detecting URLs.

However, sometimes i load documents and the generated links have invalid jumpids(The returned itemno for the id is -1).

I am sorry that i can not share the document it occurs in, or source atm.

However, after each of the url function(except for the IsEMail, IsUrl, etc) i use Reformat. So i am a bit confused.

And what is the most recent version of the URLScan.pas?

Delphi XE on windows 7.

i'll try to create something for reproduction, but maybe someone can already answer the last question or give me some hints.

Greetings
Memnarch

Posted: Tue Dec 10, 2013 11:23 am
by Memnarch
PS: I ask for the ItemNo with the JumpID given by OnJump

Posted: Tue Dec 10, 2013 12:01 pm
by Sergey Tkachenko
JumpIDs are generated in the following cases:
- in TRichView - always
- in readonly TRichViewEdit, if rvoNoReadOnlyJumps is excluded from EditorOptions
- when Ctrl is pressed in TRichViewEdit, until it is released, if rvoCtrlJumps is included in EditorOptions.

As you can see, TRichViewEdit does not maintain JumpIDs, it generates them only when it is in a hypertext mode.
They are useful only in OnJump in OnRVMouseMove events.

Posted: Tue Dec 10, 2013 12:48 pm
by Memnarch
But this doesn't make sense to me. Why is OnJump called, if there is no jump when i click on a link?

Posted: Tue Dec 10, 2013 4:37 pm
by Memnarch
I found the source of the problem and continuing here:
http://www.trichview.com/forums/viewtop ... 5975#25975
as i don't think it is related to URLSCan.pas directly.

Greetings
Memnarch

Posted: Tue Dec 10, 2013 6:29 pm
by Sergey Tkachenko
OnJump is called only when clicking a link.
For an editor, this event is called only when the editor is in a hypertext mode. Normally, it is moved to a hypertext mode temporarily, when the user presses and holds Ctrl.