Detecting whether a style is hypertext
Posted: Mon Mar 06, 2006 1:22 pm
Hi there,
I have a very odd problem. I'm trying to detect whether the current item has a hypertext (jump) style, and if so, I want to select all of its text. This is the code I'm using (rveSnippets is the TRichViewEdit, and rvsSnippets is the associated TRVStyle):
CurrItem := rveSnippets.CurItemNo;
StyleNo := rveSnippets.CurItemStyle;
if rvsSnippets.TextStyles[StyleNo].Jump then
//we have an existing link
begin
//Select the entire item
rveSnippets.SetSelectionBounds(CurrItem, 0, CurrItem, 1);
rveSnippets.Invalidate;
end;
The problem is that the code does nothing: in fact, I'm pretty sure it's completely eliminated by the linker, because setting a breakpoint on any of these lines gives me the green breakpoint-with-a-cross symbol that means it'll never break. Can anyone suggest why, or what I'm doing wrong?
Cheers,
Martin
I have a very odd problem. I'm trying to detect whether the current item has a hypertext (jump) style, and if so, I want to select all of its text. This is the code I'm using (rveSnippets is the TRichViewEdit, and rvsSnippets is the associated TRVStyle):
CurrItem := rveSnippets.CurItemNo;
StyleNo := rveSnippets.CurItemStyle;
if rvsSnippets.TextStyles[StyleNo].Jump then
//we have an existing link
begin
//Select the entire item
rveSnippets.SetSelectionBounds(CurrItem, 0, CurrItem, 1);
rveSnippets.Invalidate;
end;
The problem is that the code does nothing: in fact, I'm pretty sure it's completely eliminated by the linker, because setting a breakpoint on any of these lines gives me the green breakpoint-with-a-cross symbol that means it'll never break. Can anyone suggest why, or what I'm doing wrong?
Cheers,
Martin